- Timestamp:
- 08/24/08 12:48:59 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp
r2861 r2863 149 149 swap(mNewFbo, mOldFbo); 150 150 151 FirstPass(fbo, expFactor);151 ComputeSsao(fbo, expFactor); 152 152 // the second pass just renders the combined solution 153 SecondPass(fbo);154 } 155 156 157 void SsaoShader:: FirstPass(FrameBufferObject *fbo, float expFactor)153 DisplayTexture(); 154 } 155 156 157 void SsaoShader::ComputeSsao(FrameBufferObject *fbo, float expFactor) 158 158 { 159 159 GLuint colorsTex = fbo->GetColorBuffer(0)->GetTexture(); … … 259 259 260 260 261 void SsaoShader:: SecondPass(FrameBufferObject *fbo)261 void SsaoShader::DisplayTexture() 262 262 { 263 263 glEnable(GL_TEXTURE_2D); … … 309 309 mCamera->ComputePoints(ftl, ftr, fbl, fbr, ntl, ntr, nbl, nbr); 310 310 311 #if 0// matT: debug this!!312 313 bl = Normalize(nbl - fbl);314 br = Normalize(nbr - fbr);315 tl = Normalize(ftl - ntl);316 tr = Normalize(ftr - ntr);311 #if 1 // matT: debug this!! 312 313 bl = -Normalize(nbl - fbl); 314 br = -Normalize(nbr - fbr); 315 tl = -Normalize(ntl - ftl); 316 tr = -Normalize(ntr - ftr); 317 317 318 318 #else // just take camera direction -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.h
r2861 r2863 48 48 protected: 49 49 50 void FirstPass(FrameBufferObject *fbo, float expFactor);50 void ComputeSsao(FrameBufferObject *fbo, float expFactor); 51 51 52 void SecondPass(FrameBufferObject *fbo);52 void DisplayTexture(); 53 53 54 54 void CreateNoiseTex2D(); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2861 r2863 7 7 8 8 // rule of thumb: approx 1 / NUM_SAMPLES 9 #define SAMPLE_INTENSITY 0.210 //#define SAMPLE_INTENSITY 0.125f9 //#define SAMPLE_INTENSITY 0.2 10 #define SAMPLE_INTENSITY 0.125f 11 11 12 12 #define AREA_SIZE 9e-1f 13 #define VIEW_CORRECTION_SCALE 0.3f 13 //#define VIEW_CORRECTION_SCALE 0.3f 14 #define VIEW_CORRECTION_SCALE 1.0f 14 15 #define DISTANCE_SCALE 1e-6f 15 16 … … 51 52 52 53 54 /** The ssao shader returning the an intensity value between 0 and 1 55 */ 53 56 float ssao(fragment IN, 54 57 uniform sampler2D positions, … … 101 104 (SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + length_to_sample * length_to_sample); 102 105 103 // if normal perpenticular to view dir, only half of the samples count106 // if surface normal perpenticular to view dir, the samples count less => compensate for this 104 107 float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal)); 105 108 … … 108 111 109 112 return (1.0f - total_ao); 113 //return float4(dot(currentViewDir, currentNormal)); 110 114 } 111 115 … … 226 230 // expand normal 227 231 normal = normalize(normal * 2.0f - 1.0f); 232 /// the current view direction 228 233 float3 viewDir = normalize(IN.view * 2.0f - float3(1.0f)); 229 234 … … 235 240 float ao = ssao(IN, positions, noiseTexture, samples, normal.xyz, viewDir, noiseMultiplier, centerPosition); 236 241 float4 attenuated_color = ao * col; 242 //float4 attenuated_color = ao; 237 243 238 244 //float4 new_col = globIllum(IN, colors, positions, noiseTexture, samples, normal.xyz, viewDir, noiseMultiplier, centerPosition); 239 //float ao = new_col.w;240 245 //float4 attenuated_color = ao * col + new_col; 241 246 … … 266 271 } 267 272 273 //OUT.color.xyz = viewDir; 274 //OUT.color = attenuated_color; 275 268 276 OUT.color.w = tex2D(colors, IN.texCoord.xy).w; 269 277
Note: See TracChangeset
for help on using the changeset viewer.