PDA

View Full Version : Blend Func



MrShoe
11-06-2001, 05:16 PM
Which blend func would i use if i wanted to have a terrain textured with snow texture in high altitudes and grass in low but i wanted to blend betweem them to achieve a smooth transition??

dorbie
11-06-2001, 05:51 PM
I assume you are talking about a multipass approach because you're discussing blendfunc so you have the terrain already drawn and now you want to draw the snow capped peaks. many functions would give you a smooth transition, but for best results in your case you need alpha information to describe where you want snow and where you want earth. This alpha could be per vertex or per texel (in the texture) and you'd use a blendfunction something like glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) to give the best effect. There are other approaches but this one will let you paint a color pattern in the snow and blend between a textured earth and textured snow, independent of both.