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

Thread: Don't know how to achieve Interlaced Rendering

  1. #1
    Newbie Newbie
    Join Date
    Jul 2016
    Posts
    1

    Don't know how to achieve Interlaced Rendering

    Is there any way to render Interlaced (for tv purpose: 1080i)?

    Actual Solution: I'm rendering my scene every 20msecs and copying odds and even rows to create 1 frame every 40msecs. This "interlaced" frame goes to the Graphic Engine.
    The problem with this is that tooks a lot of copyes and scanlines to do this.

    We are making a little scene editor but the final result must go to a TV OUT in an Interlaced Mode.



    Thanks in advance.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,925
    Quote Originally Posted by Infame87 View Post
    Is there any way to render Interlaced (for tv purpose: 1080i)?
    Actual Solution: I'm rendering my scene every 20msecs and copying odds and even rows to create 1 frame every 40msecs. This "interlaced" frame goes to the Graphic Engine.
    The problem with this is that tooks a lot of copyes and scanlines to do this.
    There's no reason to render 576 lines then discard half of them; you can just render 288 lines for each field.

    One slightly tricky point is to get the projection matrix correct. The pixel centres for line i (0<=i<288) should be at (2*i+0.5)/576 for an even[*] field or (2*i+1.5)/576 for an odd[*] field. To achieve this, a projection which is correct for a 576-line frame should be pre-multiplied by a Y-translation of +/- 1/1152 for a 288-line field.

    [*] I may have these terms backward; here, "even" means lines 0,2,4,.... Bear in mind that OpenGL puts the origin in the lower-left corner with Y increasing upward.

    You may be able to avoid (or at least optimise) a copy by rendering to one half (left or right) of a 1536x288 framebuffer. When treated as a 1-D array of pixels, the result will have the same layout as a 768x576 interlaced frame.

    If you need the result as a 768x576 framebuffer, you can use texture views (in OpenGL 4.3+) to treat the same memory as both a 1536x288 texture and 768x576 texture. Render into the former then blit the latter to the screen. For a memory to memory copy, this approach reduces to a single block copy rather than needing to copy line-by-line.

Posting Permissions

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