Skip to content

Commit 7cb5379

Browse files
authoredMay 9, 2020
Color gradient for default and 'regular' type sky (#9502)
* add regular sky gradient * add regular sky gradient * Update sky.cpp * change default day sky colors
1 parent b624249 commit 7cb5379

File tree

2 files changed

+6
-31
lines changed

2 files changed

+6
-31
lines changed
 

‎src/client/sky.cpp

+4-29
Original file line numberDiff line numberDiff line change
@@ -252,35 +252,10 @@ void Sky::render()
252252
if (m_visible) {
253253
driver->setMaterial(m_materials[1]);
254254
for (u32 j = 0; j < 4; j++) {
255-
video::SColor c = cloudyfogcolor.getInterpolated(m_skycolor, 0.45);
256-
vertices[0] = video::S3DVertex(-1, 0.08, -1, 0, 0, 1, c, t, t);
257-
vertices[1] = video::S3DVertex( 1, 0.08, -1, 0, 0, 1, c, o, t);
258-
vertices[2] = video::S3DVertex( 1, 0.12, -1, 0, 0, 1, c, o, o);
259-
vertices[3] = video::S3DVertex(-1, 0.12, -1, 0, 0, 1, c, t, o);
260-
for (video::S3DVertex &vertex : vertices) {
261-
if (j == 0)
262-
// Don't switch
263-
{}
264-
else if (j == 1)
265-
// Switch from -Z (south) to +X (east)
266-
vertex.Pos.rotateXZBy(90);
267-
else if (j == 2)
268-
// Switch from -Z (south) to -X (west)
269-
vertex.Pos.rotateXZBy(-90);
270-
else
271-
// Switch from -Z (south) to +Z (north)
272-
vertex.Pos.rotateXZBy(-180);
273-
}
274-
driver->drawIndexedTriangleFan(&vertices[0], 4, indices, 2);
275-
}
276-
277-
// Draw far cloudy fog thing at and below all horizons
278-
for (u32 j = 0; j < 4; j++) {
279-
video::SColor c = cloudyfogcolor;
280-
vertices[0] = video::S3DVertex(-1, -1.0, -1, 0, 0, 1, c, t, t);
281-
vertices[1] = video::S3DVertex( 1, -1.0, -1, 0, 0, 1, c, o, t);
282-
vertices[2] = video::S3DVertex( 1, 0.08, -1, 0, 0, 1, c, o, o);
283-
vertices[3] = video::S3DVertex(-1, 0.08, -1, 0, 0, 1, c, t, o);
255+
vertices[0] = video::S3DVertex(-1, -0.02, -1, 0, 0, 1, m_bgcolor, t, t);
256+
vertices[1] = video::S3DVertex( 1, -0.02, -1, 0, 0, 1, m_bgcolor, o, t);
257+
vertices[2] = video::S3DVertex( 1, 0.45, -1, 0, 0, 1, m_skycolor, o, o);
258+
vertices[3] = video::S3DVertex(-1, 0.45, -1, 0, 0, 1, m_skycolor, t, o);
284259
for (video::S3DVertex &vertex : vertices) {
285260
if (j == 0)
286261
// Don't switch

‎src/skyparams.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ class SkyboxDefaults
7676
{
7777
SkyColor sky;
7878
// Horizon colors
79-
sky.day_horizon = video::SColor(255, 155, 193, 240);
79+
sky.day_horizon = video::SColor(255, 144, 211, 246);
8080
sky.indoors = video::SColor(255, 100, 100, 100);
8181
sky.dawn_horizon = video::SColor(255, 186, 193, 240);
8282
sky.night_horizon = video::SColor(255, 64, 144, 255);
8383
// Sky colors
84-
sky.day_sky = video::SColor(255, 140, 186, 250);
84+
sky.day_sky = video::SColor(255, 97, 181, 245);
8585
sky.dawn_sky = video::SColor(255, 180, 186, 250);
8686
sky.night_sky = video::SColor(255, 0, 107, 255);
8787
return sky;

0 commit comments

Comments
 (0)
Please sign in to comment.