Changeset 3118 for GTP


Ignore:
Timestamp:
11/11/08 16:22:02 (16 years ago)
Author:
mattausch
Message:

found error with mrts

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

Legend:

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

    r3117 r3118  
    7272 
    7373 
    74 int DeferredRenderer::colorBufferIdx = 3; 
     74int DeferredRenderer::colorBufferIdx = 0; 
    7575 
    7676 
     
    519519        GLuint oldTex = mIllumFbo->GetColorBuffer(2 - mIllumFboIndex)->GetTexture(); 
    520520 
    521         cout << colorBufferIdx; 
    522  
    523521        glPushAttrib(GL_VIEWPORT_BIT); 
    524522        glViewport(0, 0, mIllumFbo->GetWidth(), mIllumFbo->GetHeight()); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3117 r3118  
    463463        //-- load some dynamic stuff 
    464464 
    465 /*      LoadModel("hbuddha.dem", dynamicObjects); 
     465        LoadModel("hbuddha.dem", dynamicObjects); 
    466466        buddha = dynamicObjects.back(); 
    467467         
     
    487487                dynamicObjects.push_back(ent); 
    488488        } 
    489 */ 
     489 
    490490 
    491491        /////////// 
     
    522522        preetham = new SkyPreetham(turbitiy, skyDome); 
    523523 
    524         //CreateAnimation(); 
     524        CreateAnimation(); 
    525525 
    526526 
     
    883883        // draw to 3 color buffers 
    884884        // a color, normal, and positions buffer 
    885         DeferredRenderer::colorBufferIdx = 3 - DeferredRenderer::colorBufferIdx; 
    886         if (sCurrentMrtSet == 0) glDrawBuffers(3, mrt); 
    887         else glDrawBuffers(3, mrt2); 
     885        if (sCurrentMrtSet == 0) 
     886        { 
     887                DeferredRenderer::colorBufferIdx = 0; 
     888                glDrawBuffers(3, mrt); 
     889        } 
     890        else  
     891        { 
     892                DeferredRenderer::colorBufferIdx = 3; 
     893                glDrawBuffers(3, mrt2); 
     894        } 
    888895 
    889896        sCurrentMrtSet = 1 - sCurrentMrtSet; 
     
    895902void MainLoop()  
    896903{        
    897         /*GPUProgramParameters *vtxParams =  
     904        GPUProgramParameters *vtxParams =  
    898905                buddha->GetShape(0)->GetMaterial()->GetTechnique(1)->GetVertexProgramParameters(); 
    899906 
     
    908915        dynamicObjects[1]->GetTransform()->MultMatrix(rotMatrix); 
    909916 
    910 */ 
     917 
    911918        ///////////// 
    912919 
     
    11361143 
    11371144        ///////////////////////// 
    1138  
    1139         /*//motionPath->Move(0.3f); 
     1145        //-- update animations 
    11401146        motionPath->Move(0.01f); 
    1141         Vector3 oldBuddhaPos = buddhaPos; 
    1142         // new position 
    1143         buddhaPos = motionPath->GetCurrentPosition(); 
    1144  
    1145         Vector3 diff = oldBuddhaPos - buddhaPos; 
    1146         //Vector3 diff = buddhaPos - oldBuddhaPos; 
    1147  
    1148         invTrafo = TranslationMatrix(diff); 
    1149         //cout<< "diff " << diff << endl; 
    1150         */ 
    11511147} 
    11521148 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg

    r3117 r3118  
    6363        // transform the vertex position into post projection space 
    6464        OUT.position = mul(glstate.matrix.mvp, IN.position); 
    65         // the normal has to be correctly transformed with the inverse transpose 
    66         OUT.normal = mul(glstate.matrix.invtrans.modelview[0], IN.normal); 
    6765        // transform the old vertex position into world space 
    6866        OUT.worldPos = mul(modelMatrix, IN.position); 
    6967        // transform the old vertex position into world space 
    7068        OUT.oldWorldPos = mul(oldModelMatrix, IN.position); 
    71          
     69        // the normal has to be correctly transformed with the inverse transpose 
     70        OUT.normal = mul(glstate.matrix.invtrans.modelview[0], IN.normal); 
     71 
    7272        return OUT; 
    7373} 
Note: See TracChangeset for help on using the changeset viewer.