Ignore:
Timestamp:
07/13/08 23:51:02 (16 years ago)
Author:
mattausch
Message:

research version: implemented temporal smoothing and color bleeding

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg

    r2833 r2834  
    1717  float4 worldPos: TEXCOORD1; // world position 
    1818  float3 normal: TEXCOORD2; 
     19  float4 mypos: TEXCOORD3; 
    1920}; 
    2021 
     
    3031  float4 worldPos: TEXCOORD1; // world position 
    3132  float3 normal: TEXCOORD2; 
     33 
     34  float4 mypos: TEXCOORD3; 
     35  //float DEPTH; 
    3236}; 
    3337 
     
    4246 
    4347vtxout vtx(vtxin IN,  
    44            const uniform float4x4 ModelViewProj, 
    45            uniform float4x4 ModelMatrix) 
     48                   const uniform float4x4 ModelViewProj, 
     49                   uniform float4x4 ModelMatrix) 
    4650{ 
    4751   vtxout OUT; 
     
    5862   OUT.normal = IN.normal; 
    5963 
     64   OUT.mypos = OUT.position; 
    6065   return OUT; 
    6166} 
     
    6368 
    6469pixel fragtex(fragin IN,  
    65               uniform sampler2D tex,  
    66               uniform float maxDepth,  
    67               uniform float4 ambient,  
    68               uniform float4 diffuse) 
     70                          uniform sampler2D tex,  
     71                          uniform float maxDepth,  
     72                          uniform float4 ambient,  
     73                          uniform float4 diffuse) 
    6974{ 
    7075  pixel pix; 
     
    7782  // hack: store projection coordinate for scaling ssao 
    7883  pix.pos.w = IN.projPos.w; 
     84  pix.col.w = IN.mypos.z / IN.mypos.w; 
    7985 
    8086  return pix; 
     
    9197  pix.col = diffuse; 
    9298  pix.pos = IN.worldPos * maxDepth; 
    93   pix.norm.xyz = IN.normal * 0.5f + float4(0.5f); 
     99  pix.norm.xyz = IN.normal * 0.5f + float3(0.5f); 
    94100  // hack: squeeze some information about ambient into the texture 
    95101  pix.norm.w = ambient.x; 
    96   pix.pos.w = IN.projPos.w; 
     102  pix.pos.w = IN.mypos.w; //IN.projPos.w; 
     103  pix.col.w = IN.mypos.z / IN.mypos.w; 
    97104 
    98105  return pix; 
Note: See TracChangeset for help on using the changeset viewer.