导读:
Antonio Bleile
programming blend function
Hi,
I'm currently trying to blend two RGBE (HDRI encoded) fragments
together.
The only way this seems to work is through shaders (the shader takes
as
input a copy of the RGBE encoded framebuffer, the shader then blends
the fragments togehter). There is no way to "customize/program" the
glBlendFunc,
right? What about OpenGL 3? Will that allow it? And there's absolutely
no way
for the fragment shader to access the framebuffer, right? What about
FBO's?
Those are ordinary textures, what happens if I just give a fragment
shader the
current FBO render target as input (sounds insane, but it might be
legal?).
Thank you &Regards,
Toni
09-16-2007, 03:33 PM
Wolfgang Draxinger
Re: programming blend function
Antonio Bleile wrote:
>Hi,
>
>I'm currently trying to blend two RGBE (HDRI encoded)
>fragments together.
>The only way this seems to work is through shaders (the shader
>takes as input a copy of the RGBE encoded framebuffer, the
>shader then blends the fragments togehter).
>There is no way to "customize/program" the glBlendFunc, right?
glBlendFunc controls a part of the fixed function pipeline.
Anything different from the fixed function pipeline must be done
with shaders.
>What about OpenGL 3? Will that allow it?
OpenGL 3 will discard the fixed function pipeline completely,
i.e. you must define all vertex and framgment processing
yourself. This will also mean, that a lot of API functions will
be removed, among them glBlendFunc.
>And there's absolutely no way for the fragment shader to access
>the framebuffer, right?
No, since the framebuffer is in constant change while a primitive
is processed. So there must be a copy taken somewhere in the
process.
>What about FBO's? Those are ordinary textures,
No they aren't. A FBO can be used as texture, but can do also
other stuff.
>what happens if I just give a fragment shader the current FBO
>render target as input (sounds insane, but it might be legal?).
Read the FBO spec, it contains an own paragraph exactly about
this. You can't bind a FBO that's a render target as texture
within the same render context. And you can't make a texture
bound FBO as render target.
Wolfgang Draxinger
--
E-Mail address works, Jabber: hexarith--at--jabber.org, ICQ: 134682867
09-16-2007, 10:16 PM
fungus
Re: programming blend function
On Sep 16, 4:42 pm, Antonio Bleile wrote:
>There is no way to "customize/program" the
>glBlendFunc, right?
Right.
>What about OpenGL 3? Will that allow it?
No. At the hardware level there's a big gap
between the pixel shading operations and
the blending operations. Bringing them
together would kill performance.
--
/ O O /
/_____/ FTB. Remove my socks for email address.
09-17-2007, 02:58 AM
Antonio Bleile
Re: programming blend function
On Sep 17, 5:16 am, fungus wrote:
>On Sep 16, 4:42 pm, Antonio Bleile wrote:
>
>>There is no way to "customize/program" the
>>glBlendFunc, right?
>
>Right.
>
>>What about OpenGL 3? Will that allow it?
>
>No. At the hardware level there's a big gap
>between the pixel shading operations and
>the blending operations. Bringing them
>together would kill performance.
Alright.....
Thank you guys!
Toni
本文转自
http://objectmix.com/graphics/136729-programming-blend-function.html
Antonio Bleile
programming blend function
Hi,
I'm currently trying to blend two RGBE (HDRI encoded) fragments
together.
The only way this seems to work is through shaders (the shader takes
as
input a copy of the RGBE encoded framebuffer, the shader then blends
the fragments togehter). There is no way to "customize/program" the
glBlendFunc,
right? What about OpenGL 3? Will that allow it? And there's absolutely
no way
for the fragment shader to access the framebuffer, right? What about
FBO's?
Those are ordinary textures, what happens if I just give a fragment
shader the
current FBO render target as input (sounds insane, but it might be
legal?).
Thank you &Regards,
Toni
09-16-2007, 03:33 PM
Wolfgang Draxinger
Re: programming blend function
Antonio Bleile wrote:
>Hi,
>
>I'm currently trying to blend two RGBE (HDRI encoded)
>fragments together.
>The only way this seems to work is through shaders (the shader
>takes as input a copy of the RGBE encoded framebuffer, the
>shader then blends the fragments togehter).
>There is no way to "customize/program" the glBlendFunc, right?
glBlendFunc controls a part of the fixed function pipeline.
Anything different from the fixed function pipeline must be done
with shaders.
>What about OpenGL 3? Will that allow it?
OpenGL 3 will discard the fixed function pipeline completely,
i.e. you must define all vertex and framgment processing
yourself. This will also mean, that a lot of API functions will
be removed, among them glBlendFunc.
>And there's absolutely no way for the fragment shader to access
>the framebuffer, right?
No, since the framebuffer is in constant change while a primitive
is processed. So there must be a copy taken somewhere in the
process.
>What about FBO's? Those are ordinary textures,
No they aren't. A FBO can be used as texture, but can do also
other stuff.
>what happens if I just give a fragment shader the current FBO
>render target as input (sounds insane, but it might be legal?).
Read the FBO spec, it contains an own paragraph exactly about
this. You can't bind a FBO that's a render target as texture
within the same render context. And you can't make a texture
bound FBO as render target.
Wolfgang Draxinger
--
E-Mail address works, Jabber: hexarith--at--jabber.org, ICQ: 134682867
09-16-2007, 10:16 PM
fungus
Re: programming blend function
On Sep 16, 4:42 pm, Antonio Bleile wrote:
>There is no way to "customize/program" the
>glBlendFunc, right?
Right.
>What about OpenGL 3? Will that allow it?
No. At the hardware level there's a big gap
between the pixel shading operations and
the blending operations. Bringing them
together would kill performance.
--
/ O O /
/_____/ FTB. Remove my socks for email address.
09-17-2007, 02:58 AM
Antonio Bleile
Re: programming blend function
On Sep 17, 5:16 am, fungus wrote:
>On Sep 16, 4:42 pm, Antonio Bleile wrote:
>
>>There is no way to "customize/program" the
>>glBlendFunc, right?
>
>Right.
>
>>What about OpenGL 3? Will that allow it?
>
>No. At the hardware level there's a big gap
>between the pixel shading operations and
>the blending operations. Bringing them
>together would kill performance.
Alright.....
Thank you guys!
Toni
本文转自
http://objectmix.com/graphics/136729-programming-blend-function.html
讨论了使用着色器进行RGBE编码(HDRI)的两个片段的混合过程。由于OpenGL的glBlendFunc仅适用于固定管线,更复杂的功能需通过自定义着色器实现。未来OpenGL3将移除固定管线,所有操作将由用户自行定义。
1442

被折叠的 条评论
为什么被折叠?



