Skip to content

Commit

Permalink
Shaders: Remove unused water surface shader
Browse files Browse the repository at this point in the history
Also remove hardcoded MTGame node.

The 'water surface shader' was duplicated shader code in preparation for
intended new water surface shaders. For development purposes the MTGame node
'default:water_source' had it's top tile assigned to 'water surface shader'.
Due to shader duplication this commit does not cause any change to shader
behaviour.
  • Loading branch information
paramat committed May 8, 2017
1 parent c1b3ed4 commit 3342dcc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 323 deletions.
176 changes: 0 additions & 176 deletions client/shaders/water_surface_shader/opengl_fragment.glsl

This file was deleted.

137 changes: 0 additions & 137 deletions client/shaders/water_surface_shader/opengl_vertex.glsl

This file was deleted.

11 changes: 1 addition & 10 deletions src/nodedef.cpp
Expand Up @@ -670,7 +670,6 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
}

bool is_liquid = false;
bool is_water_surface = false;

u8 material_type = (alpha == 255) ?
TILE_MATERIAL_BASIC : TILE_MATERIAL_ALPHA;
Expand Down Expand Up @@ -760,12 +759,9 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
break;
}

if (is_liquid) {
if (is_liquid)
material_type = (alpha == 255) ?
TILE_MATERIAL_LIQUID_OPAQUE : TILE_MATERIAL_LIQUID_TRANSPARENT;
if (name == "default:water_source")
is_water_surface = true;
}

// Vertex alpha is no longer supported, correct if necessary.
correctAlpha();
Expand All @@ -776,11 +772,6 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
material_type, drawtype);
}

if (is_water_surface) {
tile_shader[0] = shdsrc->getShader("water_surface_shader",
material_type, drawtype);
}

// Tiles (fill in f->tiles[])
for (u16 j = 0; j < 6; j++) {
fillTileAttribs(tsrc, &tiles[j].layers[0], &tdef[j], tile_shader[j],
Expand Down

0 comments on commit 3342dcc

Please sign in to comment.