Changeset 2960 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 09/20/08 23:35:20 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
r2958 r2960 67 67 pixel fragtex(fragin IN, 68 68 uniform sampler2D tex, 69 uniform float maxDepth, 70 uniform float4 ambient, 71 uniform float4 diffuse) 69 uniform float maxDepth) 72 70 { 73 71 pixel pix; 74 72 75 73 // save color in first render target 76 pix.col = (ambient + diffuse) * tex2D(tex, IN.texCoord.xy); 74 // hack: use comination of emmisive + diffuse (emmisive used as constant ambient term) 75 pix.col = (glstate.material.emission + glstate.material.diffuse) * tex2D(tex, IN.texCoord.xy); 77 76 78 77 // save world position in second render target … … 82 81 83 82 // hack: squeeze some information about ambient into the texture 84 pix.norm.w = ambient.x;83 pix.norm.w = glstate.material.emission.x; 85 84 // store projection coordinates with positions (used for ssao) 86 85 pix.pos.w = IN.projPos.w; … … 98 97 99 98 pixel frag(fragin IN, 100 uniform float maxDepth, 101 uniform float4 ambient, 102 uniform float4 diffuse 103 ) 99 uniform float maxDepth) 104 100 { 105 101 pixel pix; 106 102 107 pix.col = diffuse; 103 // hack: use comination of emmisive + diffuse (emmisive used as constant ambient term) 104 pix.col = glstate.material.diffuse + glstate.material.emission; 108 105 pix.pos = IN.worldPos * maxDepth; 109 106 … … 111 108 112 109 // hack: squeeze some information about the ambient term into the target 113 pix.norm.w = ambient.x;110 pix.norm.w = glstate.material.emission.x; 114 111 pix.pos.w = IN.mypos.w; 115 112
Note: See TracChangeset
for help on using the changeset viewer.