Type Alias: PreviewOptions
PreviewOptions =
object
Settings related to the 3D preview.
Properties
autoRotation?
readonlyoptionalautoRotation?:boolean
When set the product while rotate slowly
backgroundColor?
readonlyoptionalbackgroundColor?:string
The color expected to be seen in the background of the product. Expects a hexadecimal value.
backgroundImage?
readonlyoptionalbackgroundImage?:string
Image to be used as a background when running withh transparency, the image will be scaled and centered to fill the preview based on aspect ratio. Will implicitly set transparency to true.
createCanvas?
readonlyoptionalcreateCanvas?: () =>HTMLCanvasElement
Function that returns a canvas to be used for rendering. Useful when using the preview in a headless environment.
Returns
HTMLCanvasElement
A canvas to be used for rendering.
disableActionBar?
readonlyoptionaldisableActionBar?:boolean
When true the action bar won't be displayed to the user.
disableAutomaticOrientation?
readonlyoptionaldisableAutomaticOrientation?:boolean
When set the 3D preview won't attempt to orient the product automatically to its front view at load.
emissiveGlowIntensity?
readonlyoptionalemissiveGlowIntensity?:number
The intensity of the glow effect that is present when a material has an emissive texture.
environmentFile?
readonlyoptionalenvironmentFile?:string
The environment file used to calculate product lighting.
environmentIntensity?
readonlyoptionalenvironmentIntensity?:number
The intensity of the environment lighting.
environmentRotationY?
readonlyoptionalenvironmentRotationY?:number
The rotation (around the y axis) of the environment lighting, in degrees.
fallbackLighting?
readonlyoptionalfallbackLighting?:object
Configuration for the light used when the environment isn't lighting the scene, either because no environmentFile was configured or because the configured file failed to load. PBR materials are lit entirely by the environment, so without this a missing environment renders the product black and looks indistinguishable from a broken model. The fallback is only applied while the scene has no lights of its own, so models that ship their own lighting are left untouched.
color?
optionalcolor?:string
The colour of the fallback light arriving from above. Expects a hexadecimal value. Defaults to white.
enabled?
optionalenabled?:boolean
When false no fallback light is added, and a scene with no environment lighting renders unlit. Defaults to true.
groundColor?
optionalgroundColor?:string
The colour of the fallback light bouncing back from below. Expects a hexadecimal value. Defaults to a dark grey.
intensity?
optionalintensity?:number
The intensity of the fallback light. Defaults to 1.2.
groundShadow?
readonlyoptionalgroundShadow?:object
Configuration for a soft contact shadow drawn on the ground beneath the product, which helps it read as resting on a surface rather than floating in space.
enabled?
optionalenabled?:boolean
When true the shadow is drawn. Defaults to false.
opacity?
optionalopacity?:number
The darkness of the shadow at its centre, from 0 to 1. Defaults to 0.08.
spread?
optionalspread?:number
The size of the shadow relative to the product's footprint. Defaults to 1.8.
highDynamicRange?
readonlyoptionalhighDynamicRange?:boolean
When true the rendering pipeline renders into high dynamic range (half-float) targets, so tone mapping and bloom operate on unclamped values. Gives smoother highlights, and is recommended when tone mapping is enabled. Silently falls back to low dynamic range on devices without half-float render support. Defaults to true.
highlightColor?
readonlyoptionalhighlightColor?:string
Sets the color of highlights when enabled. Expects hexadecimal value.
highlightOnMaterialHover?
readonlyoptionalhighlightOnMaterialHover?:boolean
When set, mousing over the model in this preview will highlight the associated mesh/material. When layout contexts are provided, only the materials with matching names will highlight.
idleTimeBeforeRotation?
readonlyoptionalidleTimeBeforeRotation?:number
Time in milliseconds before the product starts rotating after a user input has taken control.
lighting?
readonlyoptionallighting?:object
Configuration rleated to lighting of the scene.
contrast?
optionalcontrast?:number
Sets camera contrast. Higher values will increase the contrast of the scene. Defaults to 1.1.
exposure?
optionalexposure?:number
Sets camera exposure. Higher values will make the scene brighter. Defaults to 1.
lowerAlphaLimitDeg?
readonlyoptionallowerAlphaLimitDeg?:number
The leftmost point, horizontally, that the camera can rotate to. https://doc.babylonjs.com/divingDeeper/cameras/camera_introduction
lowerBetaLimitDeg?
readonlyoptionallowerBetaLimitDeg?:number
The lowest point, vertically, that the camera can rotate to. https://doc.babylonjs.com/divingDeeper/cameras/camera_introduction
maxZoomOverride?
readonlyoptionalmaxZoomOverride?:number
The closest zoom the camera can achieve to the product.
minZoomOverride?
readonlyoptionalminZoomOverride?:number
The furthest zoom the camera can achieve to the product.
noPan?
readonlyoptionalnoPan?:boolean
When true the preview system will not allow the user to pan the camera.
noRender?
readonlyoptionalnoRender?:boolean
When true the preview system operates in a noRender mode. It silently accepts all requests and modifies internal state based on those requests. However no rendering will actually be occuring. Can be useful in situations where testing requires a 3D preview but the actual rendering is not important.
renderingPipelineConfiguration?
readonlyoptionalrenderingPipelineConfiguration?:RenderingPipelineConfiguration
Configuration for post-processing effects.
transparentBackground?
readonlyoptionaltransparentBackground?:boolean
When true, the canvas background will be transparent.
upperAlphaLimitDeg?
readonlyoptionalupperAlphaLimitDeg?:number
The rightmost point, horizontally, that the camera can rotate to. https://doc.babylonjs.com/divingDeeper/cameras/camera_introduction
upperBetaLimitDeg?
readonlyoptionalupperBetaLimitDeg?:number
The highest point, vertically, that the camera can rotate to. https://doc.babylonjs.com/divingDeeper/cameras/camera_introduction