All type names in this reference belong to the Filament namespace. For example, init actually refers to Filament.init.

Classes

BufferDescriptor Low level buffer wrapper.
BufferObject Represents a single GPU buffer.
Camera Represents the eye through which the scene is viewed.
Engine Central manager and resource owner.
Entity Handle to an object consisting of a set of components.
EntityManager Singleton used for constructing entities in Filament's ECS.
Frustum Represents the six planes of a truncated viewing pyramid
IcoSphere Utility class for constructing spheres (requires glMatrix).
IndexBuffer Array of 16-bit or 32-bit unsigned integers consumed by the GPU.
Ktx1Bundle In-memory representation of a KTX file.
KtxInfo Property accessor for KTX1 header.
LightManager$Instance Component instance returned by LightManager
PixelBufferDescriptor Low level pixel buffer wrapper.
RenderableManager Allows access to properties of drawable objects.
RenderableManager$Instance Component instance returned by RenderableManager
Renderer Represents the platform's native window.
Scene Flat container of renderables and lights.
SwapChain Represents the platform's native rendering surface.
Texture 2D image or cubemap that can be sampled by the GPU, possibly mipmapped.
TransformManager Adds transform components to entities.
TransformManager$Instance Component instance returned by TransformManager
VertexBuffer Bundle of buffers and associated vertex attributes.
View Encompasses all the state needed for rendering a Scene.

Free Functions

Buffer Constructs a BufferDescriptor by copying a typed array into the WASM heap.
CompressedPixelBuffer Constructs a PixelBufferDescriptor for compressed texture
PixelBuffer Constructs a PixelBufferDescriptor by copying a typed array into the WASM heap.
fetch Downloads assets and invokes a callback when done.
getSupportedFormatSuffix Generate a file suffix according to the texture format.
getSupportedFormats Queries WebGL to check which compressed formats are supported.
init Downloads assets, loads the Filament module, and invokes a callback when done.
loadMathExtensions Extends the glMatrix math library.
packSnorm16 Converts a float in [-1, +1] into a half-float.

Enumerations

BufferObject$BindingType
Camera$Fov
Camera$Projection
ColorGrading$LutFormat
ColorGrading$QualityLevel
ColorGrading$ToneMapping
CompareFunc
CompareMode
CompressedPixelDataType
CullingMode
FeatureLevel
Frustum$Plane
IndexBuffer$IndexType
Ktx2Reader$Result
Ktx2Reader$TransferFunction
LightManager$Type
MagFilter
MinFilter
PixelDataFormat
PixelDataType
RenderTarget$AttachmentPoint
RenderableManager$PrimitiveType
RgbType
RgbaType
StencilFace
StencilOperation
Texture$CubemapFace
Texture$InternalFormat
Texture$Sampler
Texture$Usage
TransparencyMode
VertexAttribute
VertexBuffer$AttributeType
View$AmbientOcclusion
WrapMode

class BufferDescriptor

Low level buffer wrapper.

Clients should use the Buffer helper function to contruct BufferDescriptor objects.

class BufferObject

Represents a single GPU buffer.

class Camera

Represents the eye through which the scene is viewed.

See also the Engine methods createCamera and destroyCamera.

class Engine

Central manager and resource owner.

class Entity

Handle to an object consisting of a set of components.

To create an entity with no components, use EntityManager. TODO: It would be better to expose these as JS numbers rather than as JS objects. This would also be more consistent with Filament's Java bindings.

class EntityManager

Singleton used for constructing entities in Filament's ECS.

class Frustum

Represents the six planes of a truncated viewing pyramid

class IcoSphere

Utility class for constructing spheres (requires glMatrix).

The constructor takes an integer subdivision level, with 0 being an icosahedron. Exposes three arrays as properties:

class IndexBuffer

Array of 16-bit or 32-bit unsigned integers consumed by the GPU.

class Ktx1Bundle

In-memory representation of a KTX file.

Most clients should use one of the create*FromKtx utility methods in the JavaScript Engine wrapper rather than interacting with Ktx1Bundle directly.

class KtxInfo

Property accessor for KTX1 header.

For example, Ktx1Bundle.info().pixelWidth. See the KTX spec for the list of properties.

class LightManager$Instance

Component instance returned by LightManager

Be sure to call the instance's delete method when you're done with it.

class PixelBufferDescriptor

Low level pixel buffer wrapper.

Clients should use the PixelBuffer helper function to contruct PixelBufferDescriptor objects.

class RenderableManager

Allows access to properties of drawable objects.

class RenderableManager$Instance

Component instance returned by RenderableManager

Be sure to call the instance's delete method when you're done with it.

class Renderer

Represents the platform's native window.

See also the Engine methods createRenderer and destroyRenderer.

class Scene

Flat container of renderables and lights.

See also the Engine methods createScene and destroyScene.

class SwapChain

Represents the platform's native rendering surface.

See also the Engine methods createSwapChain and destroySwapChain.

class Texture

2D image or cubemap that can be sampled by the GPU, possibly mipmapped.

class TransformManager

Adds transform components to entities.

class TransformManager$Instance

Component instance returned by TransformManager

Be sure to call the instance's delete method when you're done with it.

class VertexBuffer

Bundle of buffers and associated vertex attributes.

class View

Encompasses all the state needed for rendering a Scene.

A view is associated with a particular Scene, Camera, and viewport. See also the Engine methods createView and destroyView.

function Buffer(typedarray)

Constructs a BufferDescriptor by copying a typed array into the WASM heap.

function CompressedPixelBuffer(typedarray, cdatatype, faceSize)

Constructs a PixelBufferDescriptor for compressed texture

data by copying a typed array into the WASM heap.

function PixelBuffer(typedarray, format, datatype)

Constructs a PixelBufferDescriptor by copying a typed array into the WASM heap.

function fetch(assets, onDone, onFetched)

Downloads assets and invokes a callback when done.

This utility consumes an array of URI strings and invokes callbacks after each asset is downloaded. Additionally, each downloaded asset becomes available in the Filament.assets global object, which is a mapping from URI strings to Uint8Array. If desired, clients can pre-populate entries in Filament.assets to circumvent HTTP requests (this should be done after calling Filament.init). This function is used internally by Filament.init and gltfio$FilamentAsset.loadResources.

function getSupportedFormatSuffix(desiredFormats)

Generate a file suffix according to the texture format.

Consumes a string describing desired formats and produces a file suffix depending on which (if any) of the formats are actually supported by the WebGL implementation. This is useful for compressed textures. For example, some platforms accept ETC and others accept S3TC.

function getSupportedFormats()

Queries WebGL to check which compressed formats are supported.

function init(assets, onready)

Downloads assets, loads the Filament module, and invokes a callback when done.

All JavaScript clients must call the init function, passing in a list of asset URL's and a callback. This callback gets invoked only after all assets have been downloaded and the Filament WebAssembly module has been loaded. Clients should only pass asset URL's that absolutely must be ready at initialization time. When the callback is called, each downloaded asset is available in the Filament.assets global object, which contains a mapping from URL's to Uint8Array objects.

function loadMathExtensions()

Extends the glMatrix math library.

Filament does not require its clients to use glMatrix, but if its usage is detected then the init function will automatically call loadMathExtensions. This defines the following functions:

function packSnorm16(value)

Converts a float in [-1, +1] into a half-float.

enum BufferObject$BindingType

enum Camera$Fov

enum Camera$Projection

enum ColorGrading$LutFormat

enum ColorGrading$QualityLevel

enum ColorGrading$ToneMapping

enum CompareFunc

enum CompareMode

enum CompressedPixelDataType

enum CullingMode

enum FeatureLevel

enum Frustum$Plane

enum IndexBuffer$IndexType

enum Ktx2Reader$Result

enum Ktx2Reader$TransferFunction

enum LightManager$Type

enum MagFilter

enum MinFilter

enum PixelDataFormat

enum PixelDataType

enum RenderTarget$AttachmentPoint

enum RenderableManager$PrimitiveType

enum RgbType

enum RgbaType

enum StencilFace

enum StencilOperation

enum Texture$CubemapFace

enum Texture$InternalFormat

enum Texture$Sampler

enum Texture$Usage

enum TransparencyMode

enum VertexAttribute

enum VertexBuffer$AttributeType

enum View$AmbientOcclusion

enum WrapMode