Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: rendering acne...

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2013
    Posts
    4

    rendering acne...

    My current rendering engine is using the following algorithm:
    *First, render the scene from the point of view of the camera, with a pure black shader and writing to the depth buffer
    *Then, for each light:
    - render the shadow buffer to a frame buffer linked only of a depth texture
    - for each layer of material
    + render the scene, with blend set, no write to the depth buffer, and depth comparison set to less or equal


    But I got rendering a.c.n.e (sorry, seems the word is refused in post) !!

    So, my main question is:
    Is it possible to render to a fame Buffer in order to fill a texture while rendering in the default/static back buffer (not at the same time, but rendering something in the back buffer, then switch the rendering buffer, render a shadow map or a reflection map, and back to render the scene to the back buffer)?
    Or do I need to use a render buffer for the main rendering too (which is not that bad, I will be able to switch to a linear workflow)?

    Thanks for any helps,

    Craouette

  2. #2
    Member Regular Contributor
    Join Date
    Aug 2008
    Posts
    433
    There's an easy-to-follow shadow mapping tutorial here: http://www.opengl-tutorial.org/inter...hadow-mapping/ that discusses shadow acne.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2013
    Posts
    4
    No, the problem I have is not shadow a.c.n.e... this one, I know what to do.
    It is rendering a.c.n.e: I render the Z buffer first in order to avoid to use costly shader on pixel that will be written over by near object, then disable the write to z buffer.
    Then, I render my scene again many times, with the same projection and modelview matrices, but disabling the write to z-buffer and setting the depth func to GL_LEQUAL.
    The many times account for the lights... I render the scene one time for each light. So that i can create the shadow map before.

    The a.c.n.e I have is not in the shadow but in the rendering itself, like if the equal test to the z buffer is failing from time to time... but may be I am wrong! will check further!
    But my question is still: is possible to render at same time to more than one rendering buffer (so to render buffer 1, then switch to render buffer 2, go back to render buffer 1 using the result of render buffer 2 without interferences)?

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,126
    Quote Originally Posted by craouette View Post
    Then, I render my scene again many times, with the same projection and modelview matrices, but disabling the write to z-buffer and setting the depth func to GL_LEQUAL.
    Use GL_EQUAL.

    But my question is still: is possible to render at same time to more than one rendering buffer (so to render buffer 1, then switch to render buffer 2, go back to render buffer 1 using the result of render buffer 2 without interferences)?
    Yes, you can do this kind of ping-pong rendering if you want. You can also render/write to multiple rendering buffers simultanously if/when needed.

  5. #5
    Member Regular Contributor
    Join Date
    Aug 2008
    Posts
    433
    Maybe you need to use the "invariant" qualifier to ensure your passes produce the same output?

  6. #6
    Junior Member Newbie
    Join Date
    Oct 2013
    Posts
    4
    ok, so the problem is in my code... I will track it down. Thanks a lot for your help.
    I also will look for the invariant qualifier, I never heard of it!!

  7. #7
    Newbie Newbie
    Join Date
    May 2013
    Posts
    1
    77777777777uuuuuuuuuuupppppppppppppppppppppppppppp pppppppppp

  8. #8
    Junior Member Newbie
    Join Date
    Oct 2013
    Posts
    4
    mapo125: ????


    I found the problem... first shader, I used gl_Position = ftransform(); second shader, I used:
    vec4 vVertex = gl_ModelViewMatrix * gl_Vertex;
    gl_Position = gl_ProjectionMatrix * vVertex;
    Last edited by craouette; 11-03-2013 at 10:30 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •