Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiled renderer improvements and fixes #1333

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/engine/renderer/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void UpdateSurfaceDataLightMapping( uint32_t* materials, Material& material, dra

// bind u_LightTiles
if ( r_realtimeLightingRenderer.Get() == Util::ordinal( realtimeLightingRenderer_t::TILED ) ) {
gl_lightMappingShaderMaterial->SetUniform_LightTilesIntBindless(
gl_lightMappingShaderMaterial->SetUniform_LightTilesBindless(
GL_BindToTMU( BIND_LIGHTTILES, tr.lighttileRenderImage )
);
}
Expand Down
8 changes: 2 additions & 6 deletions src/engine/renderer/gl_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2098,8 +2098,6 @@ GLShader_lightMapping::GLShader_lightMapping( GLShaderManager *manager ) :
u_LightGrid1( this ),
u_LightGrid2( this ),
u_LightTiles( this ),
u_LightTilesInt( this ),
u_LightsTexture( this ),
u_TextureMatrix( this ),
u_SpecularExponent( this ),
u_ColorModulate( this ),
Expand Down Expand Up @@ -2147,7 +2145,6 @@ void GLShader_lightMapping::SetShaderProgramUniforms( shaderProgram_t *shaderPro
glUniform1i( glGetUniformLocation( shaderProgram->program, "u_EnvironmentMap0" ), BIND_ENVIRONMENTMAP0 );
glUniform1i( glGetUniformLocation( shaderProgram->program, "u_EnvironmentMap1" ), BIND_ENVIRONMENTMAP1 );
glUniform1i( glGetUniformLocation( shaderProgram->program, "u_LightTiles" ), BIND_LIGHTTILES );
glUniform1i( glGetUniformLocation( shaderProgram->program, "u_LightTilesInt" ), BIND_LIGHTTILES );
if( !glConfig2.uniformBufferObjectAvailable ) {
glUniform1i( glGetUniformLocation( shaderProgram->program, "u_Lights" ), BIND_LIGHTS );
}
Expand All @@ -2167,7 +2164,7 @@ GLShader_lightMappingMaterial::GLShader_lightMappingMaterial( GLShaderManager* m
u_EnvironmentMap1( this ),
u_LightGrid1( this ),
u_LightGrid2( this ),
u_LightTilesInt( this ),
u_LightTiles( this ),
u_TextureMatrix( this ),
u_SpecularExponent( this ),
u_ColorModulate( this ),
Expand Down Expand Up @@ -2829,7 +2826,7 @@ GLShader_liquidMaterial::GLShader_liquidMaterial( GLShaderManager* manager ) :
u_NormalScale( this ),
u_FogDensity( this ),
u_FogColor( this ),
u_LightTilesInt( this ),
u_LightTiles( this ),
u_SpecularExponent( this ),
u_LightGridOrigin( this ),
u_LightGridScale( this ),
Expand Down Expand Up @@ -2906,7 +2903,6 @@ GLShader_lighttile::GLShader_lighttile( GLShaderManager *manager ) :
GLShader( "lighttile", ATTR_POSITION | ATTR_TEXCOORD, manager ),
u_DepthMap( this ),
u_Lights( this ),
u_LightsTexture( this ),
u_numLights( this ),
u_lightLayer( this ),
u_ModelMatrix( this ),
Expand Down
39 changes: 2 additions & 37 deletions src/engine/renderer/gl_shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2413,22 +2413,6 @@ class u_CloudMap :
}
};

class u_LightsTexture :
GLUniformSampler2D {
public:
u_LightsTexture( GLShader* shader ) :
GLUniformSampler2D( shader, "u_LightsTexture" ) {
}

void SetUniform_LightsTextureBindless( GLuint64 bindlessHandle ) {
this->SetValueBindless( bindlessHandle );
}

GLint GetUniformLocation_LightsTexture() {
return this->GetLocation();
}
};

class u_LightTiles :
GLUniformSampler3D {
public:
Expand All @@ -2445,22 +2429,6 @@ class u_LightTiles :
}
};

class u_LightTilesInt :
GLUniformUSampler3D {
public:
u_LightTilesInt( GLShader* shader ) :
GLUniformUSampler3D( shader, "u_LightTilesInt" ) {
}

void SetUniform_LightTilesIntBindless( GLuint64 bindlessHandle ) {
this->SetValueBindless( bindlessHandle );
}

GLint GetUniformLocation_LightTilesInt() {
return this->GetLocation();
}
};

class u_LightGrid1 :
GLUniformSampler3D {
public:
Expand Down Expand Up @@ -3997,8 +3965,6 @@ class GLShader_lightMapping :
public u_LightGrid1,
public u_LightGrid2,
public u_LightTiles,
public u_LightTilesInt,
public u_LightsTexture,
public u_TextureMatrix,
public u_SpecularExponent,
public u_ColorModulate,
Expand Down Expand Up @@ -4048,7 +4014,7 @@ class GLShader_lightMappingMaterial :
public u_EnvironmentMap1,
public u_LightGrid1,
public u_LightGrid2,
public u_LightTilesInt,
public u_LightTiles,
public u_TextureMatrix,
public u_SpecularExponent,
public u_ColorModulate,
Expand Down Expand Up @@ -4602,7 +4568,7 @@ class GLShader_liquidMaterial :
public u_NormalScale,
public u_FogDensity,
public u_FogColor,
public u_LightTilesInt,
public u_LightTiles,
public u_SpecularExponent,
public u_LightGridOrigin,
public u_LightGridScale,
Expand Down Expand Up @@ -4662,7 +4628,6 @@ class GLShader_lighttile :
public GLShader,
public u_DepthMap,
public u_Lights,
public u_LightsTexture,
public u_numLights,
public u_lightLayer,
public u_ModelMatrix,
Expand Down
Loading