Changeset 3196
- Timestamp:
- 11/29/08 22:14:13 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3195 r3196 12 12 // for quadratic falloff 13 13 //#define SAMPLE_INTENSITY 0.9f 14 #define SAMPLE_INTENSITY 2.0f14 //#define SAMPLE_INTENSITY 2.0f 15 15 16 16 //#define SAMPLE_INTENSITY 0.075f 17 //#define SAMPLE_INTENSITY 0.2f17 #define SAMPLE_INTENSITY 0.2f 18 18 19 19 #define SAMPLE_RADIUS 8e-1f -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3195 r3196 179 179 180 180 float4 dummy; 181 const float xoffs = .5f / 1024.0f; 182 const float yoffs = .5f / 768.0f; 183 184 dummy.x = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).y; 181 //const float xoffs = .5f / 1024.0f; const float yoffs = .5f / 768.0f; 182 const float xoffs = 1.0f / 1024.0f; const float yoffs = 1.0f / 768.0f; 183 184 dummy.x = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, yoffs), 0, 0)).w; 185 dummy.y = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, -yoffs), 0, 0)).w; 186 dummy.z = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(-xoffs, yoffs), 0, 0)).w; 187 dummy.w = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(-yoffs, -yoffs), 0, 0)).w; 188 189 /*dummy.x = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).y; 185 190 dummy.y = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(0, yoffs), 0, 0)).y; 186 191 dummy.z = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(-xoffs, 0), 0, 0)).y; 187 192 dummy.w = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(0, -yoffs), 0, 0)).y; 188 193 */ 189 194 const float convergence = min(min(dummy.x, dummy.y), min(dummy.z, dummy.w)); 190 195 //const float convergence = max(max(dummy.x, dummy.y), max(dummy.z, dummy.w)); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3195 r3196 296 296 pixel pix; 297 297 298 //const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0 ,0)).xyz); 299 const float3 normal = tex2Dlod(normalsTex, float4(IN.texCoord, 0 ,0)).xyz; 298 const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0 ,0)).xyz); 300 299 const float3 difVec = tex2Dlod(diffVals, float4(IN.texCoord, 0 ,0)).xyz; 301 300 … … 305 304 306 305 float4 dummy; 307 const float xoffs = .5f / 1024.0f; 308 const float yoffs = .5f / 768.0f; 309 310 dummy.x = tex2Dlod(colorsTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).w; 311 dummy.y = tex2Dlod(colorsTex, float4(IN.texCoord + float2(0, yoffs), 0, 0)).w; 312 dummy.z = tex2Dlod(colorsTex, float4(IN.texCoord + float2(-xoffs, 0), 0, 0)).w; 313 dummy.w = tex2Dlod(colorsTex, float4(IN.texCoord + float2(0, -yoffs), 0, 0)).w; 314 color.w = max(max(dummy.x, dummy.y), max(dummy.z, dummy.w)); 306 //const float xoffs = .5f / 1024.0f; const float yoffs = .5f / 768.0f; 307 const float xoffs = 1.0f / 1024.0f; const float yoffs = 1.0f / 768.0f; 308 309 dummy.x = tex2Dlod(colorsTex, float4(IN.texCoord + float2(xoffs, yoffs), 0, 0)).w; 310 dummy.y = tex2Dlod(colorsTex, float4(IN.texCoord + float2(xoffs, -yoffs), 0, 0)).w; 311 dummy.z = tex2Dlod(colorsTex, float4(IN.texCoord + float2(-xoffs, yoffs), 0, 0)).w; 312 dummy.w = tex2Dlod(colorsTex, float4(IN.texCoord + float2(-yoffs, -yoffs), 0, 0)).w; 313 //color.w = min(min(dummy.x, dummy.y), min(dummy.z, dummy.w)); 314 //color.w = max(max(dummy.x, dummy.y), max(dummy.z, dummy.w)); 315 315 316 316 // store scaled view vector so wie don't have to normalize for e.g., ssao -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3195 r3196 300 300 // the distance_scale offset is used to avoid singularity that occurs at global illumination when 301 301 // the distance to a sample approaches zero 302 const float aoContrib = SAMPLE_INTENSITY / (DISTANCE_SCALE + lengthToSample * lengthToSample); 302 //const float aoContrib = SAMPLE_INTENSITY / (DISTANCE_SCALE + lengthToSample * lengthToSample); 303 const float aoContrib = SAMPLE_INTENSITY / max(1e-1f, lengthToSample * lengthToSample); 303 304 //const float aoContrib = (1.0f > lengthToSample) ? occlusionPower(9e-2f, DISTANCE_SCALE + lengthToSample): .0f; 304 305
Note: See TracChangeset
for help on using the changeset viewer.