Skip to content

Commit

Permalink
Normalize point source color
Browse files Browse the repository at this point in the history
  • Loading branch information
JiliTheSpaceboy committed Dec 23, 2023
1 parent 61c75a1 commit 1441fd2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/celengine/render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2968,12 +2968,15 @@ void Renderer::renderPlanet(Body& body,

if (body.isVisibleAsPoint())
{
renderObjectAsPoint(pos,
body.getRadius(),
appMag,
discSizeInPixels,
body.getSurface().color,
false, false, m);
if (float maxCoeff = body.getSurface().color.toVector3().maxCoeff(); maxCoeff > 0.0f) // ignore [ 0 0 0 ]; used by old addons to make objects not get rendered as point
{
renderObjectAsPoint(pos,
body.getRadius(),
appMag,
discSizeInPixels,
body.getSurface().color * (1.0f / maxCoeff), // normalize point color; 'darkness' is handled by size of point determined by GeomAlbedo.
false, false, m);
}
}
}

Expand Down

0 comments on commit 1441fd2

Please sign in to comment.