space-truckers
space-truckers copied to clipboard
Trail mesh segment colors reflect encounter zone
Each encounter zone has a color associated with it. When the trail mesh passes through a particular encounter zone, its rendered color should match that of the encounter zone. This PG is from the docs for vertice data.
Another potentially interesting approach would be to assign a color atlas texture to the trail mesh's material and instead of updating vertice colors you would update the vertice UV's.
Did some investigating, and apparently the vertex count is pre-determined based on the value passed in as the length
parameter of the ctor. So this isn't going to be a viable approach, in other words :(
This PG demonstrates; if the scheme were workable, the colors would all randomly change every frame.
I think a better way to approach this is going to be through lighting or alpha blending maybe
Wow ok happy to be wrong on this one! Looks like I messed up in my PG linked above and was pushing the wrong number of arguments into the vertice color array (4 instead of 3). This PG shows the random colors on the trail mesh shifting