Skip to content
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

Objects too bright in Three.js r152dev #25917

Closed
andreasrosdal opened this issue Apr 24, 2023 · 5 comments
Closed

Objects too bright in Three.js r152dev #25917

andreasrosdal opened this issue Apr 24, 2023 · 5 comments

Comments

@andreasrosdal
Copy link
Contributor

andreasrosdal commented Apr 24, 2023

Description

Objects loaded from Gltf too bright in Three.js r152dev.

Reproduction steps

This is a change in Three.js r152 dev version.
Could it be related to the colour space changes going on?

Code

https://github.com/fciv-net/fciv-net/tree/main/freeciv-web/src/main/webapp/javascript/webgl

Screenshots

bilde

Version

r152dev

Device

Desktop

Browser

Chrome

OS

No response

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 24, 2023

Could it be related to the colour space changes going on?

Potentially, yes. Can you please share the code that shows how you setup and configure your renderer? Besides, have you already enabled color management in your app (see https://threejs.org/docs/index.html#manual/en/introduction/Color-management)?

BTW: Sharing the entire code base of your app is not appropriate since we don't have the resources to study your implementation. So please us the fiddles in the issue template to demonstrate problems (there is a template which points to dev already).

@donmccurdy
Copy link
Collaborator

donmccurdy commented Apr 24, 2023

Hi @andreasrosdal – as you noticed, there are a lot of color management changes in r152. These are intentional, and because you aren't already using renderer.outputEncoding = sRGBEncoding, they will lead to some lighting differences. I've written a longer guide to the migration here:

https://discourse.threejs.org/t/updates-to-color-management-in-three-js-r152/50791

Hopefully the guide will answer most of your questions, but feel free to follow up in the forums with further questions, or we can reopen this if there does appear to be a bug.

Aside — I noticed you're using Reflector.js and Refractor.js. I have not had time to update those examples yet, and it's possible they will require changes. You can opt-out of these changes (other than the renamed properties) if you prefer.

@donmccurdy donmccurdy closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2023
@mrdoob
Copy link
Owner

mrdoob commented Apr 24, 2023

@andreasrosdal Please let us know what did you have to change to restore your colors when you figure it out.

@andreasrosdal
Copy link
Contributor Author

andreasrosdal commented Apr 27, 2023

I have now updated FCIV.NET to Three.js r152, and I restored the colours. I would have liked to enable ColorManagement to get the most realistic and beautiful colours. However, for now I chose to opt-out of ColorManagement.

I would very much appreciate any advice about how to improve FCIV.NET, specifically how to improve performance and make the game more beautiful. I think full support for WebGPU in Three.js will help, and a module build of Three.js with WebGPU support so I don't have to load it manually. Further, I wish there was better API support for instancing of objects loaded with GLTFLoader, so that game units loaded as GLTF objects would be instantiated only once, possibly there is an example of how to implement this.

This is what FCIV.NET looks like now:
bilde

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 27, 2023

I would very much appreciate any advice about how to improve FCIV.NET, specifically how to improve performance and make the game more beautiful.

Please redirect such support requests to the forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants