Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize object's point color #2016

Closed
JiliTheSpaceboy opened this issue Dec 16, 2023 · 1 comment
Closed

Normalize object's point color #2016

JiliTheSpaceboy opened this issue Dec 16, 2023 · 1 comment

Comments

@JiliTheSpaceboy
Copy link
Contributor

JiliTheSpaceboy commented Dec 16, 2023

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.

@pedro-fixingstuff
Copy link

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...

JiliTheSpaceboy added a commit to JiliTheSpaceboy/Celestia that referenced this issue Dec 19, 2023
See Issue CelestiaProject#2016

Pedro noted that old addons use [ 0 0 0 ] in order for object to not get rendered as points; this is handled by the condition at the beginning, which excludes such objects (and so they do not get rendered anyway).
@375gnu 375gnu added this to Done in Release 1.7.0 Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Release 1.7.0
  
Done
Development

No branches or pull requests

2 participants