@@ -147,6 +147,7 @@ VERTEX_OUTPUT VSMoon(VERTEX_INPUT In)
147
147
148
148
// This function adjusts brightness, saturation and contrast
149
149
// By Romain Dura aka Romz
150
+ // Colors edit by DR_Aeronautics
150
151
float3 ContrastSaturationBrightness (float3 color, float brt, float sat, float con)
151
152
{
152
153
// Increase or decrease theese values to adjust r, g and b color channels separately
@@ -173,10 +174,10 @@ float4 PSSky(VERTEX_OUTPUT In) : COLOR
173
174
float4 starColor = tex2D (StarMapSampler, TexCoord);
174
175
175
176
// Adjust sky color brightness for time of day
176
- skyColor *= SkyColor.x ;
177
+ skyColor *= SkyColor.y ;
177
178
178
- // Stars
179
- skyColor = lerp (starColor, skyColor, SkyColor.y);
179
+ // Stars (power function keeps stars hidden until after sunset)
180
+ skyColor = lerp (starColor, skyColor, pow ( SkyColor.y, 0.125 ) );
180
181
181
182
// Fogging
182
183
skyColor.rgb = lerp (skyColor.rgb, FogColor.rgb, saturate ((1 - In.Normal.y) * Fog.x));
@@ -189,11 +190,35 @@ float4 PSSky(VERTEX_OUTPUT In) : COLOR
189
190
// Coefficients selected by the author to achieve the desired appearance - fot limits the effect
190
191
skyColor += angleRcp * Fog.y;
191
192
192
- // increase orange at sunset - fog limits the effect
193
+ // increase orange at sunset and yellow at sunrise - fog limits the effect
193
194
if (LightVector.x < 0 )
194
195
{
195
- skyColor.r += SkyColor.z * angleRcp * Fog.z;
196
- skyColor.g += skyColor.r * Fog.w;
196
+ // These if-statements prevent the yellow-flash effect
197
+ if (LightVector.y > 0.13 )
198
+ {
199
+ skyColor.rg += SkyColor.z*2 * angleRcp * Fog.z;
200
+ skyColor.r += SkyColor.z*2 * angleRcp * Fog.z;
201
+ }
202
+
203
+ else
204
+ {
205
+ skyColor.rg += angleRcp * 0.075 * SkyColor.y;
206
+ skyColor.r += angleRcp * 0.075 * SkyColor.y;
207
+ }
208
+ }
209
+ else
210
+ {
211
+ if (LightVector.y > 0.15 )
212
+ {
213
+ skyColor.rg += SkyColor.z*3 * angleRcp * Fog.z;
214
+ skyColor.r += SkyColor.z * angleRcp * Fog.z;
215
+ }
216
+
217
+ else
218
+ {
219
+ skyColor.rg += angleRcp * 0.075 * SkyColor.y;
220
+ skyColor.r += pow (angleRcp * 0.075 * SkyColor.y,2 );
221
+ }
197
222
}
198
223
199
224
// Keep alpha opague
0 commit comments