Changeset 2893 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 09/02/08 00:56:48 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2892 r2893 80 80 uniform sampler2D normals, 81 81 uniform sampler2D shadowMap, 82 uniform float4x4 shadowMatrix 82 uniform float4x4 shadowMatrix, 83 uniform float maxDepth 83 84 ) 84 85 { … … 89 90 float4 position = tex2D(positions, IN.texCoord.xy); 90 91 91 float4 lightSpacePos = mul(shadowMatrix, position);92 93 float shadowDepth = tex2D(shadowMap, IN.texCoord.xy);94 92 95 93 // an ambient color term … … 99 97 float4 col = shade(IN, color, position, normal, amb); 100 98 99 position *= maxDepth; 100 position.w = 1.0f; 101 102 float4 lightSpacePos = mul(shadowMatrix, position); 103 104 float shadowDepth = tex2D(shadowMap, lightSpacePos.xy); 105 101 106 OUT.color = col; 102 107 103 if (lightSpacePos.z / lightSpacePos.w < shadowDepth) 108 // hack: prevent shadowing the sky 109 if ((amb < 0.9) && 110 (lightSpacePos.z / lightSpacePos.w > shadowDepth)) 104 111 { 105 112 OUT.color *= 0.1f; 106 113 } 107 114 108 //OUT.color = float4(lightSpacePos.z / lightSpacePos.w);115 //OUT.color = lightSpacePos;//float4(lightSpacePos.z / lightSpacePos.w); 109 116 //OUT.color = float4(shadowDepth); 110 117 OUT.color.w = color.w; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2892 r2893 71 71 float2 texcoord = IN.texCoord.xy + offsetTransformed * AREA_SIZE * w; 72 72 73 //if ((texcoord.x <= 1.0f) || (texcoord.x >= 0.0f) || (texcoord.y <= 1.0f) || (texcoord.y >= 0.0f)) 74 73 75 // sample downsampled texture in order to speed up texture accesses 74 76 float3 sample_position = tex2Dlod(positions, float4(texcoord, 0, 1)).xyz;
Note: See TracChangeset
for help on using the changeset viewer.