`EntityColor` question?

Blitz3D Forums/Blitz3D Beginners Area/`EntityColor` question?

Quantum(Posted 2007) [#1]
I know the command reference states that (as usual) the values for R,G & B are 0-255 for the `EntityColor` command, and thats all I've ever set them to... until today!

By accident... ie a mis-type... I entered RGB values of 455,455,455... and instead of it throwing an error, or defaulting to 255... the object (a sky-sphere) took on an almost luminous intensity??

By experimenting I kinda determined that 255,255,255 gave the object it's normal full-bright setting... and anything above 255 increased the luminesence of each vale?

Is this a qwerk with my ATI video card?... or is the command reference out of date regarding the maximum RGB values?... I just find it weird!


DJWoodgate(Posted 2007) [#2]
I would not have expected 255 to give the equivalent of full bright under default ambient lighting. However if fullbright is not enabled my understanding is the entitycolor values are multiplied with the underlying mesh surface color values, which I think are initially set at 255 for the B3d primitives. These values are then multiplied by the light values. This is easily done for ambient light since it is the same everywhere. Other lighting requires more calculation and will be interpolated across the vertices of each triangle.

The default ambient light value in b3d is 127 for each of red green and blue. After normalising these values you get 0.5 * 1.0 which is 127. So that would be half bright, and to get the equivalent of full bright in this case you would need to set the entitycolor values to 512. If you have changed the default lighting things will of course be different.

The docs do not explain this very well and can be misleading. The example for entitycolor actually limits the values you can input to the range 0-255! It keeps the forums busy though and gives us something to moan about.


Quantum(Posted 2007) [#3]
Thanks DJ...

I guess I should have mentioned that I'm not actually using any `lights` in my scene... cos it's been lightmapped in Giles. So my sky-sphere is just an extra unlit model that I was using EntityFX & EntityColor to get its intensity the same as the scenery model.

Thanks for the explanation though :)