Jump to content

Casting shadows on PBR with environmentTexture


Recommended Posts


I have problems casting shadows on objects that have PBR material and environmentTexture. I don't know how to dim the light emitted by the environmentTexture, or even better, make the intensity of the reflection related to the lights of the scene. Since shadows are the areas on the objects where there is no light, and the reflection of the environment texture is not affected by the lights, I can't get shadows on the object.

Please, check the following example. http://www.babylonjs-playground.com/#BCHEUP

There is a barely visible shadow on the PBR ball, from the torus.

My questions are:

1) How can I make the ball dim/brighten according to the lights of the scene to some extend.

2) How can I change the intensity of the light of the environment texture, so that I can change the "intensity" of the reflected light of the ball, regardless of the surrounding lights? So that I can control how much the lights of the scene affect the brightness of the object.

Thanks in advance!

Link to comment
Share on other sites

For more info on light setup in PBR you can take a look at : http://doc.babylonjs.com/how_to/physically_based_rendering_master#light-setup

Basically light falloff is not the same in std and pbr, but you can use usePhysicalLightFalloff to make them alike. The environmentIntensity is the main property controlling the environment intensity.

The usePhysicalLightFalloff and environmentIntensity are only available in the PBRMaterial and not the 2 simpler versions.

Relying on them could look like : https://www.babylonjs-playground.com/#BCHEUP#1

And converting your material like : https://www.babylonjs-playground.com/#BCHEUP#2


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...