Changeset 2979


Ignore:
Timestamp:
09/28/08 23:36:50 (16 years ago)
Author:
mattausch
Message:
 
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  
    189189        } 
    190190 
    191         glBindTexture(GL_TEXTURE_2D, 0); 
    192         glFlush(); 
    193         glFinish(); 
    194         glEnable(GL_TEXTURE_2D); 
     191         
    195192        glBindTexture(GL_TEXTURE_2D, mTexId); 
    196         //glBindTexture(GL_TEXTURE_2D, mTexId); 
     193         
    197194        GLint width, height; 
    198195 
    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); 
    201198 
    202199        cout << "w: " << width << "h: " << height << endl; 
    203200 
    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 */ 
    209201        unsigned char *data = new unsigned char[bytes * 4 * width * height]; 
    210202 
    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); 
    214204 
    215205        glBindTexture(GL_TEXTURE_2D, 0); 
     
    218208        float *d = (float *)data; 
    219209 
    220         /*for (int i = 0; i < 10000; ++ i) 
    221         { 
    222                 if (i % 100 == 0) 
    223                 cout << "x: " << d[i]; 
    224         }*/ 
    225         //cout << endl << endl; 
    226210        return data; 
    227211} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r2978 r2979  
    5252        float numSamples = 0; 
    5353 
    54         // avoid singularity of  
    55         centerPosition.xyz += currentNormal * 1e-4f; 
    56  
    5754        for (int i = 0; i < NUM_SAMPLES; ++ i)  
    5855        { 
     
    8582                const float cos_angle = max(dot(direction_to_sample, currentNormal), 0.0f); 
    8683 
     84                // the distance_scale offset is used to avoid singularity that occurs at global illumination when  
     85                // the distance to a sample approaches zero 
    8786                const float distance_intensity =  
    8887                        (SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + length_to_sample * length_to_sample); 
Note: See TracChangeset for help on using the changeset viewer.