Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Search:

Type: Posts; User: Triangle

Search: Search took 0.01 seconds.

  1. Ok, I have one more question. Is it possible to...

    Ok, I have one more question. Is it possible to clear only one texture this way ?:


    glBindFramebuffer(GL_FRAMEBUFFER, fbo);
    glDrawBuffers(1, drawBuffers0);
    glClear(GL_COLOR_BUFFER_BIT);...
  2. single fbo and multiple texture attachments

    I want to use a single fbo and multiple texture attachments. I attach textures to different color attachments.
    Then I use glDrawBuffers to switch rendering to different color attachments.
    ...
  3. Replies
    4
    Views
    686

    using an integer texture

    I need to use a texture(rgba) where each channel can store unsigned integer value from a range <0,7> I set a texture this way:


    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32UI, screenWidth,...
  4. Replies
    1
    Views
    314

    deferred rendering and normal mapping

    During a gbuffer stage I save in textures a depth, normals, diffuse and specular colors, shininnes factors but also
    normals from a normal maps (tangent space) and tangent vectors (I can calculate...
  5. Replies
    13
    Views
    1,737

    Ok, but I want to use my fragment shader with...

    Ok, but I want to use my fragment shader with subroutines for a deferred rendernig. Then a render loop looks like this:

    1. gbuffer stage
    2 for each light:
    (additive blending)
    - shadow...
  6. Replies
    13
    Views
    1,737

    subroutines and multiple render targets

    I wonder how to use a shader with subroutines and multiple render targets. I have a fragment shader which contains a few subroutines. (I posted only relevant pieces of the code).



    #version 420...
  7. Replies
    0
    Views
    278

    how glGenerateMipmap works ?

    I call glTexImage2D with a parameter level = 0. Then I call glGenerateMipmap(GL_TEXTURE_2D). What happens with GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL ? I assume that they are automatically...
  8. Replies
    3
    Views
    873

    obj file - smoothing groups

    I have an obj file which looks like this:


    mtllib file1.mtl

    #
    # object f_00
    #

    v x y z
  9. Replies
    4
    Views
    1,275

    I made one more test. I changed an orthographic...

    I made one more test. I changed an orthographic projection to
    glm::ortho(-10.0f, 10.0f, 20.0f, 40.0f, 10.0f, 50.0f) Now it contains only the object and a small area of the ground plane, not the...
  10. Replies
    4
    Views
    1,275

    Thanks for tips. I tried a dynamic bias...

    Thanks for tips. I tried a dynamic bias mentioned above but generally I got a bit worse effect than when using glPolygonOffset. Artifacts in the light were more visible. In the shadow some very...
  11. Replies
    4
    Views
    1,275

    basic shadow mapping - removing artifacts

    I implemented a basic shadow mapping. I have a scene illuminated by one directional light.
    I use an orthographic projection:


    (glm::ortho(-70.0f, 70.0f, -50.0f, 90.0f, -50.0f, 100.0f));

    ...
  12. Replies
    10
    Views
    3,149

    Thanks for explanations. I agree that in general...

    Thanks for explanations. I agree that in general those lines of the code are not equivalent (for example light_view_matrix may contain some rotation)
    But in this particular case the...
  13. Replies
    10
    Views
    3,149

    Ok, I compiled and ran that example. First of all...

    Ok, I compiled and ran that example. First of all I changed a little bit the fragment shader code. Now the example code is more similar to my code. This line:


    vec4 position_ls =...
  14. Replies
    10
    Views
    3,149

    Ok, I removed all FramebufferTexture2D functions...

    Ok, I removed all FramebufferTexture2D functions from the above initialization code and placed them in the render loop. Now the render loop looks like this:
    -bind framebuffer
    -set viewport
    -cull...
  15. Matrices are multiplied before sending to a...

    Matrices are multiplied before sending to a shader because of efficiency. Vertex shader is executed for each vertex so if you do multiplication (ProjectionMatrix * ViewMatrix * ModelMatrix) in the...
  16. Replies
    10
    Views
    3,149

    point light - shadow mapping

    I use a forward rendering and I try to implement a shadow mapping for a point light. I have one fbo and a cube map to store 6 depth textures. I'm not sure how to render a depth to textures when using...
  17. Replies
    4
    Views
    1,115

    A perspective matrix for shadows has zNear = 1.0...

    A perspective matrix for shadows has zNear = 1.0 and zFar = 50.0 for above pictures. When I increase zFar (for example zFar = 70.0) I get following result (clamping to border(1, 0, 0, 0) s,t) :...
  18. Replies
    4
    Views
    1,115

    shadow mapping - texture clamping

    I implemented a simple shadow mapping. In a shader I use sampler2DShadow and textureProj when accessing a texture. Then I multiply a color(diffuse and specular) by a shadow value. A depth texture has...
  19. Replies
    4
    Views
    1,433

    So for a cube when I'm using glDrawArrays in a...

    So for a cube when I'm using glDrawArrays in a single rendering call (GL_TRIANGLES) I need duplicate positions, normals and tex coords ( 36 positions, 36 normals, 36 tex coords). For...
  20. Replies
    4
    Views
    1,433

    My English isn't perfect so maybe I try to...

    My English isn't perfect so maybe I try to explain what I mean by example and how I understand preparing data for shaders. Please correct me if I'm wrong and post more extensive explanation.

    1. We...
  21. Replies
    4
    Views
    1,433

    obj file - processing data

    I'm working on obj loader. I want to draw an object using glDrawElements (smooth shading). Here are my assumptions:

    - the number of normals <= the number of vertices (I don't need to average...
Results 1 to 21 of 21