PDA

View Full Version : gl_FBColor and GL_BLEND



marfa713
04-23-2004, 12:04 AM
1) Is gl_FBColor not yet implemented? I assume not, since I get a compilation error.

2) Is blending in the OpenGL fixed function pipeline supposed work with pixel shaders? I've been trying to blend the output from the pixel shader with the contents of the frame buffer, but with no luck.

mikeman
04-23-2004, 04:44 AM
1)gl_FBColor is mentioned in the GLSL spec but is not implemented yet.
2)Blending works with fragment shaders exactly the same way it works with the fixed pipeline.I don't know what's causing your problem.You should post your code.

mrbill
04-23-2004, 05:02 AM
Originally posted by mikeman:
1)gl_FBColor is mentioned in the GLSL spec but is not implemented yet.
2)Blending works with fragment shaders exactly the same way it works with the fixed pipeline.I don't know what's causing your problem.You should post your code.1) gl_FBColor was *REMOVED*.
See issue 23 on P. 75. (And related issue 43 on P. 80.)

*Please* check your spec. The most recently published version is 1.051, you can find it at http://www.opengl.org/documentation/oglsl.html .

2) Blending, absolutely should work. Also Coverage Application and *ALL* of the "per-fragment operations" absolutely should work. The fragment shader subsumes Texel Generation, Texture Application, Color Sum and Fog.

-mr. bill

mikeman
04-23-2004, 05:26 AM
I read in the spec:

23) Should the fragment shader be allowed to read the current location in the frame buffer?
DISCUSSION: It may be difficult to specify this properly while taking into account multisampling. It
also may be quite difficult for hardware implementors to implement this capability, at least with
reasonable performance. But this was one of the top two requested items after the original release of
the shading language white paper. ISVs continue to tell us that they need this capability, and that it
must be high performance.
RESOLUTION: Yes. This is allowed, with strong cautions as to performance impacts.
REOPENED on December 10, 2002. There is too much concern about impact to performance and
impracticallity of implementation.
CLOSED on December 10, 2002.

If gl_FBColor is removed,they should have RESOLVED:No.The issue was just REOPENED.Are you sure that this capability will never be implemented?
Although with EXT_RENDER_TARGET,PBO or supperbuffers we can achieve the same thing,and much more.

-EDIT:Ok,I just read issue 43 and it made things more clear,you're right.
And render_target can't do the same thing,since we can't render and read the texture the same time.But we can use two buffers for read/write,swapping them in each new pass,and render to the framebuffer the last pass.