- Timestamp:
- 02/25/09 15:51:45 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3326 r3327 165 165 } 166 166 } 167 } 168 169 170 static 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; 167 182 } 168 183 … … 772 787 tempSamples[i] = samples2[ns]; 773 788 currentSample = samples2[ns]; 789 774 790 checked[ns] = true; 775 791 } … … 838 854 } 839 855 856 840 857 //if (mSortSamples) { SortSamples(); } 841 858 //sCgSsaoProgram->SetArray2f(i, (float *)samples2, NUM_SAMPLES); 842 859 //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 846 876 ++ i; 847 877 … … 870 900 sCgSsaoProgram->SetValue1f(i ++, mSampleIntensity * mKernelRadius); 871 901 872 873 902 DrawQuad(sCgSsaoProgram); 874 875 903 glPopAttrib(); 876 904 … … 905 933 // read the second buffer, write to the first buffer 906 934 if (!displayFrame) 935 { 907 936 FlipFbos(fbo); 937 } 908 938 else 939 { 909 940 // end of the pipeline => just draw image to screen 910 941 FrameBufferObject::Release(); 942 } 911 943 912 944 // the neighbouring texels
Note: See TracChangeset
for help on using the changeset viewer.