Comments (4)
Codes already tried
const hemisphericLight = new HemisphericLight("HemisphericLight", new Vector3(0, 1, 0), scene);
hemisphericLight.intensity = 1;
hemisphericLight.specular.set(0, 0, 0);
hemisphericLight.groundColor.set(1, 1, 1);
const directionalLight = new DirectionalLight("DirectionalLight", new Vector3(0.5, -1, 1), scene);
directionalLight.intensity = 1;
directionalLight.shadowMaxZ = 20;
directionalLight.shadowMinZ = -15;
const directionalLight = new DirectionalLight("DirectionalLight", new Vector3(0, 75, -130), scene);
directionalLight.direction = new Vector3(100,-75,-260)
directionalLight.intensity = 10000;
directionalLight.autoCalcShadowZBounds = false
directionalLight.autoUpdateExtends = false
directionalLight.shadowMaxZ = 1000
directionalLight.shadowMinZ = -1000
directionalLight.orthoTop = 1000
directionalLight.orthoBottom = -1000
directionalLight.orthoLeft = -1000
directionalLight.orthoRight= -1000
directionalLight.shadowOrthoScale = 1000
const shadowGenerator = new ShadowGenerator(2048, directionalLight, true,);
shadowGenerator.usePercentageCloserFiltering = true
shadowGenerator.filteringQuality = ShadowGenerator.QUALITY_HIGH
shadowGenerator.forceBackFacesOnly = false
shadowGenerator.frustumEdgeFalloff = 0.1
shadowGenerator.bias = 0.01;
I would appreciate any advice you could give me.
from babylon-mmd.
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,
and can be resolved by applying either of the two codes below.
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.
from babylon-mmd.
If you're using post-processing, tone mapping may be the cause
defaultPipeline.imageProcessing.toneMappingEnabled = false;
from babylon-mmd.
In 0.41.0, the renderer code was refactored across the board, and you should now see exactly the same results as MMD.
from babylon-mmd.
Related Issues (20)
- Whether there are plans to support vmd animation HOT 5
- Uncaught TypeError: Cannot read properties of undefined (reading 'errorTextureDatas') at _MmdAsyncTextureLoader._addErrorTextureReferenceCount HOT 3
- Texture load/shader compilation delay HOT 17
- The model in the form of file cannot be loaded normally HOT 1
- Whether other character models can load vmd animation format HOT 3
- Submesh optimization HOT 3
- Is there a way to bind or attach a pmx model to the bones of a character model? HOT 1
- Animation timescale modification HOT 1
- Integrating BPMX Model Files into Private PNG Chunks to Display Previews HOT 4
- The project won't work HOT 16
- Hair is flying arbitrarily around HOT 5
- BPMX and BVMD directly from the application HOT 2
- Original MmdMesh Object Fails isMmdSkinnedMesh Check After Creating MmdModel HOT 3
- How do I drive the model HOT 12
- Physical engine drive problem HOT 14
- A Big Shoutout to the Amazing babylon-mmd Repository! HOT 1
- Whether there are plans to support the pmd format HOT 4
- Animation Blending HOT 9
- Model texture .tga format supports HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babylon-mmd.