Skip to content

Commit

Permalink
Automatically enable "diffuse mode" for old materials.
Browse files Browse the repository at this point in the history
  • Loading branch information
apanteleev committed Sep 7, 2021
1 parent 3b7e123 commit c33e385
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/refresh/vkpt/material.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,13 @@ pbr_material_t* MAT_Find(const char* name, imagetype_t type, imageflags_t flags)
mat->image_emissive = NULL;
else
Q_strlcpy(mat->filename_emissive, mat->image_emissive->filepath, sizeof(mat->filename_emissive));

// If there is no normals/metalness image, assume that the material is a basic diffuse one.
if (!mat->image_normals)
{
mat->specular_factor = 0.f;
mat->metalness_factor = 0.f;
}
}

if(mat->synth_emissive && !mat->image_emissive)
Expand Down

0 comments on commit c33e385

Please sign in to comment.