Jump to content

shadow casted by mesh with skeleton not proper


satguru
 Share

Recommended Posts

ok let me give you more context on the initial bug fix.

The bone used by  @satguru was incorrect because the bones were not completely influencing the mesh (ie the sum of matrices weight was not 1 but something like 0.98)

So I fixed it with a check while loading files: if the sum is not 1 then I fix the latest weight: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.geometry.ts#L982)

But seems like it was not such a good idea :)

Link to comment
Share on other sites

My PG example works with http. At home it works PG. You can use http.I have no virus on my link

I do not understand well. My character is perfectly made, the mesh is 100% influenced by the bones (Model buy to a professional, realized with 3ds max). I use it for 5 years without ever any problem, even with Babylon. This always works well. And now not work.

I suppose there is another problem. I use 3ds max, and satguru, blender. So anyone who uses 3ds max, will have their model animate like this? The previous version of Babylon works. Why more now?

http://www.babylonjs-playground.com/#GA8XI#87

Try without https

This always works for me and now that a problem is settled for satguru, this does not work for me anymore. It's my model that has a bug that has still worked well for years.

version 3.0 on PG work (screen left) , but not version 3.1(screen right) :

598a039f95904_2017-08-0820_31_22-Greenshot.jpg.eae45d010b29d09e1c45a42051f38ebc.jpg 598a044545e52_2017-08-0820_34_08-Greenshot.jpg.cf935027bca0f041e6538665f6f6e49a.jpg

 

Link to comment
Share on other sites

@Deltakosh, @Dad72, and @satguru

Well here is Vincent again using the latest preview version of BJS ( which I have renamed to "babylon.3.1-alpha1.js" to avoid overwriting my previous version which I know worked fine)

New Vincent

I also checked the .log file for vertex influencers (bones I assume)

Avg # of influencers per vertex:  1.1592
Highest # of influencers observed:  2, num vertices with this:  776
exported as 2 influencers

Nothing extraordinary there.

cheers, gryff :)

Link to comment
Share on other sites

@Deltakosh, Yes that worked to an extent.

But still not there.

When I use 

"BABYLON.SceneLoader.CleanBoneMatrixWeights = true"

The uv texture  is messed up.

See bad_texture.jpg 

Without the line I get good_texture.jpg

Also the the specular color is now set to white.

As a result meshes end up being very shiny.

Previously it used to be black.

bad_texture.jpg

good_texture.jpg

Link to comment
Share on other sites

This is not a magical tool unfortunately. The data is broken at the source. You need to clean up your model because I will not be able to provide better automatic support

The code for the cleaner is here so you can understand what it tries to do:

https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.geometry.ts#L982

 

Regarding shininess this is not related to the bones issues. There must be a difference in the file as specular was not changed recently. What are the value of your specular setup?

Link to comment
Share on other sites

  • 1 month later...

I have this annoying bug with skeleton meshes too!
The model not changed, since about april, but the shadows are kind of "inverse" now.
The shadow is correctly animated (moving) but inverse.
The shadows were working before.

If I set skeleton=null, the shadows are correct.
Tried to re-export from Blender with 5.4 export, but stays the same.
tried setting BABYLON.SceneLoader.CleanBoneMatrixWeights = true but the mesh was distorted.
The meshes are imported with  loader.addMeshTask(... 

-images with and without skeleton.
-zip of .babylon file


How can I "clean" the mesh source?
I think this is not the problem of the model, this model worked before.
 

whiteshadow.jpg

normalshadow.jpg

goblin.zip

Link to comment
Share on other sites

The playground is in text.
I re-exported this vincent now from blender, with 5.4 exporter.
And started an animation and it is not right at all.
So, something is wrong with this vincent model or the exporter.

But... how it is possible thet the same model, (my goblin) was working with shadows with previous babylon js versions?
Something did change that make it impossible to export the modelfrom blender and importing it to babylon with animations and shadows.
 

 

pcode

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