Skip to main content
GameDev.net gamedev.net
🔒 Locked

Blending quesition

Started by zurekx Jan 22, 2008 at 5:19 PM 0 replies 400+ views
Original Post
zurekx
zurekx
I've rendered my scene with only shadows/lighting. Now I want to render it again with textures and blend it in such a way that the value in the color buffer is equal to the the old color buffer value multiplied by the new value. What blend function should I use? (so if I have the value (0.5, 0.5, 0.5, 1.0) in the color buffer from the lighting, and a texel has the value (0.0, 1.0, 0.5), I want the final result to be (0.0, 0.5, 0.25, 1.0).
kolrabi
kolrabi
glBlendFunc(GL_DST_COLOR, GL_ZERO);

or

glBlendFunc(GL_ZERO, GL_SRC_COLOR);

should do the trick.
blah :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.