Allow to disable and enable planet rings (Closes: #47)
parent
2e654e451b
commit
e40b9549a7
|
@ -0,0 +1,3 @@
|
|||
celestia:hide("planetrings")
|
||||
wait(5)
|
||||
celestia:show("planetrings")
|
|
@ -4817,7 +4817,9 @@ void Renderer::renderObject(const Vector3f& pos,
|
|||
}
|
||||
}
|
||||
|
||||
if (obj.rings != nullptr && distance <= obj.rings->innerRadius)
|
||||
if (obj.rings != nullptr &&
|
||||
(renderFlags & ShowPlanetRings) != 0 &&
|
||||
distance <= obj.rings->innerRadius)
|
||||
{
|
||||
renderRings_GLSL(*obj.rings, ri, ls,
|
||||
radius, 1.0f - obj.semiAxes.y(),
|
||||
|
@ -4971,7 +4973,7 @@ void Renderer::renderObject(const Vector3f& pos,
|
|||
}
|
||||
}
|
||||
|
||||
if (obj.rings != nullptr)
|
||||
if (obj.rings != nullptr && (renderFlags & ShowPlanetRings) != 0)
|
||||
{
|
||||
if ((obj.surface->appearanceFlags & Surface::Emissive) == 0 &&
|
||||
(renderFlags & ShowRingShadows) != 0)
|
||||
|
@ -5242,7 +5244,9 @@ void Renderer::renderPlanet(Body& body,
|
|||
|
||||
|
||||
// Add ring shadow records for each light
|
||||
if (body.getRings() && (renderFlags & ShowRingShadows) != 0)
|
||||
if (body.getRings() &&
|
||||
(renderFlags & ShowPlanetRings) != 0 &&
|
||||
(renderFlags & ShowRingShadows) != 0)
|
||||
{
|
||||
for (unsigned int li = 0; li < lights.nLights; li++)
|
||||
{
|
||||
|
|
|
@ -156,7 +156,7 @@ class Renderer
|
|||
ShowAtmospheres = 0x0100,
|
||||
ShowSmoothLines = 0x0200,
|
||||
ShowEclipseShadows = 0x0400,
|
||||
ShowStarsAsPoints = 0x0800,
|
||||
ShowPlanetRings = 0x0800,
|
||||
ShowRingShadows = 0x1000,
|
||||
ShowBoundaries = 0x2000,
|
||||
ShowAutoMag = 0x4000,
|
||||
|
@ -190,6 +190,7 @@ class Renderer
|
|||
Renderer::ShowCloudMaps |
|
||||
Renderer::ShowAtmospheres |
|
||||
Renderer::ShowEclipseShadows |
|
||||
Renderer::ShowPlanetRings |
|
||||
Renderer::ShowRingShadows |
|
||||
Renderer::ShowCometTails |
|
||||
Renderer::ShowNebulae |
|
||||
|
|
|
@ -119,6 +119,7 @@ void CelxLua::initRenderFlagMap()
|
|||
RenderFlagMap["stars"] = Renderer::ShowStars;
|
||||
RenderFlagMap["nightmaps"] = Renderer::ShowNightMaps;
|
||||
RenderFlagMap["eclipseshadows"] = Renderer::ShowEclipseShadows;
|
||||
RenderFlagMap["planetrings"] = Renderer::ShowPlanetRings;
|
||||
RenderFlagMap["ringshadows"] = Renderer::ShowRingShadows;
|
||||
RenderFlagMap["comettails"] = Renderer::ShowCometTails;
|
||||
RenderFlagMap["boundaries"] = Renderer::ShowBoundaries;
|
||||
|
|
|
@ -1310,7 +1310,6 @@ void resyncRenderActions(AppData* app)
|
|||
case Renderer::ShowAtmospheres: actionName = "RenderAtmospheres"; break;
|
||||
case Renderer::ShowSmoothLines: actionName = "RenderAA"; break;
|
||||
case Renderer::ShowEclipseShadows: actionName = "RenderEclipseShadows"; break;
|
||||
case Renderer::ShowStarsAsPoints: actionName = NULL; break; /* Deprecated */
|
||||
case Renderer::ShowRingShadows: actionName = "RenderRingShadows"; break;
|
||||
case Renderer::ShowBoundaries: actionName = "RenderConstellationBoundaries"; break;
|
||||
case Renderer::ShowAutoMag: actionName = "RenderAutoMagnitude"; break;
|
||||
|
|
|
@ -280,6 +280,7 @@ void setDefaultRenderFlags(AppData* app)
|
|||
Renderer::ShowPlanets |
|
||||
Renderer::ShowSmoothLines |
|
||||
Renderer::ShowCometTails |
|
||||
Renderer::ShowPlanetRings |
|
||||
Renderer::ShowRingShadows |
|
||||
Renderer::ShowCloudMaps |
|
||||
Renderer::ShowRingShadows |
|
||||
|
|
|
@ -53,6 +53,7 @@ const int DEFAULT_RENDER_FLAGS =
|
|||
Renderer::ShowCloudMaps |
|
||||
Renderer::ShowAtmospheres |
|
||||
Renderer::ShowEclipseShadows |
|
||||
Renderer::ShowPlanetRings |
|
||||
Renderer::ShowRingShadows |
|
||||
Renderer::ShowCometTails |
|
||||
Renderer::ShowNebulae |
|
||||
|
|
Loading…
Reference in New Issue