Changeset 3332 for GTP


Ignore:
Timestamp:
03/05/09 18:40:34 (15 years ago)
Author:
mattausch
Message:

debug / performance stuff

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src
Files:
5 edited

Legend:

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

    r3331 r3332  
    285285static void UpdateSampleTex(Sample2 *samples, int numSamples) 
    286286{ 
     287        PrintGLerror("here4"); 
    287288        glEnable(GL_TEXTURE_2D); 
    288289        glBindTexture(GL_TEXTURE_2D, sampleTex2D); 
     
    297298                tempBuffer[i * 3 + 1] = samples[i].y; 
    298299                tempBuffer[i * 3 + 2] = 0; 
    299                  
    300300        } 
    301301 
    302302        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGB, GL_FLOAT, (float *)tempBuffer); 
    303303 
    304         glBindTexture(GL_TEXTURE_2D, 0); 
     304        //glBindTexture(GL_TEXTURE_2D, 0); 
    305305        glDisable(GL_TEXTURE_2D); 
    306306 
     
    309309        delete [] tempBuffer; 
    310310 
    311         PrintGLerror("noisetexture"); 
     311        PrintGLerror("update sample tex"); 
    312312} 
    313313 
     
    333333                tempBuffer[i * 3 + 1] = samples[i].y; 
    334334                tempBuffer[i * 3 + 2] = 0; 
    335                  
    336335        } 
    337336 
     
    345344        delete [] tempBuffer; 
    346345 
    347         PrintGLerror("noisetexture"); 
     346        PrintGLerror("create sample tex"); 
    348347} 
    349348 
     
    420419        for (int i = 0; i < 4; ++ i) 
    421420        { 
    422                 mIllumFbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
     421                mIllumFbo->AddColorBuffer(ColorBufferObject::R_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
    423422                FrameBufferObject::InitBuffer(mIllumFbo, i); 
    424423        } 
     
    662661        if (mShadingMethod != 0) 
    663662        { 
    664                 //PrepareSsao(fbo); // downsample fbo buffers 
     663                PrepareSsao(fbo); // downsample fbo buffers 
    665664        } 
    666665 
     
    798797void DeferredRenderer::ComputeSsao(FrameBufferObject *fbo, float tempCohFactor) 
    799798{ 
     799        PrintGLerror("here5"); 
     800 
    800801        GLuint colorsTex, normalsTex, attribsTex; 
    801802 
     
    813814        attribsTex = fbo->GetColorBuffer(2)->GetTexture(); 
    814815 
     816        PrintGLerror("here6"); 
    815817 
    816818        ///////// 
     
    819821        GLuint oldSsaoTex = mIllumFbo->GetColorBuffer(2 - mIllumFboIndex)->GetTexture(); 
    820822 
     823        PrintGLerror("here809"); 
     824 
    821825        glPushAttrib(GL_VIEWPORT_BIT); 
    822826        glViewport(0, 0, mIllumFbo->GetWidth(), mIllumFbo->GetHeight()); 
     827 
     828        PrintGLerror("here45"); 
    823829 
    824830        // read the second buffer, write to the first buffer 
    825831        mIllumFbo->Bind(); 
    826832        glDrawBuffers(2, mrt + mIllumFboIndex); 
     833 
     834        PrintGLerror("here8"); 
    827835 
    828836        int i = 0; 
     
    861869 
    862870        sCgSsaoProgram->SetTexture(i, sampleTex2D); 
    863  
    864         static int dummycount = 0; 
    865  
    866         if (0)//dummycount ++ % 1000 == 0) 
    867         { 
    868                 float *data = GrabTexture(sampleTex2D, NUM_PRECOMPUTED_SAMPLES, 1); 
    869                 cout << "********************************" << endl; 
    870                 for (int i = 0; i < NUM_PRECOMPUTED_SAMPLES; ++ i) 
    871                         cout << data[i] << " "; 
    872                 cout << endl; 
    873                 delete [] data; 
    874         } 
    875871 
    876872        ++ i; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp

    r3204 r3332  
    116116        case RGBA_FLOAT_32:  
    117117                mGlFormat = GL_FLOAT; mInternalFormat = GL_RGBA32F_ARB; break; 
     118        case R_FLOAT_32:  
     119                //mGlFormat = GL_FLOAT; mInternalFormat = GL_R32F_ARB; break; 
    118120        default: 
    119121                mGlFormat = GL_UNSIGNED_BYTE; mInternalFormat = GL_RGBA8; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.h

    r3204 r3332  
    1515public: 
    1616 
    17         enum FORMAT {RGB_UBYTE, RGBA_UBYTE, RGB_FLOAT_16, RGBA_FLOAT_16, RGB_FLOAT_32, RGBA_FLOAT_32}; 
     17        enum FORMAT {RGB_UBYTE, RGBA_UBYTE, RGB_FLOAT_16, RGBA_FLOAT_16, RGB_FLOAT_32, RGBA_FLOAT_32, R_FLOAT_32}; 
    1818        enum WRAP_TYPE {WRAP_REPEAT, WRAP_CLAMP_TO_EDGE, WRAP_CLAMP_TO_BORDER}; 
    1919        enum FILTER_TYPE {FILTER_NEAREST, FILTER_LINEAR}; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3328 r3332  
    338338        const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0, 0)).xyz); 
    339339 
     340//#ifdef PERFORMANCE_TEST 
     341#if 1 
    340342        // do reprojection and filter out the pixels that are not save 
    341343        const float2 pValid = PixelValid(oldTex, 
     
    350352                                                                         myTex 
    351353                                                                         ); 
     354#else 
     355        const float2 pValid = float2(0,0); 
     356#endif 
    352357 
    353358        pix.color = color; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg

    r3295 r3332  
    3434        return rpt; 
    3535} 
     36 
    3637 
    3738struct GiStruct 
Note: See TracChangeset for help on using the changeset viewer.