@@ -1645,6 +1645,8 @@ static void renderSphereUnlit(const RenderInfo& ri,
16451645 shadprop.texUsage |= TexUsage::OverlayTexture;
16461646 textures.push_back (ri.overlayTex );
16471647 }
1648+ if (ri.isStar )
1649+ shadprop.lightModel = ShaderProperties::StarModel;
16481650
16491651 // Get a shader for the current rendering configuration
16501652 auto * prog = r->getShaderManager ().getShader (shadprop);
@@ -1656,6 +1658,8 @@ static void renderSphereUnlit(const RenderInfo& ri,
16561658 prog->textureOffset = 0 .0f ;
16571659 prog->ambientColor = ri.color .toVector3 ();
16581660 prog->opacity = 1 .0f ;
1661+ if (ri.isStar )
1662+ prog->eyePosition = ri.eyePos_obj ;
16591663
16601664 Renderer::PipelineState ps;
16611665 ps.depthMask = true ;
@@ -2206,6 +2210,7 @@ void Renderer::renderObject(const Vector3f& pos,
22062210 }
22072211 else
22082212 {
2213+ ri.isStar = obj.isStar ;
22092214 renderSphereUnlit (ri, viewFrustum, planetMVP, this );
22102215 }
22112216 }
@@ -2832,30 +2837,13 @@ void Renderer::renderStar(const Star& star,
28322837 surface.appearanceFlags |= Surface::ApplyBaseTexture;
28332838 surface.appearanceFlags |= Surface::Emissive;
28342839
2840+ rp.isStar = true ;
28352841 rp.surface = &surface;
28362842 rp.rings = nullptr ;
28372843 rp.radius = star.getRadius ();
28382844 rp.semiAxes = star.getEllipsoidSemiAxes ();
28392845 rp.geometry = star.getGeometry ();
2840-
2841- Atmosphere atmosphere;
2842-
2843- // Use atmosphere effect to give stars a fuzzy fringe
2844- if (star.hasCorona () && rp.geometry == InvalidResource)
2845- {
2846- Color atmColor (color.red () * 0 .5f , color.green () * 0 .5f , color.blue () * 0 .5f );
2847- atmosphere.height = radius * CoronaHeight;
2848- atmosphere.lowerColor = atmColor;
2849- atmosphere.upperColor = atmColor;
2850- atmosphere.skyColor = atmColor;
2851-
2852- rp.atmosphere = &atmosphere;
2853- }
2854- else
2855- {
2856- rp.atmosphere = nullptr ;
2857- }
2858-
2846+ rp.atmosphere = nullptr ;
28592847 rp.orientation = star.getRotationModel ()->orientationAtTime (observer.getTime ()).cast <float >();
28602848
28612849 renderObject (pos, distance, observer,
0 commit comments