Skip to content

Commit

Permalink
fix: refraction mode enable
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhhkrx committed Dec 27, 2024
1 parent e062e18 commit aa434e4
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions packages/core/src/material/PBRMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export class PBRMaterial extends PBRBaseMaterial {
set refractionMode(value: RefractionMode) {
if (value !== this._refractionMode) {
this._refractionMode = value;
this._setRefractionMode(value);
this.shaderData.enableMacro("REFRACTION_MODE", value.toString());
}
}

Expand Down Expand Up @@ -524,18 +524,4 @@ export class PBRMaterial extends PBRBaseMaterial {
}
}
}

private _setRefractionMode(refractionMode: RefractionMode): void {
switch (refractionMode) {
case RefractionMode.Sphere:
this.shaderData.enableMacro("REFRACTION_MODE", "0");
break;
case RefractionMode.Plane:
this.shaderData.enableMacro("REFRACTION_MODE", "1");
break;
case RefractionMode.Thin:
this.shaderData.enableMacro("REFRACTION_MODE", "2");
break;
}
}
}

0 comments on commit aa434e4

Please sign in to comment.