Jump to content

Cast shadows from .babylon file


sergiopt
 Share

Recommended Posts

Hello i am struggling to put shadows in "predio.babylon" file, is just a scene with a building and ground, created and exported from blender addon.

i have success with the generated primitives from babylon, but with json files not.

I have attach my files,

hope your help, thanks.

public_html.zip

Link to comment
Share on other sites

Try that, that should work:

// Shadowsvar shadowGenerator2 = new BABYLON.ShadowGenerator(1024, light2);shadowGenerator2.getShadowMap().renderList.push(newScene.meshes[1]);newScene.meshes[0].receiveShadows = true;newScene.meshes[1].receiveShadows = false;//shadowGenerator.usePoissonSampling = true;shadowGenerator2.useBlurVarianceShadowMap = true;

I think the main problem was that you referenced newScene[0] instead of newScene.meshes[0]. and the [0] is the ground it seems... so you had to push the the other mesh [1]. On another note: you can't use usePoissonSampling and useBlurVarianceShadowMap at the same time as far as I know. They just overwrite each other. decide which one you want.

 

I kind of assume you can set these things up in blender and then let the exporter do that for you. but I am not sure aobut that. I think we wait for one of the blender/exporter senpais to clear that up ;)

 

Anyways, hope it helps :)

Link to comment
Share on other sites

Try that, that should work:

// Shadowsvar shadowGenerator2 = new BABYLON.ShadowGenerator(1024, light2);shadowGenerator2.getShadowMap().renderList.push(newScene.meshes[1]);newScene.meshes[0].receiveShadows = true;newScene.meshes[1].receiveShadows = false;//shadowGenerator.usePoissonSampling = true;shadowGenerator2.useBlurVarianceShadowMap = true;

I think the main problem was that you referenced newScene[0] instead of newScene.meshes[0]. and the [0] is the ground it seems... so you had to push the the other mesh [1]. On another note: you can't use usePoissonSampling and useBlurVarianceShadowMap at the same time as far as I know. They just overwrite each other. decide which one you want.

 

I kind of assume you can set these things up in blender and then let the exporter do that for you. but I am not sure aobut that. I think we wait for one of the blender/exporter senpais to clear that up ;)

 

Anyways, hope it helps :)

thanks, you help me a lot.

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