Skip to content

Commit 41b9750

Browse files
committed
Fix inconsequential texture binding mistakes
Mistakes with texture binding that didn't break anything: - Heat haze doesn't really use height map - 2 shaders used the wrong uniform name when attempting to assign a texture uniform to unit 0, but unit 0 is the default so it didn't matter.
1 parent e9a64d4 commit 41b9750

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/engine/renderer/gl_shader.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,7 @@ GLShader_reflection::GLShader_reflection():
25642564

25652565
void GLShader_reflection::SetShaderProgramUniforms( ShaderProgramDescriptor *shaderProgram )
25662566
{
2567-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_ColorMap" ), 0 );
2567+
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_ColorMapCube" ), 0 );
25682568
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_NormalMap" ), 1 );
25692569
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_HeightMap" ), 15 );
25702570
}
@@ -2694,7 +2694,6 @@ GLShader_heatHaze::GLShader_heatHaze() :
26942694
false, "heatHaze", "heatHaze" ),
26952695
u_CurrentMap( this ),
26962696
u_NormalMap( this ),
2697-
u_HeightMap( this ),
26982697
u_TextureMatrix( this ),
26992698
u_DeformMagnitude( this ),
27002699
u_ModelViewProjectionMatrix( this ),
@@ -2713,15 +2712,13 @@ void GLShader_heatHaze::SetShaderProgramUniforms( ShaderProgramDescriptor *shade
27132712
{
27142713
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_NormalMap" ), 0 );
27152714
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_CurrentMap" ), 1 );
2716-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_HeightMap" ), 15 );
27172715
}
27182716

27192717
GLShader_heatHazeMaterial::GLShader_heatHazeMaterial() :
27202718
GLShader( "heatHazeMaterial", ATTR_POSITION | ATTR_TEXCOORD | ATTR_QTANGENT,
27212719
true, "heatHaze", "heatHaze" ),
27222720
u_CurrentMap( this ),
27232721
u_NormalMap( this ),
2724-
u_HeightMap( this ),
27252722
u_TextureMatrix( this ),
27262723
u_DeformEnable( this ),
27272724
u_DeformMagnitude( this ),
@@ -2736,7 +2733,6 @@ GLShader_heatHazeMaterial::GLShader_heatHazeMaterial() :
27362733
void GLShader_heatHazeMaterial::SetShaderProgramUniforms( ShaderProgramDescriptor* shaderProgram ) {
27372734
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_NormalMap" ), 0 );
27382735
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_CurrentMap" ), 1 );
2739-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_HeightMap" ), 15 );
27402736
}
27412737

27422738
GLShader_screen::GLShader_screen() :
@@ -2965,7 +2961,7 @@ GLShader_depthtile2::GLShader_depthtile2() :
29652961

29662962
void GLShader_depthtile2::SetShaderProgramUniforms( ShaderProgramDescriptor *shaderProgram )
29672963
{
2968-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_DepthMap" ), 0 );
2964+
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_DepthTile1" ), 0 );
29692965
}
29702966

29712967
GLShader_lighttile::GLShader_lighttile() :

src/engine/renderer/gl_shader.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3510,7 +3510,6 @@ class GLShader_heatHaze :
35103510
public GLShader,
35113511
public u_CurrentMap,
35123512
public u_NormalMap,
3513-
public u_HeightMap,
35143513
public u_TextureMatrix,
35153514
public u_DeformMagnitude,
35163515
public u_ModelViewProjectionMatrix,
@@ -3532,7 +3531,6 @@ class GLShader_heatHazeMaterial :
35323531
public GLShader,
35333532
public u_CurrentMap,
35343533
public u_NormalMap,
3535-
public u_HeightMap,
35363534
public u_TextureMatrix,
35373535
public u_DeformEnable,
35383536
public u_DeformMagnitude,

0 commit comments

Comments
 (0)