Texture vs per vertex color

Everything DG Kernel: Technical discussions and issues
Post Reply
Mike Zubovic
Posts: 39
Joined: Mon Jul 15, 2024 5:20 am

Texture vs per vertex color

Post by Mike Zubovic »

Hello friends
This is a bit of an educational thread.

There are two technologies for applying images or variable color to the meshed surfaces: Texture and per vertex color.

Texture paints an image embedded in the model or stored as an external file. This means there is some mapping of triangles of the image to simplices (faces) of the mesh. This is a precise and efficient method. A small mesh like two simplices rectangle can display the whole image. It is the method used in games.

The drawback is that it is little trickier to program in case you need to do some operations with the mesh like clipping or extraction.

Per vertex color uses three colors stored in the vertices to paint the simplex with a gradient color interpolated inside the simplex. It is a very approximate shading. It is good to display some slowly changing over the surface data like temperature. It is not good for displaying images or text. It can work for images, but the mesh would have to be very dense to achieve any quality.

Per vertex color is simple to create and manipulate programmatically, but it heavy on data and runtime execution.

So, for images textures is the right technology. Per vertex color is the preferred method for displaying variable colors.

Happy coding
Post Reply