/\
/ \
/\ /\
/ \/ \
/ | \
/____|_____\
I was thinking of using a 1d texture on each point. Would that work? Does anyone know of a more elegant way of doing this?
[edited by - llvllatrix on February 25, 2004 7:51:11 PM]
Colors without interpolation
Anyone know of an easy way to generate colors on a triangle without interpolation?
Idealy i want a triangle where the colors of the vertices meet at the midpoints and the center of the triangle.
Something like this:
My first instinct would be to just use three quads defined using the midpoints of the edges and the center of the triangle.
What about this:
For each point you pass one 3D vector value from the vertex stage to the fragment stage. e.g.:
for P1: (1,0,0)
for P2: (0,1,0)
for P3; (0,0,1)
These vectors are interpolated just like the texture coordinates and colors. In a fragment program you then have to determine the lowest component of these vector. Is for example z the lowest component you know, that the fragment is nearer P3 than P1 or P2. Based on this information you than can color the fragment.
Maybe this could also be done using texture environments, NV register combiners or ATI fragment shader.
It's just an idea but I think it should work!
--------------------------------------------------------
There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.
There is another theory which states that this has already happened...
[edited by - Corrail on February 25, 2004 8:51:21 PM]
P1 /\ / \ /\ /\ / \/ \ / | \ /____|_____\ P2 P3
For each point you pass one 3D vector value from the vertex stage to the fragment stage. e.g.:
for P1: (1,0,0)
for P2: (0,1,0)
for P3; (0,0,1)
These vectors are interpolated just like the texture coordinates and colors. In a fragment program you then have to determine the lowest component of these vector. Is for example z the lowest component you know, that the fragment is nearer P3 than P1 or P2. Based on this information you than can color the fragment.
Maybe this could also be done using texture environments, NV register combiners or ATI fragment shader.
It's just an idea but I think it should work!
--------------------------------------------------------
There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.
There is another theory which states that this has already happened...
[edited by - Corrail on February 25, 2004 8:51:21 PM]
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement