- Timestamp:
- 07/13/08 23:51:02 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
r2833 r2834 17 17 float4 worldPos: TEXCOORD1; // world position 18 18 float3 normal: TEXCOORD2; 19 float4 mypos: TEXCOORD3; 19 20 }; 20 21 … … 30 31 float4 worldPos: TEXCOORD1; // world position 31 32 float3 normal: TEXCOORD2; 33 34 float4 mypos: TEXCOORD3; 35 //float DEPTH; 32 36 }; 33 37 … … 42 46 43 47 vtxout vtx(vtxin IN, 44 const uniform float4x4 ModelViewProj,45 uniform float4x4 ModelMatrix)48 const uniform float4x4 ModelViewProj, 49 uniform float4x4 ModelMatrix) 46 50 { 47 51 vtxout OUT; … … 58 62 OUT.normal = IN.normal; 59 63 64 OUT.mypos = OUT.position; 60 65 return OUT; 61 66 } … … 63 68 64 69 pixel fragtex(fragin IN, 65 66 67 68 70 uniform sampler2D tex, 71 uniform float maxDepth, 72 uniform float4 ambient, 73 uniform float4 diffuse) 69 74 { 70 75 pixel pix; … … 77 82 // hack: store projection coordinate for scaling ssao 78 83 pix.pos.w = IN.projPos.w; 84 pix.col.w = IN.mypos.z / IN.mypos.w; 79 85 80 86 return pix; … … 91 97 pix.col = diffuse; 92 98 pix.pos = IN.worldPos * maxDepth; 93 pix.norm.xyz = IN.normal * 0.5f + float 4(0.5f);99 pix.norm.xyz = IN.normal * 0.5f + float3(0.5f); 94 100 // hack: squeeze some information about ambient into the texture 95 101 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; 97 104 98 105 return pix;
Note: See TracChangeset
for help on using the changeset viewer.