PDA

View Full Version : 3 coverage factors by reading from texture ?



HamsterofDeath
02-09-2003, 12:33 PM
is this possible ?

the problem is that (at least i think) you have to draw the texture to read the values from it..
so if you draw the coverage texture, read the color value, write a new one (covertex 1), then read alpha, write new color (covertex 2)...thats it... you can't go on.. no third texture..
or am i wrong ?

JustHanging
02-09-2003, 11:15 PM
Hi,

If you're using the same texture blending setup as you did before, it's not so much of a problem.

You must have some kind of an arrays of coverage values, which you use to calculate the vertex colors. Now, you calculate those colors just the way you did before, but instead of using them as vertex colors, make a texture out of them. Then map this texture on your terrain so that each texel hits the vertex whose color is stored in it. So if you have 64*64 vertice, you need a 64*64 texture. Then change your combiner settings to use this texture as the interpolation factor instead of the primary color.

-Ilkka