Ignore:
Timestamp:
02/25/09 15:51:45 (15 years ago)
Author:
mattausch
Message:

probably found error with texture

File:
1 edited

Legend:

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

    r3326 r3327  
    165165                } 
    166166        } 
     167} 
     168 
     169 
     170static float *GrabTexture(GLuint tex, int w, int h) 
     171{ 
     172        glBindTexture(GL_TEXTURE_2D, tex); 
     173 
     174        float *data = new float[w * h * 3]; 
     175 
     176        glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_FLOAT, data); 
     177 
     178        glBindTexture(GL_TEXTURE_2D, 0); 
     179        glDisable(GL_TEXTURE_2D); 
     180 
     181        return data; 
    167182} 
    168183 
     
    772787                tempSamples[i] = samples2[ns]; 
    773788                currentSample = samples2[ns]; 
     789 
    774790                checked[ns] = true; 
    775791        } 
     
    838854                } 
    839855 
     856 
    840857                //if (mSortSamples) { SortSamples(); } 
    841858                //sCgSsaoProgram->SetArray2f(i, (float *)samples2, NUM_SAMPLES); 
    842859                //sCgSsaoProgram->SetArray2f(i, (float *)samples2, NUM_PRECOMPUTED_SAMPLES); 
    843                 sCgSsaoProgram->SetTexture(i, sampleTex2D); 
    844         } 
    845          
     860        } 
     861 
     862        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        } 
     875 
    846876        ++ i; 
    847877 
     
    870900        sCgSsaoProgram->SetValue1f(i ++, mSampleIntensity * mKernelRadius); 
    871901 
    872  
    873902        DrawQuad(sCgSsaoProgram); 
    874  
    875903        glPopAttrib(); 
    876904 
     
    905933        // read the second buffer, write to the first buffer 
    906934        if (!displayFrame) 
     935        { 
    907936                FlipFbos(fbo); 
     937        } 
    908938        else 
     939        { 
    909940                // end of the pipeline => just draw image to screen 
    910941                FrameBufferObject::Release(); 
     942        } 
    911943 
    912944        // the neighbouring texels 
Note: See TracChangeset for help on using the changeset viewer.