Add whitebox bevel material application to runtime-host.ts
This commit is contained in:
@@ -56,6 +56,10 @@ import {
|
|||||||
} from "../rendering/water-material";
|
} from "../rendering/water-material";
|
||||||
import { createFogQualityMaterial } from "../rendering/fog-material";
|
import { createFogQualityMaterial } from "../rendering/fog-material";
|
||||||
import { updatePlanarReflectionCamera } from "../rendering/planar-reflection";
|
import { updatePlanarReflectionCamera } from "../rendering/planar-reflection";
|
||||||
|
import {
|
||||||
|
applyWhiteboxBevelToMaterial,
|
||||||
|
shouldApplyWhiteboxBevel
|
||||||
|
} from "../rendering/whitebox-bevel-material";
|
||||||
import {
|
import {
|
||||||
areAdvancedRenderingSettingsEqual,
|
areAdvancedRenderingSettingsEqual,
|
||||||
cloneAdvancedRenderingSettings,
|
cloneAdvancedRenderingSettings,
|
||||||
@@ -1153,19 +1157,43 @@ export class RuntimeHost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (material === null) {
|
if (material === null) {
|
||||||
return new MeshStandardMaterial({
|
const faceMaterial = new MeshStandardMaterial({
|
||||||
color: FALLBACK_FACE_COLOR,
|
color: FALLBACK_FACE_COLOR,
|
||||||
roughness: 0.9,
|
roughness: 0.9,
|
||||||
metalness: 0.05
|
metalness: 0.05
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.currentWorld !== null &&
|
||||||
|
shouldApplyWhiteboxBevel(this.currentWorld.advancedRendering)
|
||||||
|
) {
|
||||||
|
applyWhiteboxBevelToMaterial(
|
||||||
|
faceMaterial,
|
||||||
|
this.currentWorld.advancedRendering.whiteboxBevel
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return faceMaterial;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MeshStandardMaterial({
|
const faceMaterial = new MeshStandardMaterial({
|
||||||
color: 0xffffff,
|
color: 0xffffff,
|
||||||
map: this.getOrCreateTexture(material),
|
map: this.getOrCreateTexture(material),
|
||||||
roughness: 0.92,
|
roughness: 0.92,
|
||||||
metalness: 0.02
|
metalness: 0.02
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.currentWorld !== null &&
|
||||||
|
shouldApplyWhiteboxBevel(this.currentWorld.advancedRendering)
|
||||||
|
) {
|
||||||
|
applyWhiteboxBevelToMaterial(
|
||||||
|
faceMaterial,
|
||||||
|
this.currentWorld.advancedRendering.whiteboxBevel
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return faceMaterial;
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateUnderwaterSceneFog() {
|
private updateUnderwaterSceneFog() {
|
||||||
|
|||||||
Reference in New Issue
Block a user