Jump to content

Shadows not visible, objects not selectable and roughness not working


Recommended Posts


I'm very new with Babylon js (I started around a week ago).

I'm trying to set up a scene, but I'm having a couple of problems that probably appear quite stupid to someone used to this kind of stuff.


1. I would like to add shadows to the scene. I know that a shadow generator has to be created to do so. The scene is lit using an environment and from what I read environment light don't allow the use of shadows. So I added a directional light to influence the shadows. For some reason, I don't see them in the scene.

Here we arrive to the second question

2. I need to include the meshes I want to project and receive shadows into this shadow generator, pushing them into an array 1 by 1. I am not sure how to select single objects or group of objects imported using the  SceneLoader.ImportMeshAsync function. I was told that after importing a .glb file you have to add .then and the function you wish to be executed to affect the elements. In my example, I used to assign new materials to my meshes. I tried to push the meshes into the shadow array, but apparently is not working. So, the second question is... how do I select a mesh I imported to assign it to the shadow generator array?

3. The third question is partially related. I want to create a floor made of wood. I tried to load a roughness map, but for some reason it seems not reacting to the light as expected. Furthermore, I am not sure how I can make the wood slightly gloss without having it look like a mirror. I tried everything, but from what I understood, depending on the type of material (dielectric or metallic) you create the roughness map using a microsurface property (for dielectric) or metallictexture property (for metallic).


The link to the playground is https://playground.babylonjs.com/#HJS9BN#33


Thank you to everyone who will take a minute to help!
I hope this topic can be helpful to other users too!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...