Original Post
Hey folks,
In my Direct3D 9.0c application I am drawing a 2D quadrilateral using two triangles in a "triangle strip". I would like to assign a value to each of the four vertices of the quad that will get interpolated across the shape and fed to the pixel shader.
The problem that I'm having is that, since the interpolation of the vertex values occurs across each of the two triangles seperately, the values are not smooth across the entire quad. There is a nasty "seam" in the values along the diagonal where the two triangles come together.
My question is: Is there a good alternative or work-around in order to interpolate correctly across a 2D quadrilateral? The only thing I can think of is to create a giant triangle in place of the quad, and use the pixel shader to "hide" areas of the triangle that I don't want. I would also have to perform a complex calculation to come up with the proper values for the three triangle vertices that would result in an interpolation across the surface that is identical to the quad I want.
I greatly appreciate any additional insight or words of wisdom; thank you!
In my Direct3D 9.0c application I am drawing a 2D quadrilateral using two triangles in a "triangle strip". I would like to assign a value to each of the four vertices of the quad that will get interpolated across the shape and fed to the pixel shader.
The problem that I'm having is that, since the interpolation of the vertex values occurs across each of the two triangles seperately, the values are not smooth across the entire quad. There is a nasty "seam" in the values along the diagonal where the two triangles come together.
My question is: Is there a good alternative or work-around in order to interpolate correctly across a 2D quadrilateral? The only thing I can think of is to create a giant triangle in place of the quad, and use the pixel shader to "hide" areas of the triangle that I don't want. I would also have to perform a complex calculation to come up with the proper values for the three triangle vertices that would result in an interpolation across the surface that is identical to the quad I want.
I greatly appreciate any additional insight or words of wisdom; thank you!