MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / ScatterSky

Method ScatterSky

Engine/source/environment/scatterSky.cpp:86–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84const F32 ScatterSky::smViewerHeight = 1.0f;
85
86ScatterSky::ScatterSky()
87{
88 mPrimCount = 0;
89 mVertCount = 0;
90
91
92 // Rayleigh scattering constant.
93 mRayleighScattering = 0.0035f;
94 mRayleighScattering4PI = mRayleighScattering * 4.0f * M_PI_F;
95
96 // Mie scattering constant.
97 mMieScattering = 0.0045f;
98 mMieScattering4PI = mMieScattering * 4.0f * M_PI_F;
99
100 // Overall scatter scalar.
101 mSkyBrightness = 25.0f;
102
103 // The Mie phase asymmetry factor.
104 mMiePhaseAssymetry = -0.75f;
105
106 mSphereInnerRadius = 1.0f;
107 mSphereOuterRadius = 1.0f * 1.025f;
108 mScale = 1.0f / (mSphereOuterRadius - mSphereInnerRadius);
109
110 // 650 nm for red
111 // 570 nm for green
112 // 475 nm for blue
113 mWavelength.set( 0.650f, 0.570f, 0.475f, 0 );
114
115 mWavelength4[0] = mPow(mWavelength[0], 4.0f);
116 mWavelength4[1] = mPow(mWavelength[1], 4.0f);
117 mWavelength4[2] = mPow(mWavelength[2], 4.0f);
118
119 mRayleighScaleDepth = 0.25f;
120 mMieScaleDepth = 0.1f;
121
122 mAmbientColor.set( 0, 0, 0, 1.0f );
123 mAmbientScale.set( 1.0f, 1.0f, 1.0f, 1.0f );
124
125 mSunColor.set( 0, 0, 0, 1.0f );
126 mSunScale = LinearColorF::WHITE;
127
128 mFogColor.set( 0, 0, 0, 1.0f );
129 mFogScale = LinearColorF::WHITE;
130
131 mExposure = 1.0f;
132 mNightInterpolant = 0;
133 mZOffset = 0.0f;
134
135 mShader = NULL;
136
137 mTimeOfDay = 0;
138
139 mSunAzimuth = 0.0f;
140 mSunElevation = 35.0f;
141
142 mMoonAzimuth = 0.0f;
143 mMoonElevation = 45.0f;

Callers

nothing calls this directly

Calls 9

mPowFunction · 0.85
getVectorFromAnglesFunction · 0.85
constructInPlaceFunction · 0.85
EmptyStringMethod · 0.80
dMalloc_alignedFunction · 0.50
setMethod · 0.45
setTypeMethod · 0.45
clearMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected