BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
23.17k stars 3.42k forks source link

No Shader found using GridMaterial #14082

Closed dengbupapapa closed 1 year ago

dengbupapapa commented 1 year ago

version "@babylonjs/core": "^6.13.0", "@babylonjs/materials": "^6.13.0", "babylonjs": "^6.13.0", "babylonjs-loaders": "^6.13.0", code

import * as BABYLON from "babylonjs";
import { GridMaterial } from "@babylonjs/materials";
  let size = 10; 
  let grid = BABYLON.MeshBuilder.CreateGround(
    "grid",
    { height: size, width: size },
    mainScene
  );
  let groundMaterial = new GridMaterial("groundMaterial", mainScene);
  grid.material = groundMaterial;

error info image PS @babylonjs/materials All materials under @babylonjs/materials will report this error, Or am I using something wrong? :(

sebavan commented 1 year ago

As indicated in the template, please first report the problem to forum for discussion.

cc @RaananW to double check but you should never mix usage of @babylonjs/... our es lib and babylonjs our umd distrib.

dengbupapapa commented 1 year ago

As indicated in the template, please first report the problem to forum for discussion.

cc @RaananW to double check but you should never mix usage of @babylonjs/... our es lib and babylonjs our umd distrib.

Thank you very much for your reply. after replacing @babylonjs/materials with babylonjs-materials, it works properly.