-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About Light Sources #16
Comments
Codes already tried
I would appreciate any advice you could give me. |
This appears to happen when the diffuse color of the model's material is not (1, 1, 1). Some MMD models use the approach of setting the diffuse color to (0.5, 0.5, 0.5) and the ambient color to (1, 1, 1) to create a material that looks bright in the dark. However, if we simply import the deffuse and ambient parameters into the StandardMaterial in babylon.js, we will get different lighting results due to the different way ambient color works in babylon.js. In simple terms, this is due to the different behavior of babylon.js and MMD materials, option1: const pmxLoader = SceneLoader.GetPluginForExtension(".pmx") as PmxLoader; // If you're using a bpmx loader, modify this
const pmxMaterialBuilder = pmxLoader.materialBuilder as MmdStandardMaterialBuilder;
pmxMaterialBuilder.afterBuildSingleMaterial = (material): void => {
material.diffuseColor.add(material.ambientColor);
material.ambientColor.set(0, 0, 0);
}; option2: scene.ambientColor = new Color3(1, 1, 1); The second option is theoretically similar to MMD, although the first option usually yields better results If you have any other questions, feel free to open an issue and I'll get back to you shortly. |
If you're using post-processing, tone mapping may be the cause defaultPipeline.imageProcessing.toneMappingEnabled = false; |
In 0.41.0, the renderer code was refactored across the board, and you should now see exactly the same results as MMD. |
I imported a PMX MMD stage and the colors look a little pale.
I tried changing the light code to look like the official page, but it didn't cure it.
On this page the colors appear as normal. Is there something wrong with the light code?
The text was updated successfully, but these errors were encountered: