bug (or weird behavior) with VertexColor() (fixed)

Started by RemiD, March 13, 2018, 21:07:41

Previous topic - Next topic

RemiD

Hello,

I have just found a bug (or weird behavior) with VertexColor()
With this command, you can specify what color and what transparency (alpha) you want for the vertex.

However, when capturing small renders for cubemaps (for reflections effect), some of the floors, walls, ceilings, stalagtites, were missing and the color of the camera background (cameraclscolor) was drawn in these empty spaces... weird...

Not sure what the cause was, and then i decided to look at my vertices lighting shading procedures... and what was missing was a limit to how low a R,G,B value of a vertex color could be (no less than 001,001,001), and a limit to how high a R,G,B value of a vertex color could be (no more than 255,255,255)
So apparently if a R,G,B value of a vertex color is less than 000,000,000 it becomes totally transparent (or not considered when rendering)... And that's why some of the environment was missing, and instead the color of the camera background was drawn.

Not easy to debug ! But now it works correctly ! (Maybe it is the same thing for others 3d engines, so to keep in mind...)