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 3 of 3

Thread: Clipping in case of viewport being larger than the frame buffer

  1. #1
    Newbie Newbie
    Join Date
    Aug 2013
    Posts
    2

    Question Clipping in case of viewport being larger than the frame buffer

    Suppose:
    1. rendering is happening to an FBO and the texture attached to it is 100x100 in size
    2. viewport is set to (0,0,200,200) (i.e. 100px larger than the frame buffer in both dimensions)
    3. and a draw call is made to render a full screen rectangle.

    Will rasterization happen for points that essentially lie within the viewport but are not going to be visible cause they lie outside the FBO ?

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    498
    Quote Originally Posted by Apollyon View Post
    Will rasterization happen for points that essentially lie within the viewport but are not going to be visible cause they lie outside the FBO ?
    A fragment which lies outside of a bound FBO will fail the pixel ownership test. According to 14.9 of the specification (4.3 core profile), if a fragment fails the pixel ownership test or the scissor test, no further processing is performed, and the fragment shader will not be executed for that fragment.

    The viewport only defines the mapping between normalised device coordinates and window coordinates. It doesn't directly affect which fragments are drawn (e.g. wide points and lines can extend outside the viewport). The bounds of the viewport aren't required to lie entirely within the current render target (window, pixmap, FBO, etc).

  3. #3
    Newbie Newbie
    Join Date
    Aug 2013
    Posts
    2
    Thanks for the clarification.

Posting Permissions

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