- Timestamp:
- 09/25/08 18:37:03 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
r2965 r2974 75 75 76 76 // save color in first render target 77 // hack: use com ination of emmisive + diffuse (emmisive used as constant ambient term)77 // hack: use combination of emmisive + diffuse (emmisive used as constant ambient term) 78 78 pix.col = (glstate.material.emission + glstate.material.diffuse) * texColor; 79 79 80 80 // save world position in second render target 81 81 pix.pos = IN.worldPos * maxDepth; 82 // save normal in third rt82 // save world space normal in third rt 83 83 pix.norm.xyz = IN.normal; 84 84 85 // hack: squeeze some information about ambient into the texture86 pix.norm.w = glstate.material.emission.x;87 85 // store projection coordinates with positions (used for ssao) 88 pix.pos.w = IN.projPos.w; 86 pix.norm.w = IN.projPos.w; 87 // write the depth 88 pix.pos.w = IN.mypos.z / IN.mypos.w; 89 89 90 90 // account for alpha blending … … 92 92 discard; 93 93 94 // write the depth95 pix.col.w = IN.mypos.z / IN.mypos.w;94 // hack: squeeze some information about ambient into the texture 95 pix.col.w = glstate.material.emission.x; 96 96 97 97 return pix; … … 110 110 pix.norm.xyz = IN.normal; 111 111 112 // store projection coordinates with positions (used for ssao) 113 pix.norm.w = IN.mypos.w; 114 // the projected depth 115 pix.pos.w = IN.mypos.z / IN.mypos.w; 116 112 117 // hack: squeeze some information about the ambient term into the target 113 pix.norm.w = glstate.material.emission.x; 114 pix.pos.w = IN.mypos.w; 115 116 // the projected depth 117 pix.col.w = IN.mypos.z / IN.mypos.w; 118 pix.col.w = glstate.material.emission.x; 118 119 119 120 return pix;
Note: See TracChangeset
for help on using the changeset viewer.