Don't render corona for T5-T9 and Y class stars

pull/715/head
Hleb Valoshka 2018-11-11 21:44:53 +03:00
parent 5d23a9e208
commit cd8426ebc9
2 changed files with 25 additions and 7 deletions

View File

@ -8123,15 +8123,18 @@ void Renderer::renderStar(const Star& star,
#ifndef USE_HDR
Atmosphere atmosphere;
Color atmColor(color.red() * 0.5f, color.green() * 0.5f, color.blue() * 0.5f);
atmosphere.height = radius * CoronaHeight;
atmosphere.lowerColor = atmColor;
atmosphere.upperColor = atmColor;
atmosphere.skyColor = atmColor;
// Use atmosphere effect to give stars a fuzzy fringe
if (rp.geometry == InvalidResource)
if (star.hasCorona() && rp.geometry == InvalidResource)
{
Color atmColor(color.red() * 0.5f, color.green() * 0.5f, color.blue() * 0.5f);
atmosphere.height = radius * CoronaHeight;
atmosphere.lowerColor = atmColor;
atmosphere.upperColor = atmColor;
atmosphere.skyColor = atmColor;
rp.atmosphere = &atmosphere;
}
else
#endif
rp.atmosphere = NULL;

View File

@ -69,7 +69,8 @@ class StarDetails
void setInfoURL(const std::string& _infoURL);
bool shared() const;
inline bool hasCorona() const;
enum
{
KnowRadius = 0x1,
@ -223,6 +224,13 @@ StarDetails::getEllipsoidSemiAxes() const
return semiAxes;
}
bool
StarDetails::hasCorona() const
{
// Y dwarves and T dwarves subclasses 5-9 don't have a corona
return spectralType[0] != 'Y' && (spectralType[0] != 'T' || spectralType[1] < '5');
}
class Star
@ -275,6 +283,7 @@ public:
inline const RotationModel* getRotationModel() const;
inline Vec3f getEllipsoidSemiAxes() const;
const std::string& getInfoURL() const;
inline bool hasCorona() const;
enum {
MaxTychoCatalogNumber = 0xf0000000,
@ -380,4 +389,10 @@ Star::getOrbitingStars() const
return details->orbitingStars;
}
bool
Star::hasCorona() const
{
return details->hasCorona();
}
#endif // _STAR_H_