The effect I want to achieve is vertex color with sharp contours. So inside the triangle the fragment shader should use the color of whatever vertex is closest to that fragment.
Now when thinking about it, the only solution I can come up with is assigning tex coords 1,0,0 0,1,0 and 0,0,1 to the three vertices and have 2 (reoordered) duplicates of the vertex color array and then choose from the color aray of which the corresponding tex coord is highest. This method would at least add 9 more floats to each vertex. Which will slow down the application as my meshes are changing quit often and increase the memory footprint significantly.
Is there a better/easier way to achieve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…