Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7697397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:00:13+00:00 2026-05-31T22:00:13+00:00

From the few examples I have seen around the net, gl_FragData[0] is assumed to

  • 0

From the few examples I have seen around the net, gl_FragData[0] is assumed to be a color buffer. I tried to find the meaning of each index into gl_FragData and came across this passage from OpenGL Shading language book (orange book)

gl_FragData is an array that can be assigned values that are written
into one or more offscreen buffers. The size of this array is
implementation dependent and can be queried with glGet with the
symbolic constant GL_MAX_DRAW_BUFFERS. The offscreen buffers that are
modified as a result of writing values into gl_FragData within a
fragment shader are specified with glDrawBuffers. The value written
into gl_FragData[0] updates the first buffer in the list specified in
the call to glDrawBuffers, the value written into gl_FragData[1]
updates the second buffer in the list, and so on.

It’s not specified that 0th value of gl_FragData is always color buffer. If there is such specification, where can I find it? If not, what is a normal practice when writing to gl_FragData?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:00:14+00:00Added an answer on May 31, 2026 at 10:00 pm

    It doesn’t have to be a color buffer per-se. But if it’s not a color buffer, then it’s nothing.

    The gl_FragData output array refers to the values set by glDrawBuffers. And when using an FBO, the values you pass to this function can only be GL_COLOR_ATTACHMENTn or GL_NONE. Which, as the names state, are color buffers.

    So it’s either a color buffer or it’s GL_NONE.

    For GL ES implementations that don’t offer glDrawBuffers (ie, that don’t implement NV_draw_buffers), it is defined as though index zero was set to GL_COLOR_ATTACHMENT0.

    It is silly of ES 2.0 to allow for the possibility of multiple attachments without actually providing a way to render to more than one of them…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried a few examples I've seen on the internet, but I can't seem
I have seen a few examples lately where if statements are written as follows:
If I have a few UNION Statements as a contrived example: SELECT * FROM
I'm trying to call the HtmlTidy library dll from C#. There's a few examples
The problem: we have jobs that run from a few seconds to a few
I have inherited a few programs from a previous developer who was a little
I've seen quite a few examples of how to add alphabetical section headers to
I have a fair few files that have been extracted from a zip created
I have a form in CakePHP with a few dozen fields in it. From
I'm developing a ASP.Net MVC3 app which will have few hundred videos. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.