satguru

shadow casted by mesh with skeleton not proper

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 :)

Share this post


Link to post
Share on other sites

Can you  make sure you are using the very latest 3.1? (published one hour ago)

And to make sure my code is the source of this issue can you also run your code after having ran this line:

BABYLON.Geometry.prototype._CleanMatricesWeights = function() {}

Share this post


Link to post
Share on other sites

Sorry Dk, but it's always the same.

I tried the line you also : BABYLON.Geometry.prototype._CleanMatricesWeights = function () {}

said and empty the cache.

And use last version 3.1 :  <script src="https://preview.babylonjs.com/babylon.js?<?php echo time();?>"></script>

I made a PG here :

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

5989e9c650cab_2017-08-0818_41_07-Greenshot.jpg.4d5e2b4984709bd346807308cc5ec078.jpg

Share this post


Link to post
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

 

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

Ok this was because of Chrome. Firefox was not forcing https.

Anyway, I fixed your issue as well.

By default the skin loading remains unchanged to preserve backward compatibility

@satguru: I added a new static for you: BABYLON.SceneLoader.CleanBoneMatrixWeights = true

Share this post


Link to post
Share on other sites

Yes it works now. Thanks DK, I was afraid that my model would be compromised.

For Google chrome, at home it does not force the https on the playground.

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

@Deltakosh

Ok . I will revisit my source and also checkout the code you pointed out.

Regarding specular you are right,  it is not a bone issue.

Previously when I loaded mesh they would have a specular color of #000000. Now they have #ffffff.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.