1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Fix texture matrix handling in our shaders

This commit is contained in:
sfan5 2024-09-06 10:32:05 +02:00
parent 9e5d6bc162
commit e90ef85e7d
3 changed files with 9 additions and 5 deletions

View file

@ -249,7 +249,7 @@ public:
m_world_view_proj.set(worldViewProj, services);
if (driver->getDriverType() == video::EDT_OGLES2 || driver->getDriverType() == video::EDT_OPENGL3) {
core::matrix4 texture = driver->getTransform(video::ETS_TEXTURE_0);
auto &texture = driver->getTransform(video::ETS_TEXTURE_0);
m_world_view.set(worldView, services);
m_texture.set(texture, services);
}
@ -573,6 +573,7 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
} else {
shaders_header << "#version 100\n";
}
// cf. EVertexAttributes.h for the predefined ones
vertex_header = R"(
precision mediump float;
@ -582,7 +583,7 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
attribute highp vec4 inVertexPosition;
attribute lowp vec4 inVertexColor;
attribute mediump vec4 inTexCoord0;
attribute mediump vec2 inTexCoord0;
attribute mediump vec3 inVertexNormal;
attribute mediump vec4 inVertexTangent;
attribute mediump vec4 inVertexBinormal;