CelestiaProject/Celestia

Normalize object's point color

JiliTheSpaceboy opened this issue · 1 comments

Currently, the color of the point source directly uses the Color parameter. This means that if the Color parameter is defined to have Value of less than 1 (such as [ 0.3 0.3 0.3 ], the object's point would appear dark as well. This is not the case in real life, where measurement of point source only yields 'normalized' colors. Therefore, I believe the program should normalize the Color parameter when drawing the point. This would allow us to use BlendTexture with any arbitrary color to tint a single color-calibrated texture to obtain a realistic-colored texture, instead of having to manually calibrate the brightness of the texture, make multiple copies of the same texture with diffferent brightnesses, and calculate normalized colors. (If the color is set to [ 0 0 0 ], then the normalized color should be set to [ 1 1 1 ].)

There could also be a 'toggle' of this function to enable/disable normalizing. The normalization should be ON by default as it is how real life objects work.

EDIT 1: The normalized colors should also apply on planetshine, as albedo already controls the brightness of the reflected light, in a similar manner to point source brightness.

An alternative to having a toggle parameter (which was suggested as a workaround for some old add-ons which use pitch black colors to make objects invisible as points) is to not apply the normalization if and only if the color is pitch black [ 0 0 0 ]. After all, in theory, such an object should not glow at all...