space-truckers icon indicating copy to clipboard operation
space-truckers copied to clipboard

Trail mesh segment colors reflect encounter zone

Open jelster opened this issue 3 years ago • 2 comments

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.

jelster avatar Aug 26 '21 02:08 jelster

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

jelster avatar Oct 07 '21 02:10 jelster

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

jelster avatar Aug 07 '22 16:08 jelster