Skip to content

Commit 2fe16f3

Browse files
committed
Fix specular with material system
1 parent 2b6d388 commit 2fe16f3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/engine/renderer/Material.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ void BindShaderLightMapping( Material* material ) {
10301030
gl_lightMappingShaderMaterial->SetReliefMapping( material->enableReliefMapping );
10311031
/* Reflective specular setting is different here than in ProcessMaterialLightMapping(),
10321032
because we don't have cubemaps built yet at this point, but for the purposes of the material ordering there's no difference */
1033-
gl_lightMappingShaderMaterial->SetReflectiveSpecular( material->enableSpecularMapping && !( tr.refdef.rdflags & RDF_NOCUBEMAP ) );
1033+
gl_lightMappingShaderMaterial->SetReflectiveSpecular( glConfig2.reflectionMapping && material->enableSpecularMapping && !( tr.refdef.rdflags & RDF_NOCUBEMAP ) );
10341034
gl_lightMappingShaderMaterial->SetPhysicalShading( material->enablePhysicalMapping );
10351035

10361036
// Bind shader program.
@@ -1288,8 +1288,6 @@ void ProcessMaterialGeneric3D( Material* material, shaderStage_t* pStage, drawSu
12881288
void ProcessMaterialLightMapping( Material* material, shaderStage_t* pStage, drawSurf_t* drawSurf ) {
12891289
material->shader = gl_lightMappingShaderMaterial;
12901290

1291-
material->bspSurface = false;
1292-
12931291
gl_lightMappingShaderMaterial->SetBspSurface( drawSurf->bspSurface );
12941292

12951293
lightMode_t lightMode;
@@ -1446,6 +1444,7 @@ void MaterialSystem::ProcessStage( drawSurf_t* drawSurf, shaderStage_t* pStage,
14461444
drawSurf->texturesDynamic[stage] = true;
14471445
}
14481446

1447+
material.bspSurface = drawSurf->bspSurface;
14491448
pStage->materialProcessor( &material, pStage, drawSurf );
14501449

14511450
std::vector<Material>& materials = materialPacks[materialPack].materials;

0 commit comments

Comments
 (0)