How to use the @babylonjs/materials/grid/gridMaterial.GridMaterial function in @babylonjs/materials

To help you get started, we’ve selected a few @babylonjs/materials examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BabylonJS / Babylon.js / tests / es6Modules / minGridMaterial.ts View on Github external
// This creates a light, aiming 0,1,0 - to the sky (non-mesh)
var light = new HemisphericLight("light1", new Vector3(0, 1, 0), scene);

// Default intensity is 1. Let's dim the light a small amount
light.intensity = 0.7;

// Our built-in 'sphere' shape. Params: name, subdivs, size, scene
var sphere = Mesh.CreateSphere("sphere1", 16, 2, scene);

// Move the sphere upward 1/2 its height
sphere.position.y = 2;

// Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
var ground = Mesh.CreateGround("ground1", 6, 6, 2, scene);
ground.material = new GridMaterial("", scene);
sphere.material = new GridMaterial("", scene);

engine.runRenderLoop(() => {
    scene.render();
});

@babylonjs/materials

Babylon.js Materials Library =====================

Apache-2.0
Latest version published 10 hours ago

Package Health Score

92 / 100
Full package analysis

Popular @babylonjs/materials functions