Changeset 3197 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Timestamp:
- 11/30/08 12:48:37 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3195 r3197 315 315 mDownSampleFbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 316 316 // downsample buffer for the normal texture 317 mDownSampleFbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 317 //mDownSampleFbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 318 mDownSampleFbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 318 319 // downsample buffer for the offset texture 319 mDownSampleFbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 320 //mDownSampleFbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 321 mDownSampleFbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 320 322 321 323 for (int i = 0; i < 3; ++ i) -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3194 r3197 591 591 fbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, ColorBufferObject::FILTER_NEAREST); 592 592 // the normals buffer 593 fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 593 //fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 594 fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 594 595 // a rgb buffer which could hold material properties 595 596 //fbo->AddColorBuffer(ColorBufferObject::RGB_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3196 r3197 213 213 214 214 // the filtered ssao value 215 ao.x = DiscontinuityFilter2(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, scale, bl, br, tl, tr);215 //ao.x = DiscontinuityFilter2(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, scale, bl, br, tl, tr); 216 216 } 217 217 … … 221 221 OUT.illum_col.xyz = col.xyz; 222 222 223 //OUT.illum_col.xyz = float3(0, clamp(1.0f - ao.y * 1e-3f, 0, 1), 1); 224 //const float mydummy = ao.w * 1e-3f; 223 225 OUT.illum_col.xyz = float3(ao.x, ao.x, ao.x); 224 226 //OUT.illum_col.xyz = float3(0, clamp(1.0f - ao.y * 1e-3f, 0, 1), 1); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3196 r3197 296 296 pixel pix; 297 297 298 const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0 ,0)).xyz);299 298 const float3 difVec = tex2Dlod(diffVals, float4(IN.texCoord, 0 ,0)).xyz; 300 299 … … 303 302 304 303 305 float4 dummy;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;304 /*float4 dummy; 305 const float xoffs = .5f / 1024.0f; const float yoffs = .5f / 768.0f; 306 //const float xoffs = 1.0f / 1024.0f; const float yoffs = 1.0f / 768.0f; 308 307 309 308 dummy.x = tex2Dlod(colorsTex, float4(IN.texCoord + float2(xoffs, yoffs), 0, 0)).w; … … 311 310 dummy.z = tex2Dlod(colorsTex, float4(IN.texCoord + float2(-xoffs, yoffs), 0, 0)).w; 312 311 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));312 color.w = min(min(dummy.x, dummy.y), min(dummy.z, dummy.w)); 314 313 //color.w = max(max(dummy.x, dummy.y), max(dummy.z, dummy.w)); 315 314 */ 315 316 //const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0 ,0)).xyz); 317 318 float3 dummy[4]; 319 const float xoffs = .5f / 1024.0f; const float yoffs = .5f / 768.0f; 320 //const float xoffs = 1.0f / 1024.0f; const float yoffs = 1.0f / 768.0f; 321 322 dummy[0] = tex2Dlod(normalsTex, float4(IN.texCoord + float2(xoffs, yoffs), 0, 0)).xyz; 323 dummy[1] = tex2Dlod(normalsTex, float4(IN.texCoord + float2(xoffs, -yoffs), 0, 0)).xyz; 324 dummy[2] = tex2Dlod(normalsTex, float4(IN.texCoord + float2(-xoffs, yoffs), 0, 0)).xyz; 325 dummy[3] = tex2Dlod(normalsTex, float4(IN.texCoord + float2(-yoffs, -yoffs), 0, 0)).xyz; 326 327 float dot1 = dot(dummy[0], dummy[3]); 328 float dot2 = dot(dummy[1], dummy[2]); 329 330 float isEdge = step(.0f, dot1) * step(.0f, dot2); 331 332 const float3 normal = isEdge * normalize(dummy[0] + dummy[1] + dummy[2] + dummy[3]); 333 316 334 // store scaled view vector so wie don't have to normalize for e.g., ssao 317 335 color.w /= length(IN.view); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3196 r3197 283 283 const float2 texcoord = IN.texCoord.xy + offsetTransformed * scaleFactor; 284 284 285 float4 sampleColor = tex2Dlod(colors, float4(texcoord, 0, 0));285 const float4 sampleColor = tex2Dlod(colors, float4(texcoord, 0, 0)); 286 286 const float3 samplePos = ReconstructSamplePos(sampleColor.w, texcoord, bl, br, tl, tr); 287 287 … … 291 291 292 292 float3 dirSample = samplePos - centerPosition; 293 const float lengthToSample = max(length(dirSample), 1e-6f); 293 294 const float sqrLen = max(SqrLen(dirSample), 1e-3f); 295 //const float lengthToSample = max(length(dirSample), 1e-2f); 296 const float lengthToSample = sqrt(sqrLen); 294 297 295 298 dirSample /= lengthToSample; // normalize … … 301 304 // the distance to a sample approaches zero 302 305 //const float aoContrib = SAMPLE_INTENSITY / (DISTANCE_SCALE + lengthToSample * lengthToSample); 303 const float aoContrib = SAMPLE_INTENSITY / max(1e-1f, lengthToSample * lengthToSample);306 const float aoContrib = SAMPLE_INTENSITY / sqrLen; 304 307 //const float aoContrib = (1.0f > lengthToSample) ? occlusionPower(9e-2f, DISTANCE_SCALE + lengthToSample): .0f; 305 308
Note: See TracChangeset
for help on using the changeset viewer.