Changeset 3093 for GTP/trunk/App/Demos
- Timestamp:
- 11/03/08 17:42:54 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3092 r3093 152 152 153 153 // note: slightly larger texture could hide ambient occlusion error on border but costs resolution 154 const float offs = 0.5f;155 156 154 glBegin(GL_QUADS); 157 155 158 /*glTexCoord2f(0, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, bl.x, bl.y, bl.z); glVertex3f(-offs, -offs, -0.5f); 159 glTexCoord2f(1, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, br.x, br.y, br.z); glVertex3f( offs, -offs, -0.5f); 160 glTexCoord2f(1, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tr.x, tr.y, tr.z); glVertex3f( offs, offs, -0.5f); 161 glTexCoord2f(0, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tl.x, tl.y, tl.z); glVertex3f(-offs, offs, -0.5f); 162 163 glTexCoord2f(0, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, bl.x, bl.y, bl.z); glVertex2f(-offs, -offs); 164 glTexCoord2f(1, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, br.x, br.y, br.z); glVertex2f(offs, -offs); 165 glTexCoord2f(1, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tr.x, tr.y, tr.z); glVertex2f(offs, offs); 166 glTexCoord2f(0, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tl.x, tl.y, tl.z); glVertex2f(-offs, offs); 167 */ 168 glTexCoord2f(0, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, bl.x, bl.y, bl.z); glVertex2f(0, 0); 169 glTexCoord2f(1, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, br.x, br.y, br.z); glVertex2f(1, 0); 170 glTexCoord2f(1, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tr.x, tr.y, tr.z); glVertex2f(1, 1); 171 glTexCoord2f(0, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tl.x, tl.y, tl.z); glVertex2f(0, 1); 156 glTexCoord2f(0, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, bl.x, bl.y, bl.z); glVertex2f( .0f, .0f); 157 glTexCoord2f(1, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, br.x, br.y, br.z); glVertex2f(1.0f, .0f); 158 glTexCoord2f(1, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tr.x, tr.y, tr.z); glVertex2f(1.0f, 1.0f); 159 glTexCoord2f(0, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tl.x, tl.y, tl.z); glVertex2f( .0f, 1.0f); 172 160 173 161 glEnd(); … … 552 540 sCgSsaoProgram->SetTexture(3, noiseTex); 553 541 554 sCgSsaoProgram->SetValue3f(4, mEyePos.x, mEyePos.y, mEyePos.z); 542 //sCgSsaoProgram->SetValue3f(4, mEyePos.x, mEyePos.y, mEyePos.z); 543 sCgSsaoProgram->SetValue3f(4, 0, 0, 0); 555 544 556 545 sCgSsaoProgram->SetValue1f(5, (mUseTemporalCoherence && !mRegenerateSamples) ? tempCohFactor : 0); … … 588 577 tr = mOldCornersView[3]; 589 578 590 sCgSsaoProgram->SetValue3f(13, mOldEyePos.x, mOldEyePos.y, mOldEyePos.z); 579 Vector3 d = mOldEyePos - mEyePos; 580 581 //sCgSsaoProgram->SetValue3f(13, mOldEyePos.x, mOldEyePos.y, mOldEyePos.z); 582 sCgSsaoProgram->SetValue3f(13, d.x, d.y, d.z); 591 583 sCgSsaoProgram->SetValue3f(14, bl.x, bl.y, bl.z); 592 584 sCgSsaoProgram->SetValue3f(15, br.x, br.y, br.z); … … 1026 1018 Matrix4x4 matViewing, matProjection; 1027 1019 1028 mCamera->GetModelViewMatrix(matViewing); 1020 //mCamera->GetModelViewMatrix(matViewing); 1021 mCamera->GetViewOrientationMatrix(matViewing); 1029 1022 mCamera->GetProjectionMatrix(matProjection); 1030 1023 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3092 r3093 169 169 170 170 const float depthDif = length(oldSamplePos - worldPos.xyz); 171 //const float dummy5 = abs(oldEyeSpaceDepth - eyeSpaceDepth);172 const float dummy5 = length(oldTexCoords - texcoord0) * 1e5f;171 const float dummy5 = abs(oldEyeSpaceDepth - eyeSpaceDepth); 172 //const float dummy5 = length(oldTexCoords - texcoord0) * 1e5f; 173 173 //const float dummy5 = depthDif; 174 174 … … 223 223 illum_col.y = newWeight; 224 224 illum_col.w = eyeSpaceDepth; 225 illum_col.y = dummy5;225 //illum_col.y = dummy5; 226 226 227 227 return illum_col; … … 365 365 uniform sampler2D ssaoTex, 366 366 uniform float2 filterOffs[NUM_SSAO_FILTERSAMPLES], 367 uniform float filterWeights[NUM_SSAO_FILTERSAMPLES] 368 ) 367 uniform float filterWeights[NUM_SSAO_FILTERSAMPLES]) 369 368 { 370 369 float average = .0f; … … 397 396 //if (ao.y < 10.0f) ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 398 397 399 //OUT.illum_col = col * ao.x;400 OUT.illum_col = float4(ao.y, ao.y, ao.y, col.w);398 OUT.illum_col = col * ao.x; 399 //OUT.illum_col = float4(ao.y, ao.y, ao.y, col.w); 401 400 //OUT.illum_col.xyz = float3(1.0f - ao.x, 1.0f - ao.y * 1e-2f, 1); 402 401 //OUT.illum_col.xyz = float3(1.0f - ao.x, ao.y, 0);
Note: See TracChangeset
for help on using the changeset viewer.