Jump to content

[BUG] ShadowCasting - Directional Light "direction" parameter may not be straight


Dinkelborg
 Share

Recommended Posts

Hi,

I basically spend all day trying to make a very simple scene with a spinning box that simply casts a shadow >> http://playground.babylonjs.com/#1WTS3Q

while doing so I think I found a bug, my original plan was to have a light source pointing straight down so I set the directional lights target parameter to a Vector(0,-1,0) as it is also shown in this example in the tutorials

Quote

var light0 = new BABYLON.DirectionalLight("Dir0", new BABYLON.Vector3(0, -1, 0), scene);light0.diffuse = new BABYLON.Color3(1, 0, 0);light0.specular = new BABYLON.Color3(1, 1, 1);

 

if you look through the source-code of the playground demo I linked above and go and find line 28:

    dirLight = new BABYLON.DirectionalLight("dirLight", new BABYLON.Vector3(0.1, -1, 0), scene);

this was the solution I was searching for hours, if you change that exact line to:
 

dirLight = new BABYLON.DirectionalLight("dirLight", new BABYLON.Vector3(0, -1, 0), scene);

and then press 'RUN' again , you will notice that the shadow will no longer be visible. :ph34r:

 

...Am I overlooking something very basic or is this an actual issue? I am just learning Babylon, so please let me know if I made a stupid mistake :D

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