noname0310 / babylon-mmd

babylon.js mmd loader and runtime
https://noname0310.github.io/babylon-mmd/
MIT License
123 stars 5 forks source link

Model texture .tga format supports #9

Closed spencer17x closed 1 year ago

spencer17x commented 1 year ago

playground:https://playground.babylonjs.com/#ZF86YL#17

expect:

image
noname0310 commented 1 year ago

image There doesn't seem to be a problem

If you created an issue because of alpha blending, it is a problem that cannot be completely solved.

The method I recommend the most is to do fix material on the BPMX converter. https://noname0310.github.io/babylon-mmd/docs/deep-usage/convert-pmx-model-into-bpmx/

Consider about how to solve it with hardcoding too. https://noname0310.github.io/babylon-mmd/docs/quick-start/troubleshooting-shading-artifacts/#transparent-artifacts

spencer17x commented 1 year ago

Have you tested whether either of these options works?Do you think it's a problem with the model itself?If you think this is a problem with the model itself, why does this work well on mmd's software?

spencer17x commented 1 year ago

It also displays normally in blender:

image
spencer17x commented 1 year ago

At babylon-mmd@0.6.0, it is also displayed normally:

image
noname0310 commented 1 year ago

Upon analyzing the cause, it seems that the model is using the TGA image format. I will look into ways to provide support for it.

And creating an instance of the PmxLoader is no longer a normal way of using the loader.

const pmxLoader = new PmxLoader();

Instead, side effects should be used.

import "babylon-mmd/esm/Loader/pmxLoader";

const pmxLoader = SceneLoader.GetPluginForExtension(".pmx") as PmxLoader;
spencer17x commented 1 year ago

I tested it and it didn't work

noname0310 commented 1 year ago

That is not directly related to the problem.

I'm working on this right now.

noname0310 commented 1 year ago

https://github.com/noname0310/babylon-mmd/commit/ad9f4516c0a0ac9a7e80359ccbecbeac32c0830b

This commit will resolves the issue.

spencer17x commented 1 year ago

ad9f451

This commit will resolves the issue.

0.23.0 resolved.