Changeset 3110 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 11/07/08 16:40:53 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
r3092 r3110 38 38 float4 col: COLOR0; 39 39 float3 norm: COLOR1; 40 float3 pos: COLOR2;40 float3 id: COLOR2; 41 41 }; 42 42 … … 83 83 // compute eye linear depth 84 84 pix.col.w = length(IN.eyePos.xyz); 85 // hack: squeeze some information about ambient into the texture 86 //pix.col.w = glstate.material.emission.x; 85 // the scene entity id 86 pix.id = glstate.fog.color.xyz; 87 //pix.id = float3(1,1,1); 87 88 88 89 return pix; … … 101 102 // eye space depth 102 103 pix.col.w = length(IN.eyePos.xyz); 103 // hack: squeeze some information about the ambient term into the target104 //pix.col.w = glstate.material.emission.x;105 104 // the scene entity id 105 pix.id = glstate.fog.color.xyz; 106 106 107 return pix; 107 108 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/sky_preetham.cg
r3041 r3110 37 37 float4 col: COLOR0; 38 38 float3 norm: COLOR1; 39 float3 pos: COLOR2;39 float3 id: COLOR2; 40 40 }; 41 41 … … 83 83 0.055648f, -0.204043f, 1.057311f); 84 84 85 float3 hcol = mul(conv_Mat, XYZ); 86 OUT.color = float4(hcol, 1.0f); 85 //float3 hcol = mul(conv_Mat, XYZ); 86 //OUT.color = float4(hcol, 1.0f); 87 OUT.color = float4(mul(conv_Mat, XYZ), 1.0f); 87 88 88 89 OUT.color.rgb *= multiplier; … … 91 92 92 93 OUT.normal = IN.normal; 93 94 94 95 return OUT; 95 96 } … … 103 104 pix.col.w = 1e20f; 104 105 pix.norm = IN.normal; 105 106 // the scene entity id 107 pix.id = glstate.fog.color.xyz; 108 106 109 return pix; 107 110 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3109 r3110 150 150 float4x4 trafo; 151 151 152 if (id > 20) trafo = oldModelViewProj; 153 else trafo = inverseModelTrafo * oldModelViewProj; 152 if (id < 10) 153 trafo = oldModelViewProj; 154 else 155 trafo = inverseModelTrafo * oldModelViewProj; 154 156 155 157 // compute translational portion … … 350 352 uniform float3 oldtl, 351 353 uniform float3 oldtr, 352 uniform sampler2D attribs ,354 uniform sampler2D attribsTex, 353 355 uniform float4x4 inverseModelTrafo 354 356 ) … … 383 385 //-- compute temporally smoothing 384 386 385 float id = tex2Dlod(attribs, float4(IN.texCoord, 0, 0)).x;387 float3 id = tex2Dlod(attribsTex, float4(IN.texCoord, 0, 0)).xyz; 386 388 387 389 OUT.illum_col = temporalSmoothing(eyeSpacePos, eyeSpaceDepth, ao, IN.texCoord, oldEyePos, 388 390 oldTex, oldModelViewProj, temporalCoherence, 389 colors, w, bl, br, tl, tr, projPos, inverseModelTrafo, id ,391 colors, w, bl, br, tl, tr, projPos, inverseModelTrafo, id.z, 390 392 noiseTex, samples, scaleFactor, oldbl, oldbr, oldtl, oldtr); 391 393 394 //OUT.illum_col.xyz = id; 392 395 //OUT.illum_col.xyz = normal * 0.5f + 0.5f; 393 396 return OUT; … … 405 408 406 409 for (int i = 0; i < NUM_SSAO_FILTERSAMPLES; ++ i) 407 { 410 { 408 411 average += filterWeights[i] * tex2Dlod(ssaoTex, float4(texCoord + filterOffs[i] * scale, 0, 0)).x; 409 412 w += filterWeights[i]; … … 428 431 float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 429 432 430 if ((ao.y < 10.0f) && (col.w < 1e10f))431 ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights, 1.0f / (1.0f + ao.y));//ao.z);432 433 OUT.illum_col = col * ao.x;433 //if ((ao.y < 10.0f) && (col.w < 1e10f)) 434 // ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights, 1.0f / (1.0f + ao.y));//ao.z); 435 436 //OUT.illum_col = col * ao.x; 434 437 //OUT.illum_col = float4(ao.y, ao.y, ao.y, col.w); 435 //OUT.illum_col = float4(ao.x, ao.x, ao.x, col.w); 438 //OUT.illum_col = float4(ao.x, ao.y, ao.z, col.w); 439 OUT.illum_col = float4(ao.x, ao.x, ao.x, col.w); 436 440 //OUT.illum_col.xyz = float3(1.0f - ao.x, 1.0f - ao.y * 1e-2f, 1); 437 441 //OUT.illum_col.xyz = float3(1.0f - ao.x, ao.y, 0);
Note: See TracChangeset
for help on using the changeset viewer.