Texture Atlas to Loaded Mesh

Let’s say I want to change the color of a loaded mesh, using a texture atlas (16x16 png & each pixel is a different color to choose from).

Anyone know the easiest way to do this?

Here’s a PG with the texture and mesh already loaded:

You can try something like this:


However, why not setting the diffuse color of the material instead?

Thanks for the help, that works!

I’m trying to convert everything in my scene to use this texture atlas. Most of the meshes have static textures with different faces having different colors, so the texture atlas will draw those in 1 call instead of multiple. The meshes that are solid colors could stay using diffuse colors, but then the colors don’t match. So I’m just gonna use the same texture atlas for everything and hopefully it helps a bit with performance.