is this type of blending possible ?

Started by
0 comments, last by zedzeek 18 years ago
I have tried using different texture combiner settings to achieve the blending I need but none of them work correctly. What I would like to do is combine the color from a texture with the incoming lighting value and have the following results: light=0 + texture => black light=128 + texture => normal texture light=255 + texture => white Basically if I use GL_ADD_SIGNED then I get what I need except that when light=0 the output color is not black. GL_MODULATE will give me black when light=0 but not white when light=255. Is there a way to get around this WITHOUT using shaders?
Author Freeworld3Dhttp://www.freeworld3d.org
Advertisement
light=0 + texture => black
light=128 + texture => normal texture
light=255 + texture => white

dont know if its possible

note use (0->1) instead of (0->255) for simplicity
times light that by 2 thus values reside in (0->2)
color = light * texture
thus 0 == black
thus 0.5 == the texture
thus 1 = texture*2(not white)

i suppose if u wanted from 0.5->1.0 == fade from texture->fade then u could do
(light-0.5)*2.0
with various nums
(0.5-0.5)*2.0 = 0.0;
(0.75-0.5)*2.0 = 0.5;
(1.0-0.5)*2.0 = 1.0;
and just add that result to the texture

This topic is closed to new replies.

Advertisement