Skip to main content

Editor.Assets.CullMode

Enum

Enum that specifies which faces of a mesh to cull during rendering.

Index

Enumeration Members

Example

const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const assetManager = model.project.assetManager;

// Find a Material and configure face culling on its first pass
const materials = assetManager.assets.filter(a => a.isOfType('Material')) as Editor.Assets.Material[];
if (materials.length === 0) return;

const mat = materials[0];
const pass = mat.passInfos[0];

// Default: cull back faces (standard single-sided rendering)
pass.cullMode = Editor.Assets.CullMode.Back;

// Cull front faces instead (useful for inside-out effects)
pass.cullMode = Editor.Assets.CullMode.Front;

// Cull both faces (makes mesh invisible — used for shadow-only objects)
pass.cullMode = Editor.Assets.CullMode.FrontAndBack;

console.log(`"${mat.name}" final cullMode: FrontAndBack (${pass.cullMode})`);

Enumeration Members

Back

Back: number

Cull the back face of a mesh.


Front

Front: number

Cull the front face of a mesh.


FrontAndBack

FrontAndBack: number

Cull both the fron and back face of a mesh.