-1
  1. I know i can go from 3d space to 2d space of the Mesh by getting the corresponding uv coordinates of the vertex.
  2. When i transform to uv space, each vertex will have its color and i can put the color in the pixel position what the uv co-ordinate returns for a particular vertex, but the issue is how do i derive the pixels that lie inbetween them, i want a smooth gradient.
  3. For example, the color value at uv co-ordinate (0.5,0.5)->(u,v) is [30,40,50]->(RGB) and at [0.75,0.75] its [70,80,90] and lets say there are three vertices and theres one more at [0.25.0.6] as [10,20,30], how do i derive the colors that goes on the area these three uv/vertex coordinates fill, i mean the inbetween values for the pixels?
Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
user1062383
  • 39
  • 1
  • 6

1 Answers1

0

Just draw this mesh on a GPU. You know already that you can replace vertex positions with UVs so you have it represented on the texture space.

Keep your vertex colors unchanged and draw this mesh on your target texture, GPU will do color interpolation for every triangle you draw.

And keep in mind that if two or more triangles share the same texture space then the result will depend on triangle order.

kolenda
  • 2,741
  • 2
  • 19
  • 30