PDA

View Full Version : Texture combiners (OpenGL fixed pipeline)



muratmat
02-05-2009, 08:24 AM
Working with OpenGL fixed pipeline, supposing to have two textures bound on, respectively, texture unit 0 and texture unit 1.
Modulating them (t0 * t1), is there a way to obtain:

t0.r * t1.r
t0.g * t1.r
t0.b * t1.r
t0.a * t1.r

What I need is to consider all the t1 channels equal to t1 red channel.
Is there an operand that realizes this?

Thanks in advance.

CrazyButcher
02-06-2009, 04:12 AM
if you have the dotproduct combiner available, you can do (which swaps t0,t1)

U0: T0 dot (1,0,0) passed as const color
U1: T1 modulate