Skip to content

Commit

Permalink
Use $color2 for PBR materials on models
Browse files Browse the repository at this point in the history
Turns out $color was cursed from the start
  • Loading branch information
Gocnak committed Oct 14, 2020
1 parent e08bd50 commit 9abbc6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mp/src/materialsystem/stdshaders/pbr_dx9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ BEGIN_VS_SHADER(PBR, "PBR shader")
END_SHADER_PARAMS;

// Setting up variables for this shader
void SetupVars(PBR_Vars_t &info)
void SetupVars(IMaterialVar **params, PBR_Vars_t &info)
{
info.baseTexture = BASETEXTURE;
info.baseTexture2 = BASETEXTURE2;
info.baseColor = COLOR;
info.baseColor = IS_FLAG_SET(MATERIAL_VAR_MODEL) ? COLOR2 : COLOR;
info.normalTexture = NORMALTEXTURE;
info.bumpMap = BUMPMAP;
info.bumpMap2 = BUMPMAP2;
Expand Down Expand Up @@ -170,7 +170,7 @@ BEGIN_VS_SHADER(PBR, "PBR shader")
SHADER_INIT
{
PBR_Vars_t info;
SetupVars(info);
SetupVars(params, info);

Assert(info.flashlightTexture >= 0);
LoadTexture(info.flashlightTexture, TEXTUREFLAGS_SRGB);
Expand Down Expand Up @@ -231,7 +231,7 @@ BEGIN_VS_SHADER(PBR, "PBR shader")
SHADER_DRAW
{
PBR_Vars_t info;
SetupVars(info);
SetupVars(params, info);

// Setting up booleans
bool bHasBaseTexture = (info.baseTexture != -1) && params[info.baseTexture]->IsTexture();
Expand Down

0 comments on commit 9abbc6f

Please sign in to comment.