Add fog quality material and update runtime/viewport hosts
This commit is contained in:
@@ -14,6 +14,7 @@ import { buildGeneratedModelCollider } from "../geometry/model-instance-collider
|
||||
import { DEFAULT_GRID_SIZE, snapValueToGrid } from "../geometry/grid-snapping";
|
||||
import { createStarterMaterialSignature, createStarterMaterialTexture } from "../materials/starter-material-textures";
|
||||
import { applyAdvancedRenderingLightShadowFlags, applyAdvancedRenderingRenderableShadowFlags, configureAdvancedRenderingRenderer, createAdvancedRenderingComposer, resolveBoxVolumeRenderPaths } from "../rendering/advanced-rendering";
|
||||
import { createFogQualityMaterial } from "../rendering/fog-material";
|
||||
import { updatePlanarReflectionCamera } from "../rendering/planar-reflection";
|
||||
import { collectWaterContactPatches, createWaterMaterial } from "../rendering/water-material";
|
||||
import { resolveViewportFocusTarget } from "./viewport-focus";
|
||||
@@ -2157,6 +2158,23 @@ export class ViewportHost {
|
||||
opacity
|
||||
});
|
||||
}
|
||||
if (quality) {
|
||||
const fogMaterial = createFogQualityMaterial({
|
||||
colorHex: brush.volume.fog.colorHex,
|
||||
density: brush.volume.fog.density * (selectedFace ? 1.12 : hoveredFace ? 1.06 : 1),
|
||||
padding: brush.volume.fog.padding,
|
||||
time: this.volumeTime,
|
||||
halfSize: {
|
||||
x: brush.size.x * 0.5,
|
||||
y: brush.size.y * 0.5,
|
||||
z: brush.size.z * 0.5
|
||||
},
|
||||
opacityMultiplier: selectedFace ? 1.12 : hoveredFace ? 1.06 : 1,
|
||||
colorLift: selectedFace ? 0.08 : hoveredFace ? 0.04 : 0
|
||||
});
|
||||
this.volumeAnimatedUniforms.push(fogMaterial.animationUniform);
|
||||
return fogMaterial.material;
|
||||
}
|
||||
return new MeshStandardMaterial({
|
||||
color: brush.volume.fog.colorHex,
|
||||
emissive: brush.volume.fog.colorHex,
|
||||
|
||||
@@ -148,6 +148,7 @@ import {
|
||||
createAdvancedRenderingComposer,
|
||||
resolveBoxVolumeRenderPaths
|
||||
} from "../rendering/advanced-rendering";
|
||||
import { createFogQualityMaterial } from "../rendering/fog-material";
|
||||
import { updatePlanarReflectionCamera } from "../rendering/planar-reflection";
|
||||
import { collectWaterContactPatches, createWaterMaterial } from "../rendering/water-material";
|
||||
import { resolveViewportFocusTarget } from "./viewport-focus";
|
||||
@@ -2963,6 +2964,25 @@ export class ViewportHost {
|
||||
});
|
||||
}
|
||||
|
||||
if (quality) {
|
||||
const fogMaterial = createFogQualityMaterial({
|
||||
colorHex: brush.volume.fog.colorHex,
|
||||
density: brush.volume.fog.density * (selectedFace ? 1.12 : hoveredFace ? 1.06 : 1),
|
||||
padding: brush.volume.fog.padding,
|
||||
time: this.volumeTime,
|
||||
halfSize: {
|
||||
x: brush.size.x * 0.5,
|
||||
y: brush.size.y * 0.5,
|
||||
z: brush.size.z * 0.5
|
||||
},
|
||||
opacityMultiplier: selectedFace ? 1.12 : hoveredFace ? 1.06 : 1,
|
||||
colorLift: selectedFace ? 0.08 : hoveredFace ? 0.04 : 0
|
||||
});
|
||||
|
||||
this.volumeAnimatedUniforms.push(fogMaterial.animationUniform);
|
||||
return fogMaterial.material;
|
||||
}
|
||||
|
||||
return new MeshStandardMaterial({
|
||||
color: brush.volume.fog.colorHex,
|
||||
emissive: brush.volume.fog.colorHex,
|
||||
|
||||
Reference in New Issue
Block a user