Changeset 3026 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 10/12/08 15:43:22 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/antialiasing.cg
r2976 r3026 12 12 }; 13 13 14 // the barrier for detecting a discontinuity 15 uniform float4 e_barrier = float4(5e-5, 5e-5, 0, 0); // x = normal, y = depth16 // the weights for normal / depth discontinuity 17 uniform float4 e_weights = float4(0.5f, 0.5f, 1.0f, 1.0f); // x = normal, y = depth18 //uniform float4 e_weights = float4(1.0f, 1.0f, 1.0f, 1.0f); // x = normal, y = depth14 // the barrier for detecting a discontinuity (x = normal, y = depth) 15 uniform float4 e_barrier = float4(5e-5, 5e-5, 0, 0); 16 // the weights for normal / depth discontinuity (x = normal, y = depth) 17 uniform float4 e_weights = float4(0.5f, 0.5f, 1.0f, 1.0f); 18 //uniform float4 e_weights = float4(1.0f, 1.0f, 1.0f, 1.0f); 19 19 uniform float4 e_kernel = float4(0.5f, 1.0f, 1.0f, 1.0f); 20 20 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3025 r3026 61 61 pixel main(fragment IN, 62 62 uniform sampler2D colors, 63 uniform sampler2D positions,64 63 uniform sampler2D normals, 65 64 uniform float3 lightDir … … 151 150 uniform float4x4 shadowMatrix, 152 151 uniform float sampleWidth, 153 uniform sampler2D noise Texture,152 uniform sampler2D noise, 154 153 uniform float2 samples[NUM_PCF_TABS], 155 154 uniform float weights[NUM_PCF_TABS], … … 199 198 lightSpacePos /= lightSpacePos.w; 200 199 201 float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, weights, noise Texture);202 //float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, noise Texture);200 float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, weights, noise); 201 //float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, noise); 203 202 204 203 diffuse *= shadowTerm; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
r3019 r3026 61 61 uniform float3 currentNormal, 62 62 uniform float3 centerPosition, 63 float w,63 float scaleFactor, 64 64 uniform float3 bl, 65 65 uniform float3 br, … … 96 96 #endif 97 97 // weight with projected coordinate to reach similar kernel size for near and far 98 float2 texcoord = IN.texCoord.xy + offsetTransformed * w;98 float2 texcoord = IN.texCoord.xy + offsetTransformed * scaleFactor; 99 99 100 100 //if ((texcoord.x <= 1.0f) && (texcoord.x >= 0.0f) && (texcoord.y <= 1.0f) && (texcoord.y >= 0.0f)) ++ numSamples; … … 151 151 uniform sampler2D colors, 152 152 uniform sampler2D normals, 153 uniform sampler2D noise Texture,153 uniform sampler2D noise, 154 154 uniform float2 samples[NUM_SAMPLES], 155 155 uniform sampler2D oldSsaoTex, … … 191 191 //-- compute color bleeding + ao 192 192 193 GiStruct gi = globIllum(IN, colors, noise Texture, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(IN.view));193 GiStruct gi = globIllum(IN, colors, noise, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(IN.view)); 194 194 195 195 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3019 r3026 137 137 uniform sampler2D colors, 138 138 uniform sampler2D normals, 139 uniform sampler2D noise Texture,139 uniform sampler2D noise, 140 140 uniform float2 samples[NUM_SAMPLES], 141 141 uniform sampler2D oldTex, … … 161 161 const float3 centerPosition = eyePos + eyeSpacePos; 162 162 163 float4 realPos = float4(centerPosition, 1.0f);163 const float4 realPos = float4(centerPosition, 1.0f); 164 164 165 165 … … 174 174 const float currentDepth = currentPos.z * 1e-3f; 175 175 176 const float2 ao = ssao(IN, colors, noise Texture, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir));176 const float2 ao = ssao(IN, colors, noise, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir)); 177 177 178 178 … … 202 202 203 203 //const float oldNumSamples = oldCol.y; 204 const float oldWeight = clamp(oldCol.y, 0, temporalCoherence);204 const float oldWeight = 50;//clamp(oldCol.y, 0, temporalCoherence); 205 205 206 206 float newWeight; … … 209 209 //const float newNumSamples = ao.y; 210 210 211 if ( //(temporalCoherence > 0) &&211 if ((temporalCoherence > 0) && 212 212 (tex.x >= 0.0f) && (tex.x < 1.0f) && 213 213 (tex.y >= 0.0f) && (tex.y < 1.0f) && … … 228 228 } 229 229 230 //OUT.illum_col.y=depthDif;231 230 OUT.illum_col.y = newWeight; 232 231 OUT.illum_col.z = currentDepth; … … 269 268 float3 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 270 269 271 if (ao.y < 2000.0f)272 ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights);270 //if (ao.y < 2000.0f) 271 // ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 273 272 274 273 OUT.illum_col = col * ao.x;
Note: See TracChangeset
for help on using the changeset viewer.