Changeset 2979 for GTP/trunk/App/Demos
- Timestamp:
- 09/28/08 23:36:50 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp
r2977 r2979 189 189 } 190 190 191 glBindTexture(GL_TEXTURE_2D, 0); 192 glFlush(); 193 glFinish(); 194 glEnable(GL_TEXTURE_2D); 191 195 192 glBindTexture(GL_TEXTURE_2D, mTexId); 196 //glBindTexture(GL_TEXTURE_2D, mTexId);193 197 194 GLint width, height; 198 195 199 glGetTexLevelParameteriv(GL_TEXTURE_2D, 1, GL_TEXTURE_WIDTH, &width);200 glGetTexLevelParameteriv(GL_TEXTURE_2D, 1, GL_TEXTURE_HEIGHT, &height);196 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); 197 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); 201 198 202 199 cout << "w: " << width << "h: " << height << endl; 203 200 204 /*glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);205 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height);206 207 cout << "w: " << width << "h: " << height << endl;208 */209 201 unsigned char *data = new unsigned char[bytes * 4 * width * height]; 210 202 211 212 glGetTexImage(GL_TEXTURE_2D, 1, GL_RGBA, GL_FLOAT, data); 213 //glGetTexImage(GL_TEXTURE_RECTANGLE_EXT, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, (void *)data); 203 glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, data); 214 204 215 205 glBindTexture(GL_TEXTURE_2D, 0); … … 218 208 float *d = (float *)data; 219 209 220 /*for (int i = 0; i < 10000; ++ i)221 {222 if (i % 100 == 0)223 cout << "x: " << d[i];224 }*/225 //cout << endl << endl;226 210 return data; 227 211 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2978 r2979 52 52 float numSamples = 0; 53 53 54 // avoid singularity of55 centerPosition.xyz += currentNormal * 1e-4f;56 57 54 for (int i = 0; i < NUM_SAMPLES; ++ i) 58 55 { … … 85 82 const float cos_angle = max(dot(direction_to_sample, currentNormal), 0.0f); 86 83 84 // the distance_scale offset is used to avoid singularity that occurs at global illumination when 85 // the distance to a sample approaches zero 87 86 const float distance_intensity = 88 87 (SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + length_to_sample * length_to_sample);
Note: See TracChangeset
for help on using the changeset viewer.