Skip to content

Commit

Permalink
Remove unused shader matrices. (#4723)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhofhansl authored and est31 committed Nov 4, 2016
1 parent dde66a8 commit 6bb4347
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 24 deletions.
2 changes: 0 additions & 2 deletions client/shaders/minimap_shader/opengl_vertex.glsl
@@ -1,6 +1,4 @@
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform mat4 mWorld;

void main(void)
Expand Down
2 changes: 0 additions & 2 deletions client/shaders/nodes_shader/opengl_vertex.glsl
@@ -1,6 +1,4 @@
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform mat4 mWorld;

uniform float dayNightRatio;
Expand Down
2 changes: 0 additions & 2 deletions client/shaders/water_surface_shader/opengl_vertex.glsl
@@ -1,6 +1,4 @@
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform mat4 mWorld;

uniform float dayNightRatio;
Expand Down
2 changes: 0 additions & 2 deletions client/shaders/wielded_shader/opengl_vertex.glsl
@@ -1,6 +1,4 @@
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform mat4 mWorld;

uniform float dayNightRatio;
Expand Down
16 changes: 0 additions & 16 deletions src/shader.cpp
Expand Up @@ -219,14 +219,6 @@ class MainShaderConstantSetter : public IShaderConstantSetter
video::IVideoDriver *driver = services->getVideoDriver();
sanity_check(driver);

// set inverted world matrix
core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD);
invWorld.makeInverse();
if(is_highlevel)
services->setVertexShaderConstant("mInvWorld", invWorld.pointer(), 16);
else
services->setVertexShaderConstant(invWorld.pointer(), 0, 4);

// set clip matrix
core::matrix4 worldViewProj;
worldViewProj = driver->getTransform(video::ETS_PROJECTION);
Expand All @@ -237,14 +229,6 @@ class MainShaderConstantSetter : public IShaderConstantSetter
else
services->setVertexShaderConstant(worldViewProj.pointer(), 4, 4);

// set transposed world matrix
core::matrix4 transWorld = driver->getTransform(video::ETS_WORLD);
transWorld = transWorld.getTransposed();
if(is_highlevel)
services->setVertexShaderConstant("mTransWorld", transWorld.pointer(), 16);
else
services->setVertexShaderConstant(transWorld.pointer(), 8, 4);

// set world matrix
core::matrix4 world = driver->getTransform(video::ETS_WORLD);
if(is_highlevel)
Expand Down

0 comments on commit 6bb4347

Please sign in to comment.