diff options
author | numzero <numzer0@yandex.ru> | 2020-11-22 19:49:38 +0300 |
---|---|---|
committer | lhofhansl <larsh@apache.org> | 2020-11-26 12:49:10 -0800 |
commit | c158e20e5beab1037c905fe96b2a56baccddaec7 (patch) | |
tree | ccee6962c6683df0c46fc528299d9b6893e83cdd | |
parent | cdcf7dca7c9afb329d49f2016964f77ac379ed67 (diff) | |
download | minetest-c158e20e5beab1037c905fe96b2a56baccddaec7.tar.gz minetest-c158e20e5beab1037c905fe96b2a56baccddaec7.tar.bz2 minetest-c158e20e5beab1037c905fe96b2a56baccddaec7.zip |
Provide fallback star color for GLES 2 with MT shaders disabled
-rw-r--r-- | src/client/sky.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/sky.cpp b/src/client/sky.cpp index 3fc5a95b4..0fccf067c 100644 --- a/src/client/sky.cpp +++ b/src/client/sky.cpp @@ -849,6 +849,7 @@ void Sky::updateStars() { m_stars->Vertices.reallocate(4 * m_star_params.count); m_stars->Indices.reallocate(6 * m_star_params.count); + video::SColor fallback_color = m_star_params.starcolor; // used on GLES 2 “without shaders” PcgRandom rgen(m_seed); float d = (0.006 / 2) * m_star_params.scale; for (u16 i = 0; i < m_star_params.count; i++) { @@ -867,10 +868,10 @@ void Sky::updateStars() { a.rotateVect(p1); a.rotateVect(p2); a.rotateVect(p3); - m_stars->Vertices.push_back(video::S3DVertex(p, {}, {}, {})); - m_stars->Vertices.push_back(video::S3DVertex(p1, {}, {}, {})); - m_stars->Vertices.push_back(video::S3DVertex(p2, {}, {}, {})); - m_stars->Vertices.push_back(video::S3DVertex(p3, {}, {}, {})); + m_stars->Vertices.push_back(video::S3DVertex(p, {}, fallback_color, {})); + m_stars->Vertices.push_back(video::S3DVertex(p1, {}, fallback_color, {})); + m_stars->Vertices.push_back(video::S3DVertex(p2, {}, fallback_color, {})); + m_stars->Vertices.push_back(video::S3DVertex(p3, {}, fallback_color, {})); } for (u16 i = 0; i < m_star_params.count; i++) { m_stars->Indices.push_back(i * 4 + 0); |