Skip to main content
gamedev.net
๐Ÿ”’ Locked

Textures

Started by SkyR Jun 26, 2004 at 11:44 PM 0 replies 450+ views
Original Post
SkyR
SkyR
I need examples of Alpha textures using and Blending to. Just gallery with image and explanation about Alpha and other params wich used when rendering this pic. Link pls. P.S. Sorry for bad english
Kuladus
Kuladus

glEnable(GL_BLEND);glBlendFunc(src_factor, dst_factor);

dst_pixel_color = src_factor*src_color + dst_factor*dst_color
some factors = GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR,
GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA



so to blend two textured polygons...

glDisable(GL_DEPTH_TEST); //disable the depth test
glEnable(GL_BLEND);

glBlendFunc(GL_ONE, GL_ZERO);
--draw first triangle

glBlendFunc(GL_SRC_ALPHA, GL_ONE);
--draw second triangle

glEnable(GL_DEPTH_TEST); //disable the depth test
glDisable(GL_BLEND);

Topic Locked

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

Sign in to reply to this topic.