Ignore:
Timestamp:
08/25/08 20:20:42 (16 years ago)
Author:
mattausch
Message:

bug: downsampling of positions does not work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp

    r2865 r2866  
    7878        mNewFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE); 
    7979        // the diffuse color buffer 
    80         mNewFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false, false); 
     80        mNewFbo->AddColorBuffer(w, h, ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false, false); 
    8181         
    8282        mOldFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE); 
    8383        // the diffuse color buffer 
    84         mOldFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false, false); 
     84        mOldFbo->AddColorBuffer(w, h, ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false, false); 
    8585         
    8686 
     
    284284 
    285285 
    286 /*void SsaoShader::DisplayTexture() 
    287 { 
    288         glEnable(GL_TEXTURE_2D); 
    289  
    290         glBindTexture(GL_TEXTURE_2D, mNewFbo->GetColorBuffer(0)->GetTexture()); 
    291  
    292         glDisable(GL_LIGHTING); 
    293          
    294         glMatrixMode(GL_PROJECTION); 
    295         glPushMatrix(); 
    296         glLoadIdentity(); 
    297  
    298         glMatrixMode(GL_MODELVIEW); 
    299         glPushMatrix(); 
    300         glLoadIdentity(); 
    301  
    302         const float offs = 0.5f; 
    303         glOrtho(-offs, offs, -offs, offs, 0, 1); 
    304          
    305         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    306  
    307         glColor4f(1.0f, 1.0f, 1.0f, 1.0f); 
    308         glBegin(GL_QUADS); 
    309  
    310         glTexCoord2f(0, 0); glVertex3f(-offs, -offs, -0.5f); 
    311         glTexCoord2f(1, 0); glVertex3f( offs, -offs, -0.5f); 
    312         glTexCoord2f(1, 1); glVertex3f( offs,  offs, -0.5f); 
    313         glTexCoord2f(0, 1); glVertex3f(-offs,  offs, -0.5f); 
    314  
    315         glEnd(); 
    316  
    317         glEnable(GL_LIGHTING); 
    318         glDisable(GL_TEXTURE_2D); 
    319          
    320         glMatrixMode(GL_PROJECTION); 
    321         glPopMatrix(); 
    322  
    323         glMatrixMode(GL_MODELVIEW); 
    324         glPopMatrix(); 
    325  
    326         PrintGLerror("ssao second pass"); 
    327 }*/ 
    328  
    329  
    330286void SsaoShader::ComputeViewVectors(Vector3 &tl, Vector3 &tr, Vector3 &bl, Vector3 &br) 
    331287{ 
     
    364320        for (int i = 0; i < mWidth * mHeight * 3; i += 3) 
    365321        { 
    366                 // create random samples over sphere 
     322                // create random samples on a circle 
    367323                const float rx = RandomValue(0, 1); 
    368324                const float theta = 2.0f * acos(sqrt(1.0f - rx)); 
Note: See TracChangeset for help on using the changeset viewer.