Changeset 2892 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 09/01/08 18:33:14 (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/deferred.cg
r2887 r2892 49 49 uniform sampler2D colors, 50 50 uniform sampler2D positions, 51 uniform sampler2D normals 51 uniform sampler2D normals 52 52 ) 53 53 { … … 72 72 return OUT; 73 73 } 74 75 /** The mrt shader for standard rendering 76 */ 77 pixel main_shadow(fragment IN, 78 uniform sampler2D colors, 79 uniform sampler2D positions, 80 uniform sampler2D normals, 81 uniform sampler2D shadowMap, 82 uniform float4x4 shadowMatrix 83 ) 84 { 85 pixel OUT; 86 87 float4 norm = tex2D(normals, IN.texCoord.xy); 88 float4 color = tex2Dlod(colors, float4(IN.texCoord.xy, 0, 0)); 89 float4 position = tex2D(positions, IN.texCoord.xy); 90 91 float4 lightSpacePos = mul(shadowMatrix, position); 92 93 float shadowDepth = tex2D(shadowMap, IN.texCoord.xy); 94 95 // an ambient color term 96 float amb = norm.w; 97 98 float3 normal = normalize(norm.xyz); 99 float4 col = shade(IN, color, position, normal, amb); 100 101 OUT.color = col; 102 103 if (lightSpacePos.z / lightSpacePos.w < shadowDepth) 104 { 105 OUT.color *= 0.1f; 106 } 107 108 //OUT.color = float4(lightSpacePos.z / lightSpacePos.w); 109 //OUT.color = float4(shadowDepth); 110 OUT.color.w = color.w; 111 112 return OUT; 113 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
r2891 r2892 13 13 float3 view: COLOR0; 14 14 }; 15 16 15 17 16 … … 67 66 for (int i = 0; i < NUM_SAMPLES; i ++) 68 67 { 69 //float2 offset = samples[i];70 float3 offset = float3(samples[i], 0);68 float2 offset = samples[i]; 69 //float3 offset = float3(samples[i], 0); 71 70 72 71 //sample noisetex; r stores costheta, g stores sintheta 73 //float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy;74 float3 mynoise = float3(tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy, 0);75 76 // r otation77 float2 offsetTransformed = reflect(offset, mynoise);72 float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy; 73 //float3 mynoise = float3(tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy, 0); 74 75 // reflect sampling using the noise texture 76 float2 offsetTransformed = myreflect(offset, mynoise); 78 77 79 78 // weight with projected coordinate to reach similar kernel size for near and far -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2891 r2892 56 56 for (int i = 0; i < NUM_SAMPLES; ++ i) 57 57 { 58 //const float2 offset = samples[i];59 const float3 offset = float3(samples[i], 0);58 const float2 offset = samples[i]; 59 //const float3 offset = float3(samples[i], 0); 60 60 61 61 //////////////////// … … 63 63 64 64 //const float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy * 2.0f - 1.0f; 65 //float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy;66 float3 mynoise = float3(tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy,0);65 float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy; 66 //float3 mynoise = float3(tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy,0); 67 67 68 const float2 offsetTransformed = reflect(offset, mynoise);68 const float2 offsetTransformed = myreflect(offset, mynoise); 69 69 70 70 // weight with projected coordinate to reach similar kernel size for near and far
Note: See TracChangeset
for help on using the changeset viewer.