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

Color Interpolation

Started by doctorsixstring Feb 19, 2009 at 11:10 PM 2 replies 1.5k views
Original Post
doctorsixstring
doctorsixstring
This image is of three separate, overlapping triangles where each triangle has a single vertex with alpha 1.0 (the other two verts are alpha 0.0). When rendered together, the accumulated alpha at the center of the final triangle is less than 1.0 (it seems to be closer to 0.7). I expected the triangle to be 100% white (i.e. the sum of the alpha for each pixel from the three triangles is 1.0). What can I do to achieve this effect? Is it possible to adjust the color interpolation equation? FYI, I'm trying to develop an alternative solution to the "dark center of triangles" problem described in this height map rendering article.
V-man
V-man
Sounds like a very old article. When is it written?
Today, we use multitexturing and shaders.
doctorsixstring
doctorsixstring
The article looks to be about three years old, based on the first comment in the associated thread.

I just did some research on rendering heightmaps with multitexturing and shaders, and it seems promising. However, wouldn't multitexturing limit me to a small (4-8) number of terrain types? I suppose that many terrain types would be pushing it for a heightmap, anyways.

For curiosity's sake, is there any solution to the original question?
V-man
V-man
For adding colors and adding alpha values
glBlendFunc(GL_ONE, GL_ONE)

There is also glBlendFuncSeparate if you want different functionality for RGB and alpha
http://www.opengl.org/sdk/docs/man/xhtml/glBlendFuncSeparate.xml

Topic Locked

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

Sign in to reply to this topic.