Jump to content

Is it possible for a mesh to receive and create shadows ?


mache
 Share

Recommended Posts

Hello,

I am trying to generate shadows for a 3D scene with the ShadowGenerator of Babylon. My problem is the following : a mesh can't create shadows and receiving shadows at the same time.

Here is a playground where this is illustrated : http://playground.babylonjs.com/#1R4XE8#1

Let's focus on lines 47 & 48 :

torus.receiveShadows = true;
shadowGenerator.getShadowMap().renderList.push(torus);

If the first one is commented  the torus doesn't receive shadow and when it pass into the cube shadow, it is still highlight.

If the second one is commented the torus doesn't create shadow but when it pass into the cube shadow, it act well.

Finally if the both are uncommented the torus is constantly shadowed (like it is occluding by itself...)

Thanks for any help !

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.

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

Loading...
 Share

  • Recently Browsing   0 members

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