View Full Version : textures combination

10-19-2006, 04:35 AM
I have 2 texures which I render on a single polygon. What I need is to get the maximum color of the 2 textures on the fragment. In other words:
FragColor = max(Tex1Color, Tex2Color)

That would be easy with a shader, but without a shader, is there any blending mode that does what I want?

10-19-2006, 06:10 AM
First off, I'm not of the opinion that this question is advanced. Second, how do you determine the "maximum color"? I'm assuming you are talking about the maximum of each color component? However, in the future, you should keep in mind that there are several color spaces and "maximum color" could mean several different things including maximum saturation, maximum luminance, etc. That said, I'm simply going to assume you want the maximum of each component. That said, if you're constrained to fixed function, the only option I know of is http://www.opengl.org/registry/specs/EXT/blend_minmax.txt . Using this extension, you'd have to render in two passes. Also, if the same textures are always paired together, and you don't care about anything other than texture color, then the obvious solution would be to simply compute the result yourself and store in a single texture.

Kevin B