diff options
author | numzero <numzer0@yandex.ru> | 2020-11-22 18:25:41 +0300 |
---|---|---|
committer | lhofhansl <larsh@apache.org> | 2020-11-26 12:49:10 -0800 |
commit | cdcf7dca7c9afb329d49f2016964f77ac379ed67 (patch) | |
tree | e4ca73d6130a55ce1445ef7da373fb7e830b1e98 /src/client/game.cpp | |
parent | be59668f4743bb3bf85b37a188ffc1759601c152 (diff) | |
download | hax-minetest-server-cdcf7dca7c9afb329d49f2016964f77ac379ed67.tar.gz hax-minetest-server-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.cpp | 8 |
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 |