About the Pixel art style
Pixel-art models keep real 3D geometry but texture it with deliberately small images, so the pixels stay sharp at any distance.
- Textures must be sampled with nearest/point filtering; bilinear filtering blurs them. In glTF the sampler is stored as NEAREST, and most engines pick it up on import.
- Avoid lossy texture compression that smears pixel edges; small textures cost little memory anyway.
- Leaves are alpha-tested cards with hard pixel edges, no soft alpha and no sorting.
- Geometry stays simple, so draw calls and triangle counts are close to low-poly.
For the full look, pair the models with a low internal render resolution or a pixelation post-effect. Typical genres: retro adventures, roguelites, farming and exploration games, 2.5D platformers.
Using it in Babylon.js
Babylon.js loads GLB through the glTF loader in @babylonjs/loaders: ImportMeshAsync (or SceneLoader.ImportMeshAsync in older code), or LoadAssetContainerAsync when you need many copies via instantiateModelsToScene.
- LOD:
lod0.addLODLevel(30, lod1),addLODLevel(80, lod2)and so on; passingnullas the mesh hides the object beyond that distance. - Thousands of trees: thin instances (
thinInstanceAddwith matrices) render in one draw call per mesh; use regularcreateInstancewhen each tree needs its own picking or logic. - Leaves: glTF MASK maps to alpha-tested PBRMaterial (
MATERIAL_ALPHATEST). - Collision mesh: set
isVisible = falseand use it withcheckCollisionsor Havok physics (PhysicsAggregatewith a MESH shape).