3

I tried to export GLTF model from Blender to Three.js. It works. But I have some artifacts on Three.js with lighting and painting. I have lines and squares in Three.js and I don't know why.

enter image description here

I used only Principled BSDF node in Blender to painting my model. If I set material in Three.js (MeshPhongMaterial) it works fine. But not with Principled BSDF node from Blender. Any ideas?

enter image description here

I'm trying to make the object cast a shadow and react to the lighting. This works well with MeshPhongMaterial and with Principled BSDF. But in the second option, I don't like these black stripes.

const INITIAL_MTL = new THREE.MeshPhongMaterial( { color: 0x575757, shininess: 10 } );
...
let theModel = gltf.scene;

        theModel.traverse((o) => {
            if (o.isMesh) {
                if (o.name == 'Foundation') {
                    o.material = INITIAL_MTL //Left part on screenshot with MeshPhongMaterial
                }
                o.castShadow = true;
                o.receiveShadow = true;
            }
        })

1 Answer 1

2

The usual approach to mitigate self-shadowing artifacts is to modulate the bias property of your shadow-casting light. Try it with:

light.shadow.bias = - 0.002;
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. It really solve my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.