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

Fix compile error #1411

Merged
merged 1 commit into from
Nov 3, 2024
Merged
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
26 changes: 8 additions & 18 deletions src/engine/renderer/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ void UpdateSurfaceDataGeneric3D( uint32_t* materials, Material& material, drawSu
Tess_ComputeTexMatrices( pStage );
gl_genericShaderMaterial->SetUniform_TextureMatrix( tess.svars.texMatrices[TB_COLORMAP] );

// u_DeformGen
gl_genericShaderMaterial->SetUniform_Time( backEnd.refdef.floatTime - backEnd.currentEntity->e.shaderTime );

// bind u_ColorMap
if ( pStage->type == stageType_t::ST_STYLELIGHTMAP ) {
gl_genericShaderMaterial->SetUniform_ColorMapBindless(
Expand Down Expand Up @@ -299,9 +296,6 @@ void UpdateSurfaceDataLightMapping( uint32_t* materials, Material& material, dra
bool enableGridLighting = ( lightMode == lightMode_t::GRID );
bool enableGridDeluxeMapping = ( deluxeMode == deluxeMode_t::GRID );

// u_DeformGen
gl_lightMappingShaderMaterial->SetUniform_Time( backEnd.refdef.floatTime - backEnd.currentEntity->e.shaderTime );

// u_InverseLightFactor
/* HACK: use sign to know if there is a light or not, and
then if it will receive overbright multiplication or not. */
Expand Down Expand Up @@ -643,13 +637,6 @@ void UpdateSurfaceDataFog( uint32_t* materials, Material& material, drawSurf_t*
// u_Color
gl_fogQuake3ShaderMaterial->SetUniform_Color( fog->color );

// u_VertexInterpolation
if ( material.vertexAnimation ) {
gl_fogQuake3ShaderMaterial->SetUniform_VertexInterpolation( 0.0 );
}

gl_fogQuake3ShaderMaterial->SetUniform_Time( backEnd.refdef.floatTime - backEnd.currentEntity->e.shaderTime );

gl_fogQuake3ShaderMaterial->WriteUniformsToBuffer( materials );
}

Expand Down Expand Up @@ -1043,6 +1030,9 @@ void BindShaderGeneric3D( Material* material ) {
gl_genericShaderMaterial->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
gl_genericShaderMaterial->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[glState.stackIndex] );

// u_DeformGen
gl_genericShaderMaterial->SetUniform_Time( backEnd.refdef.floatTime - backEnd.currentEntity->e.shaderTime );

if ( r_profilerRenderSubGroups.Get() ) {
gl_genericShaderMaterial->SetUniform_ProfilerZero();
gl_genericShaderMaterial->SetUniform_ProfilerRenderSubGroups( GetShaderProfilerRenderSubGroupsMode( material->stateBits ) );
Expand Down Expand Up @@ -1098,6 +1088,9 @@ void BindShaderLightMapping( Material* material ) {
gl_lightMappingShaderMaterial->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
gl_lightMappingShaderMaterial->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[glState.stackIndex] );

// u_DeformGen
gl_lightMappingShaderMaterial->SetUniform_Time( backEnd.refdef.floatTime - backEnd.currentEntity->e.shaderTime );

// TODO: Move this to a per-entity buffer
if ( glConfig2.reflectionMapping && !( tr.refdef.rdflags & RDF_NOCUBEMAP ) ) {
bool isWorldEntity = backEnd.currentEntity == &tr.worldEntity;
Expand Down Expand Up @@ -1215,9 +1208,6 @@ void BindShaderLiquid( Material* material ) {
}

void BindShaderFog( Material* material ) {
// Select shader permutation.
gl_fogQuake3ShaderMaterial->SetVertexAnimation( false );

// Bind shader program.
gl_fogQuake3ShaderMaterial->BindProgram( 0 );

Expand Down Expand Up @@ -1266,6 +1256,8 @@ void BindShaderFog( Material* material ) {
gl_fogQuake3ShaderMaterial->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
gl_fogQuake3ShaderMaterial->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[glState.stackIndex] );

gl_fogQuake3ShaderMaterial->SetUniform_Time( backEnd.refdef.floatTime - backEnd.currentEntity->e.shaderTime );

// bind u_ColorMap
gl_fogQuake3ShaderMaterial->SetUniform_FogMapBindless(
GL_BindToTMU( 0, tr.fogImage )
Expand Down Expand Up @@ -1398,8 +1390,6 @@ void ProcessMaterialFog( Material* material, shaderStage_t* pStage, drawSurf_t*
material->shader = gl_fogQuake3ShaderMaterial;
material->fog = tr.world->fogs + drawSurf->fog;

gl_fogQuake3ShaderMaterial->SetVertexAnimation( false );

material->program = gl_fogQuake3ShaderMaterial->GetProgram( pStage->deformIndex );
}

Expand Down