View Full Version : New blend equation or factor
10-23-2001, 11:44 PM
I know that glBlendEquation only sets the equation for each rgba element, but wouldn't it be nice if there was an equation that allowed mixing elements, maybe by using the full source and destination color in each element. Maybe something like this:
CS = source color (RGBA)
CD = destination color (RGBA)
SF = source factor
DF = destination factor
final blended RGBA values are give by
(CS*SF + CD*DF, CS*SF + CD*DF, CS*SF + CD*DF, CS*SF + CD*DF)
This is probably not the best way to do it, but I hope you get the idea. I have no idea whether this is possible in todays hardware or not, but it seems to me that something like this would allow for much greater flexibility.
What I really need is dot3 blending without having to do 12 passes or whatever. So actually my main request is just the ability to have the same blending operations as the combiner extension.
10-24-2001, 11:08 AM
With the advent of multitextured hardware and advanced texture environment modes (Dot3, Register Combiners, Fragment Shaders, etc), I'm not sure what good this extension would do. I'm not certain how much sense it makes to apply some kind of dot product fragment blending mode. With advanced texture environments, fragment blending can go back to what it should be use for: transparency.
10-29-2001, 02:12 AM
I you want to be able to do something more complex than just combining 2-4 textures, you need this functionality, consider the following two examples in a system with two texture units.
(tex1 * tex2) + (tex3 dot3 tex4), this is simple and easy and can be accomplished, with standard ARB extensions (ARB_env_combine, ARB_env_dot3 and normal blending). If we change that equation ever so slightly it becomes much harder.
(tex1 * tex2) dot3 (tex3 + tex4), this is impossible in OpenGL as it is, because we cannot specify a blend dotproduct. In order to do this, we have to render (tex1 * tex2) and store it in a texture, then render (tex3 + tex4) and store that in another texture and finally we combine these two textures in a third pass.
These two examples may not be very meaningfull, but they do provide a good example. It may be possible to do this in a single pass on a Geforce3, but I don't have a Geforce3 and I try to use only ARB and EXT extensions.
Alternatively a GL_ARB_render_texture would be nice, instead of WGL_ARB_render_texture which requires PBuffers and whatnot. Would it be difficult to just specify a normal RGBA texture as render target, instead of the framebuffer?
Well that's it I hope that clarified my intentions a little.
10-29-2001, 09:40 AM
The equation you propose is very doable in a GeForce3. A GeForce2 or 1 could do it if it had 4 texture units in it.
And I think you can do it with ARB_CrossBar. If your hardware supports 4 multitextures, that is.
11-17-2001, 10:55 AM
Or just do the math in the code of your program, upload the two new textures to pre-existing handles, and then computer the dot product... The only time this would be problematic is if glTexSubImage2D is god-awful slow on that particular implementation of OpenGL, which is not likely if it supports dot3 blending.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.