| What I'm trying to acheive is: source: https://forums.tigsource.com/index.php?topic=40832.msg1027183#msg1027183 Original author said he combine world normal and world position, but I can't reproduce this - if you have any idea, pleae comment it. It will be really appreciated!! |
Need ideas: Assign distinct color to each face of mesh
He took the world normal and turned it to a color vector information straight ahead I suppose, combining it with the world position he did the same thing with as well.
If you want a specific color per triangle, it is more difficult, since this color attribute would belong to a vertex, and face is composed of 3 verticies, shared or not. It'd have to be the same color for all three verticies so that it does not interpolate to different color.
So I started with `dot(CameraVector, WorldNormal)` in vertex shader:
Maybe I can make some progress based on this.
Not sure if this helps, but if you want a color per face, then all vertices per face should be unique and assigned that color (so no vertex re-using).
Crealysm game & engine development: http://www.crealysm.com
Looking for a passionate, disciplined and structured producer? PM me