diff options
author | sfan5 <sfan5@live.de> | 2021-04-18 16:07:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-18 16:07:13 +0200 |
commit | 0077982fb78a8ed39a90da03c0898d12583fed64 (patch) | |
tree | 559c7a8c570aa517f191c07ccf327b3afde2119d /src/client/shader.cpp | |
parent | 623f0a8613bd8677e259366a1d540deedb9d2302 (diff) | |
download | minetest-0077982fb78a8ed39a90da03c0898d12583fed64.tar.gz minetest-0077982fb78a8ed39a90da03c0898d12583fed64.tar.bz2 minetest-0077982fb78a8ed39a90da03c0898d12583fed64.zip |
GLES fixes (#11205)
* Consistently set float precision for GLES
* Enable DPI scaling on Windows+GLES
Diffstat (limited to 'src/client/shader.cpp')
-rw-r--r-- | src/client/shader.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/shader.cpp b/src/client/shader.cpp index b3e4911f4..58946b90f 100644 --- a/src/client/shader.cpp +++ b/src/client/shader.cpp @@ -579,8 +579,10 @@ ShaderInfo ShaderSource::generateShader(const std::string &name, if (use_gles) { shaders_header << R"( #version 100 - )"; + )"; vertex_header = R"( + precision mediump float; + uniform highp mat4 mWorldView; uniform highp mat4 mWorldViewProj; uniform mediump mat4 mTexture; @@ -592,17 +594,17 @@ ShaderInfo ShaderSource::generateShader(const std::string &name, attribute mediump vec3 inVertexNormal; attribute mediump vec4 inVertexTangent; attribute mediump vec4 inVertexBinormal; - )"; + )"; fragment_header = R"( precision mediump float; - )"; + )"; } else { shaders_header << R"( #version 120 #define lowp #define mediump #define highp - )"; + )"; vertex_header = R"( #define mWorldView gl_ModelViewMatrix #define mWorldViewProj gl_ModelViewProjectionMatrix @@ -615,7 +617,7 @@ ShaderInfo ShaderSource::generateShader(const std::string &name, #define inVertexNormal gl_Normal #define inVertexTangent gl_MultiTexCoord1 #define inVertexBinormal gl_MultiTexCoord2 - )"; + )"; } bool use_discard = use_gles; |