Skip to content

Commit

Permalink
fix undeclared identifier error in pbrMetallicRoughnessBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
Starryi committed Nov 1, 2023
1 parent c2de504 commit 098f8c7
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -1116,10 +1116,6 @@ export class PBRMetallicRoughnessBlock extends NodeMaterialBlock {
state._emitFunctionFromInclude("imageProcessingDeclaration", comments);
state._emitFunctionFromInclude("imageProcessingFunctions", comments);

state._emitFunctionFromInclude("shadowsFragmentFunctions", comments, {
replaceStrings: [{ search: /vPositionW/g, replace: worldPosVarName + ".xyz" }],
});

state._emitFunctionFromInclude("pbrDirectLightingSetupFunctions", comments, {
replaceStrings: [{ search: /vPositionW/g, replace: worldPosVarName + ".xyz" }],
});
Expand Down Expand Up @@ -1331,7 +1327,10 @@ export class PBRMetallicRoughnessBlock extends NodeMaterialBlock {

if (this.light) {
state.compilationString += state._emitCodeFromInclude("lightFragment", comments, {
replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }],
replaceStrings: [
{ search: /{X}/g, replace: this._lightId.toString() },
{ search: /vPositionW/g, replace: worldPosVarName + ".xyz" },
],
});
} else {
state.compilationString += state._emitCodeFromInclude("lightFragment", comments, {
Expand Down

0 comments on commit 098f8c7

Please sign in to comment.