|
@@ -65,6 +65,7 @@ export const Canvas3DParams = {
|
|
cameraClipping: PD.Group({
|
|
cameraClipping: PD.Group({
|
|
radius: PD.Numeric(100, { min: 0, max: 99, step: 1 }, { label: 'Clipping', description: 'How much of the scene to show.' }),
|
|
radius: PD.Numeric(100, { min: 0, max: 99, step: 1 }, { label: 'Clipping', description: 'How much of the scene to show.' }),
|
|
far: PD.Boolean(true, { description: 'Hide scene in the distance' }),
|
|
far: PD.Boolean(true, { description: 'Hide scene in the distance' }),
|
|
|
|
+ minNear: PD.Numeric(5, { min: 0.1, max: 10, step: 0.1 }, { description: 'Note, may cause performance issues rendering impostors when set too small and cause issues with outline rendering when too close to 0.' }),
|
|
}, { pivot: 'radius' }),
|
|
}, { pivot: 'radius' }),
|
|
viewport: PD.MappedStatic('canvas', {
|
|
viewport: PD.MappedStatic('canvas', {
|
|
canvas: PD.Group({}),
|
|
canvas: PD.Group({}),
|
|
@@ -322,6 +323,7 @@ namespace Canvas3D {
|
|
mode: p.camera.mode,
|
|
mode: p.camera.mode,
|
|
fog: p.cameraFog.name === 'on' ? p.cameraFog.params.intensity : 0,
|
|
fog: p.cameraFog.name === 'on' ? p.cameraFog.params.intensity : 0,
|
|
clipFar: p.cameraClipping.far,
|
|
clipFar: p.cameraClipping.far,
|
|
|
|
+ minNear: p.cameraClipping.minNear,
|
|
fov: degToRad(p.camera.fov),
|
|
fov: degToRad(p.camera.fov),
|
|
}, { x, y, width, height }, { pixelScale: attribs.pixelScale });
|
|
}, { x, y, width, height }, { pixelScale: attribs.pixelScale });
|
|
const stereoCamera = new StereoCamera(camera, p.camera.stereo.params);
|
|
const stereoCamera = new StereoCamera(camera, p.camera.stereo.params);
|
|
@@ -687,7 +689,7 @@ namespace Canvas3D {
|
|
cameraFog: camera.state.fog > 0
|
|
cameraFog: camera.state.fog > 0
|
|
? { name: 'on' as const, params: { intensity: camera.state.fog } }
|
|
? { name: 'on' as const, params: { intensity: camera.state.fog } }
|
|
: { name: 'off' as const, params: {} },
|
|
: { name: 'off' as const, params: {} },
|
|
- cameraClipping: { far: camera.state.clipFar, radius },
|
|
|
|
|
|
+ cameraClipping: { far: camera.state.clipFar, radius, minNear: camera.state.minNear },
|
|
cameraResetDurationMs: p.cameraResetDurationMs,
|
|
cameraResetDurationMs: p.cameraResetDurationMs,
|
|
sceneRadiusFactor: p.sceneRadiusFactor,
|
|
sceneRadiusFactor: p.sceneRadiusFactor,
|
|
transparentBackground: p.transparentBackground,
|
|
transparentBackground: p.transparentBackground,
|
|
@@ -814,6 +816,9 @@ namespace Canvas3D {
|
|
if (props.cameraClipping.far !== undefined && props.cameraClipping.far !== camera.state.clipFar) {
|
|
if (props.cameraClipping.far !== undefined && props.cameraClipping.far !== camera.state.clipFar) {
|
|
cameraState.clipFar = props.cameraClipping.far;
|
|
cameraState.clipFar = props.cameraClipping.far;
|
|
}
|
|
}
|
|
|
|
+ if (props.cameraClipping.minNear !== undefined && props.cameraClipping.minNear !== camera.state.minNear) {
|
|
|
|
+ cameraState.minNear = props.cameraClipping.minNear;
|
|
|
|
+ }
|
|
if (props.cameraClipping.radius !== undefined) {
|
|
if (props.cameraClipping.radius !== undefined) {
|
|
const radius = (getSceneRadius() / 100) * (100 - props.cameraClipping.radius);
|
|
const radius = (getSceneRadius() / 100) * (100 - props.cameraClipping.radius);
|
|
if (radius > 0 && radius !== cameraState.radius) {
|
|
if (radius > 0 && radius !== cameraState.radius) {
|