enable3d / enable3d

🕹️ Standalone 3D Framework / Physics for three.js (using ammo.js) / 3D extension for Phaser 3
https://enable3d.io
GNU Lesser General Public License v3.0
989 stars 95 forks source link

Black or dark display problems. #71

Closed xx0618 closed 3 years ago

xx0618 commented 3 years ago

It is found that it is normal when displaying light colors, but when displaying black or dark colors, the texture will be indistinguishable. I don’t know which setting is wrong? How to deal with it?

This is a black 3D file heise

This is a light-colored coat with dark buttons, the buttons can no longer see the texture yanse

Original texture of buttons 微信截图_20201221155941

yandeu commented 3 years ago

In the next version, enable3d will use the default three js setting for colors.

If you then still have issues, please use the three.js forum to solve it.

xx0618 commented 3 years ago

Looking forward to version 0.21

vitalspace commented 3 years ago

when enable3d forum?

yandeu commented 3 years ago

when enable3d forum?

I don't have the time to manage a forum. And most questions a related to three.js anyways.

yandeu commented 3 years ago

Looking forward to version 0.21

v21 is available. Check if it helps, otherwise, consider asking in the three.js forum.

xx0618 commented 3 years ago

Version 21 is great. The dark 3D model has been improved, but it is not ideal. 微信截图_20210105103313

xx0618 commented 3 years ago

I found it on the Internet that the gltf 2.0 model is dimmed, but I don't know how to solve it. What can I do?

vitalspace commented 3 years ago

Surely in the Three js forum you will find an answer to this.

xx0618 commented 3 years ago

Found a way. Need to be set in the renderer:

this.third.renderer.gammaOutput = true
this.third.renderer.gammaFactor = 2.2
xx0618 commented 3 years ago

The above method makes the color not dark, but the color is somewhat white. Adding the following sentence can make the color return to normal.

const material = new THREE.MeshStandardMaterial({ color: 0xff0000 })
material.color.convertSRGBToLinear()
const texture = new THREE.TextureLoader()
texture.enccoding = THREE.sRGBEncoding