Skip to Content
🎉 @playcanvas/react 0.10.0 is here! ✨

GSplat

Gaussian Splats are a new way of capturing and rendering high quality 3D content. They capture the shape and lighting of a scene in a way that produces incredibly high quality results. See the Splat demo for a working example.

Usage

Once you load a Gaussian Splat model, you can use the GSplat component to render it.

splat.jsx
import { GSplat } from '@playcanvas/react/components' import { useSplat } from '@playcanvas/react/hooks' const Splat = (( src, ...props )) => { const { asset } = useSplat(src) if (!asset) return null return (<Entity {...props}> <GSplat asset={asset} /> </Entity>) }

Props

The following props are based on the GSplat Component  from PlayCanvas version 2.11.8. This documentation is automatically generated from the TypeScript types of the installed PlayCanvas package.

NameTypeDefault
customAabbBoundingBox | null

Sets a custom object space bounding box for visibility culling of the attached gsplat. Gets the custom object space bounding box for visibility culling of the attached gsplat.

instanceGSplatInstance | null

Sets a GSplatInstance on the component. If not set or loaded, it returns null. Gets the GSplatInstance on the component.

materialShaderMaterial | null

Sets the material used to render the gsplat. Gets the material used to render the gsplat.

highQualitySHboolean

Sets whether to use the high quality or the approximate (but fast) spherical-harmonic calculation when rendering SOGS data.

The low quality approximation evaluates the scene’s spherical harmonic contributions along the camera’s Z-axis instead of using each gaussian’s view vector. This results in gaussians being accurate at the center of the screen and becoming less accurate as they appear further from the center. This is a good trade-off for performance when rendering large SOGS datasets, especially on mobile devices.

Defaults to false. Gets whether the high quality (true) or the fast approximate (false) spherical-harmonic calculation is used when rendering SOGS data.

castShadowsboolean

Sets whether gsplat will cast shadows for lights that have shadow casting enabled. Defaults to false. Gets whether gsplat will cast shadows for lights that have shadow casting enabled.

unifiedboolean

Sets whether to use the unified gsplat rendering. Can be changed only when the component is not enabled. Default is false. Gets whether to use the unified gsplat rendering.

layersnumber[]

Sets an array of layer IDs (Layer#id ) to which this gsplat should belong. Don’t push, pop, splice or modify this array. If you want to change it, set a new one instead. Gets the array of layer IDs (Layer#id ) to which this gsplat belongs.

assetnumber | Asset

Sets the gsplat asset for this gsplat component. Can also be an asset id. Gets the gsplat asset id for this gsplat component.

systemComponentSystem

The ComponentSystem used to create this Component.

entityEntity

The Entity that this Component is attached to.

enabledboolean

Sets the enabled state of the component. Gets the enabled state of the component.

Last updated on