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

Use $color2 for PBR materials on models #1020

Merged
merged 1 commit into from
Oct 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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