Interface: Engine
Extends
PointerHolder
Properties
clearSkybox()
clearSkybox: () =>
void
Removed the skybox from the scene.
Returns
void
Defined in
createAndSetSkyboxByColor()
createAndSetSkyboxByColor: (
colorInHex
,showSun
,envIntensity
) =>void
Skybox
When added to a Scene, the Skybox fills all untouched pixels. By default the scene has no skybox and will be rendered as translucent. When using a skybox make sure to pass enableTransparentRendering as false.
Parameters
• colorInHex: string
• showSun: undefined
| boolean
Indicates whether the sun should be rendered. The sun can only be rendered if there is at least one light of type SUN in the scene. Default: false
• envIntensity: undefined
| number
Skybox intensity when no IndirectLight is set on the Scene. This call is ignored when an IndirectLight is set on the Scene, and the intensity of the IndirectLight is used instead. Scale factor applied to the skybox texel values such that the result is in lux, or lumen/m^2 (default = 30000)
Returns
void
Defined in
createAndSetSkyboxByTexture()
createAndSetSkyboxByTexture: (
buffer
,showSun
,envIntensity
) =>void
Skybox
When added to a Scene, the Skybox fills all untouched pixels. By default the scene has no skybox and will be rendered as translucent. When using a skybox make sure to pass enableTransparentRendering as false.
Parameters
• buffer: FilamentBuffer
• showSun: undefined
| boolean
Indicates whether the sun should be rendered. The sun can only be rendered if there is at least one light of type SUN in the scene. Default: false
• envIntensity: undefined
| number
Skybox intensity when no IndirectLight is set on the Scene. This call is ignored when an IndirectLight is set on the Scene, and the intensity of the IndirectLight is used instead. Scale factor applied to the skybox texel values such that the result is in lux, or lumen/m^2 (default = 30000)
Returns
void
Defined in
isValid
readonly
isValid:boolean
Get if the refernce to the native pointer is still valid and strong.
If this is false
, this object has been manually released with
release
() and all other methods on this object will throw an Error.
Inherited from
PointerHolder.isValid
Defined in
Methods
createLightManager()
createLightManager():
LightManager
Per engine instance you only need one LightManager
.
You should never need to call this manually, use instead from useFilamentContext()
.
Returns
Defined in
createMaterial()
createMaterial(
matcBuffer
):Material
Creates a new material from the given FilamentBuffer.
Parameters
• matcBuffer: FilamentBuffer
Returns
Worklet
Defined in
createOrbitCameraManipulator()
createOrbitCameraManipulator(
config
):CameraManipulator
Parameters
• config: OrbitCameraManipulatorConfig
Returns
Defined in
createRenderableManager()
createRenderableManager():
RenderableManager
Per engine instance you only need one RenderableManager
.
You should never need to call this manually, use instead from useFilamentContext()
.
Returns
Defined in
createRenderer()
createRenderer():
Renderer
Returns
Defined in
createSwapChainForRecorder()
createSwapChainForRecorder(
recorder
):SwapChain
Parameters
• recorder: TFilamentRecorder
Returns
Defined in
createSwapChainForSurface()
createSwapChainForSurface(
surface
,enableTransparentRendering
):SwapChain
Parameters
• surface: SurfaceProvider
• enableTransparentRendering: boolean
Returns
Defined in
createTransformManager()
createTransformManager():
TransformManager
Per engine instance you only need one TransformManager
.
You should never need to call this manually, use instead from useFilamentContext()
.
Returns
Defined in
flushAndWait()
flushAndWait():
void
Kicks the hardware thread (e.g. the OpenGL, Vulkan or Metal thread) and blocks until all commands to this point are executed. Note that does guarantee that the hardware is actually finished. Note: during on screen rendering this is handled automatically, typically used for offscreen rendering (recording).
Returns
void
Defined in
getCamera()
getCamera():
RNFCamera
Returns
Defined in
getScene()
getScene():
Scene
Returns
Defined in
getView()
getView():
View
Returns
Defined in
loadAsset()
loadAsset(buffer)
loadAsset(
buffer
):FilamentAsset
Given a FilamentBuffer (e.g. from a .glb file), load the asset into the engine.
Parameters
• buffer: FilamentBuffer
Returns
Defined in
loadAsset(buffer)
loadAsset(
buffer
):FilamentAsset
Given a
Parameters
• buffer: FilamentBuffer
Returns
See
FilamentBuffer (e.g. from a .glb file), load the asset into the engine. This will by default add all entities from the asset to the attached default scene.
Worklet
Defined in
loadInstancedAsset()
loadInstancedAsset(
buffer
,instanceCount
):FilamentAsset
Given a
Parameters
• buffer: FilamentBuffer
• instanceCount: number
Returns
See
FilamentBuffer (e.g. from a .glb file), load the asset into the engine. It will create multiple instances of the asset.
Defined in
release()
release():
void
Manually release this reference to the native pointer. This will ensure that JS will no longer hold a strong reference, and memory can be safely cleaned up.
If the native pointer is still referenced elsewhere in native code, the underlying memory will not be deleted unless the other references are also released.
If this is not called, the memory will only be cleaned once the JS gabage collector decides to delete this object, which might be at any point in the future.
Calling release()
is not required as the GC will destroy this
object eventually anyways, but it is recommended to optimize
memory usage.
After manually releasing a pointer, all future methods on this object will throw an Error.
Returns
void
Inherited from
PointerHolder.release
Defined in
setAutomaticInstancingEnabled()
setAutomaticInstancingEnabled(
enabled
):void
Enables or disables automatic instancing of render primitives. Instancing of render primitives can greatly reduce CPU overhead but requires the instanced primitives to be identical (i.e. use the same geometry) and use the same MaterialInstance. If it is known that the scene doesn't contain any identical primitives, automatic instancing can have some overhead and it is then best to disable it.
Disabled by default.
Parameters
• enabled: boolean
Returns
void
Defined in
setIndirectLight()
setIndirectLight(
iblBuffer
,intensity
,irradianceBands
):void
Set the indirect light for the scene.
Parameters
• iblBuffer: FilamentBuffer
A buffer containing the IBL data (e.g. from a .ktx file)
• intensity: undefined
| number
The intensity of the indirect light. Default: 30_000
• irradianceBands: undefined
| number
Number of spherical harmonics bands. Must be 1, 2 or 3. Default: 3
Returns
void
Defined in
setSurfaceProvider()
setSurfaceProvider(
surfaceProvider
):void
Parameters
• surfaceProvider: SurfaceProvider
Returns
void
Defined in
setSwapChain()
setSwapChain(
swapChain
):void
Parameters
• swapChain: SwapChain
Returns
void