Jump to content

Getting BJS shadows shown on materials with baked diffuse textures


JCPalmer
 Share

Recommended Posts

I have a test scene / .blend for checking my many changes for the Blender exporter.  One change was procedural texture baking, the other was including all the shadowGenerator options of 2.0:

post-8492-0-78541900-1437079589.png

 

One thing I did for baked textures was to not to specify the standard colors on the material that contained it.  They were already baked in.  If you do, then in BJS they're like added twice.  Everything looks very close to Blender without them.

 

When you show a shadow of something across the material, things get weird.  You only get a shadow on extreme angles.  In the test scene, the shadow falls on a multi-material, where the std mat color is like lime.  On the part of the plane not showing any texture, you get a shadow.  The other part is a bake diffuse texture.  You only get a shadow at certain angles.  See https://googledrive.com/host/0B6-s6ZjHyEwUfkxKTWU2cXZQOGxydC1KS2o0NHUzRzFUTFlNYldDUmIzZ0JxeGVqMlU3c3M

 

Here is what it looks like with the std materials in the mat with texture.  You get shadow, but the color is not the same:

post-8492-0-11309700-1437080535.png

 

I can fixed it without changing the color by substituting this for the color:

material.diffuseColor  = new BABYLON.Color3(0.8,0.8,0.8);

post-8492-0-71406700-1437088608.png

This is the correct image with shadow.  Why does this work?  Notice the brown wood floor does not have a green hue.  I do not like hardcoding a fix to something which I do not understand.

Link to comment
Share on other sites

Hey,

I'm not sure what you mean. You say the color is different, do you refer to the shadow color? I would think this is the way it should be. But I must be missing something :-). Can you upload an image of the way you think it should be? With this diffuse color fix?

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