Changeset 3117 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 11/11/08 12:18:07 (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/mrt.cg
r3113 r3117 16 16 17 17 float4 color: COLOR0; 18 float4 eyePos: TEXCOORD1; // eye position 18 // eye position 19 float4 eyePos: TEXCOORD1; 19 20 float4 normal: TEXCOORD2; 20 21 float4 worldPos: TEXCOORD3; … … 30 31 31 32 float4 winPos: WPOS; 32 float4 eyePos: TEXCOORD1; // eye position 33 // eye position 34 float4 eyePos: TEXCOORD1; 33 35 float4 normal: TEXCOORD2; 34 36 float4 worldPos: TEXCOORD3; … … 61 63 // transform the vertex position into post projection space 62 64 OUT.position = mul(glstate.matrix.mvp, IN.position); 63 64 65 // the normal has to be correctly transformed with the inverse transpose 65 66 OUT.normal = mul(glstate.matrix.invtrans.modelview[0], IN.normal); 66 67 67 // transform the old vertex position into world space 68 68 OUT.worldPos = mul(modelMatrix, IN.position); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3115 r3117 177 177 178 178 #else 179 179 180 // calculate eye space position of sample in old frame 180 181 const float oldDepth = oldPixel.w; … … 182 183 // vector from eye pos to old sample 183 184 const float depthDif = abs(projectedDepth - oldDepth); 185 184 186 #endif 185 187 … … 210 212 } 211 213 212 213 // the number of valid samples in this frame214 //const float newNumSamples = ao.y;215 //const float oldNumSamples = oldCol.y;216 217 214 const float oldWeight = clamp(oldPixel.y, .0f, temporalCoherence); 218 215 float newWeight; … … 256 253 */ 257 254 float2 ssao(fragment IN, 258 uniform sampler2D colors, 259 uniform sampler2D noiseTex, 260 uniform float2 samples[NUM_SAMPLES], 261 uniform float3 normal, 262 uniform float3 centerPosition, 263 uniform float scaleFactor, 264 uniform float3 bl, 265 uniform float3 br, 266 uniform float3 tl, 267 uniform float3 tr, 268 uniform float3 viewDir 255 sampler2D colors, 256 sampler2D noiseTex, 257 float2 samples[NUM_SAMPLES], 258 float3 normal, 259 float3 centerPosition, 260 float scaleFactor, 261 float3 bl, 262 float3 br, 263 float3 tl, 264 float3 tr, 265 float3 viewDir 266 //,float2 noiseOffs 269 267 ) 270 268 { … … 285 283 //-- add random noise: reflect around random normal vector (rather slow!) 286 284 285 //float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f + noiseOffs, 0, 0)).xy; 287 286 float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f, 0, 0)).xy; 288 287 const float2 offsetTransformed = myreflect(offset, mynoise); … … 374 373 { 375 374 ao = ssao(IN, colors, noiseTex, samples, normal, 376 eyeSpacePos.xyz, scaleFactor, bl, br, tl, tr, normalize(viewDir)); 375 eyeSpacePos.xyz, scaleFactor, bl, br, tl, tr, normalize(viewDir));//, noiseOffs); 377 376 } 378 377
Note: See TracChangeset
for help on using the changeset viewer.