summaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
authornumzero <numzer0@yandex.ru>2020-11-22 18:25:41 +0300
committerlhofhansl <larsh@apache.org>2020-11-26 12:49:10 -0800
commitcdcf7dca7c9afb329d49f2016964f77ac379ed67 (patch)
treee4ca73d6130a55ce1445ef7da373fb7e830b1e98 /src/client/game.cpp
parentbe59668f4743bb3bf85b37a188ffc1759601c152 (diff)
downloadminetest-cdcf7dca7c9afb329d49f2016964f77ac379ed67.tar.gz
minetest-cdcf7dca7c9afb329d49f2016964f77ac379ed67.tar.bz2
minetest-cdcf7dca7c9afb329d49f2016964f77ac379ed67.zip
Sky: support GLES2
IrrLicht built-in shader is broken, have to write my own
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index b7bb0a330..2001f0487 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -424,6 +424,7 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
CachedVertexShaderSetting<float> m_animation_timer_vertex;
CachedPixelShaderSetting<float> m_animation_timer_pixel;
CachedPixelShaderSetting<float, 3> m_day_light;
+ CachedPixelShaderSetting<float, 4> m_star_color;
CachedPixelShaderSetting<float, 3> m_eye_position_pixel;
CachedVertexShaderSetting<float, 3> m_eye_position_vertex;
CachedPixelShaderSetting<float, 3> m_minimap_yaw;
@@ -456,6 +457,7 @@ public:
m_animation_timer_vertex("animationTimer"),
m_animation_timer_pixel("animationTimer"),
m_day_light("dayLight"),
+ m_star_color("starColor"),
m_eye_position_pixel("eyePosition"),
m_eye_position_vertex("eyePosition"),
m_minimap_yaw("yawVec"),
@@ -507,6 +509,10 @@ public:
sunlight.b };
m_day_light.set(dnc, services);
+ video::SColorf star_color = m_sky->getCurrentStarColor();
+ float clr[4] = {star_color.r, star_color.g, star_color.b, star_color.a};
+ m_star_color.set(clr, services);
+
u32 animation_timer = porting::getTimeMs() % 1000000;
float animation_timer_f = (float)animation_timer / 100000.f;
m_animation_timer_vertex.set(&animation_timer_f, services);
@@ -1363,7 +1369,7 @@ bool Game::createClient(const GameStartData &start_data)
/* Skybox
*/
- sky = new Sky(-1, texture_src);
+ sky = new Sky(-1, texture_src, shader_src);
scsf->setSky(sky);
skybox = NULL; // This is used/set later on in the main run loop