Render Grid helper error

Render grid in inspector Helpers section is not working in my applicaiton. It throws following error literally thousands of time, many per second:
Uncaught TypeError: Cannot read property 'ShadersStore' of undefined
What can be the cause of it? Do I not include a material that it needs?

Pinging @sebavan

I think you need to import material library: @babylonjs/materials - npm

I would suspect you are using import * as BABYLON from "… ???

If yes, you should try to rename BABYLON by smthg else ?

If not, we might need more details about your setup ?

Currently I have only import { GridMaterial } from '@babylonjs/materials/grid'

Also should I do the default ground mesh with Render Scene and createDefaultEnvironment as follows:

var helper = scene.createDefaultEnvironment({
            enableGroundShadow: true
        // helper.setMainColor(BABYLON.Color3.Gray());
        // helper.ground.position.y += 0.01;

I am sorry I do not understand totally. Are you trying to use the inspector or are you creating the ground and so on by code ?

Sorry. I am putting a default ground, made by my scene code. But there is also a render scene functionality in the scene inspector, however I cannot get it to work. It throws when I click its switch.

ohhhh gotcha, I ll try to repro but if you have a small github repro I take it :slight_smile:

I will also be putting a repro

Here is a pg with a ground mesh and grid materila on it: PG

On the inspector tehre is a Rende Scene option but which ı would like to use instead of my mesh solution since the mesh ground is Pickable when the inspector is open and gizmo attachable. I need a ground that is not pickable and not gizmo affetctable.

Here the render scene works properly though.

Thank you, I can reproduce the error :slight_smile: I will try to have a fix on Monday. Basically in the inspector we try to load the gridMaterial from the none es6-modules creating conflicts around the BABYLON namespace internally.

1 Like

Then the ground from inspector render ground feature, not mine, also uses grid material.

That will be the one I use, partly because my implementation is pickabke and transformable which I desire not to be so.

Thanks a lot.

PR is up it will be in the next npm release: Fix inspector render grid es6 by sebavan · Pull Request #6634 · BabylonJS/Babylon.js · GitHub

1 Like

By the way I want to contribute to the babylonjs project as well. Would you have any suggestions? And so for open source contribution in general.

That is great you are willing to contribute :slight_smile:

You could easily start by implementing one of the Help Wanted Issues from the repo or any requests from the forum: Issues · BabylonJS/Babylon.js · GitHub

Also to get started locally, you can have a read at : Start Contributing to Babylon.js - Babylon.js Documentation