Hey gang! long time.
I’ve been messing around with Babylon Lite and i like it!
Just having a small depth issue with transparency and i can’t seem to figure out how to set it up properly..
In BabylonJs this would fixed:
Material.needDepthPrePass = true;
labris
July 20, 2026, 7:32am
2
In Lite currently it will take more lines
You need a custom four-pass setup.
Create the scene with:
createSceneContext(engine, { defaultRenderTask: false })
Then add your normal meshes to the scene as usual.
For transparent materials, create a depth-only version with:
createStandardNoColorMaterialView(material)
Add the real transparent mesh to the transparent color task.
Add the same mesh to the transparent depth task, but use the depth-only material override.
Keep the render tasks in this order:
Opaque depth, opaque color, transparent depth, transparent color.
Do not add a separate depth-only proxy mesh directly with addToScene(). The depth-only material should only be used inside the depth render task.
Finally, call registerScene(scene) and startEngine(engine) normally.
Hey @labris
Thanks for the reply! That does work.
Very suddenly having an awfully complex index file just to render transparent meshes through - I hope the team have more friendly support planned for the future
Not necessarily
The goal of Lite is perf and size. Not convenience
That’s fair!
Is Labris’ solution how Babylonjs handles it internally?
labris
July 20, 2026, 6:40pm
8
Here is the helper with resize support - Babylon Lite Playground