Jump to content

Shadow has an strange offset from the object


Recommended Posts

  • 3 months later...

Hello, I'm digging up this topic as I have a similar problem, but the "bias" does not fix it.

I have a simple babylon file imported from blender, I add a PointLight in the scene and create a Shadow Generator.

Here is some pieces of my code :


	this.light = new BABYLON. PointLight("light", new BABYLON.Vector3(0,2.8,0), scene);

	var shadowGenerator = new BABYLON.ShadowGenerator(1024, this.light);
	shadowGenerator.bias = 0.00000000001; // OR EVEN 0

    // for each shadow projecting object "pup"

	this.room.receiveShadows = true;

	var lightbulb =  BABYLON.Mesh.CreateSphere("lightbulb", 16, 0.1, scene );
	lightbulb.position = this.light.position;
	lightbulb.material = new BABYLON.StandardMaterial("material01", scene);
	lightbulb.material.emissiveColor.r = 1;
	lightbulb.material.emissiveColor.b = 1;
	lightbulb.material.emissiveColor.g = 1;


Yet, i get the image attached. the white sphere is the light, the shadow are clearly not where they should be...

Any suggestions ?

Thanks !


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