Jump to content
  • Advertisement
Sign in to follow this  
soconne

is this type of blending possible ?

This topic is 4448 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!