Ignore:
Timestamp:
05/12/07 14:22:06 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Blur.hlsl

    r2138 r2368  
    1 #define samplesU 7 
    2 #define samplesV 7 
     1#define samplesU 3 
     2#define samplesV 3 
    33 
    44struct VS_INPUT {            
     
    6767                        uniform float height, 
    6868                        uniform float face ) : COLOR 
    69 {   
    70  
     69{ 
     70/* 
    7171  float2 pixel = float2(2.0 / width, 2.0 / height); 
    7272  float2 uv = IN.Position + pixel * 0.5; 
     
    8989         } 
    9090                 
    91  
    92   sum /= samplesU * samplesV; 
     91*/ 
     92  float pixel = 2.0 / width; 
     93  float2 uv = IN.Position; 
     94  float3 u; 
     95  float3 v; 
     96  float3 pos; 
     97  if (face == 0){u = float3(0,0,-1); v = float3(0,1,0); pos = float3(1,uv.y,-uv.x);} 
     98  if (face == 1){u = float3(0,0,1); v = float3(0,1,0); pos = float3(-1,uv.y,uv.x);} 
     99  if (face == 2){u = float3(1,0,0); v = float3(0,0,-1); pos = float3(uv.x,1,-uv.y);} 
     100  if (face == 3){u = float3(1,0,0); v = float3(0,0,1); pos = float3(uv.x,-1,uv.y);} 
     101  if (face == 4){u = float3(1,0,0); v = float3(0,1,0); pos = float3(uv.x,uv.y,1);} 
     102  if (face == 5){u = float3(-1,0,0); v = float3(0,1,0); pos = float3(-uv.x,uv.y,-1);} 
     103  u *= pixel; 
     104  v *= pixel; 
     105  float4 sum = float4(0,0,0,0); 
     106  sum += texCUBE(Texture, pos); 
     107  sum += texCUBE(Texture, pos + u); 
     108  sum += texCUBE(Texture, pos + v); 
     109  sum += texCUBE(Texture, pos + u + v); 
     110  sum /= 4.0; 
    93111 
    94112  return sum; 
Note: See TracChangeset for help on using the changeset viewer.