pmndrs / react-three-fiber

🇨🇭 A React renderer for Three.js
https://docs.pmnd.rs/react-three-fiber
MIT License
27.11k stars 1.55k forks source link

Something wrong happens with texture that passed to JSX attribute "map" of material #3246

Open krutoo opened 4 months ago

krutoo commented 4 months ago

Hi, in my project i change map of material by key press

I noticed that texture object that passed to JSX attribute "map" breaks its colors

I prepare example codesandbox: https://codesandbox.io/p/devbox/d3rwll?migrateFrom=z6qx7z

In this sandbox when you press ArrowRight texture of plane is changed to other but based on same picture (you can see keyframes constant) - just press ArrowRight multiple times

But first and second textures are different visually

Can someone explain this behavior?

m10 commented 3 weeks ago

I thnk this is a color space issue. Try texture.colorSpace = SRGBColorSpace; or maybe material.toneMapped = false;

https://codesandbox.io/p/devbox/test-of-initial-jsx-attr-map-value-of-material-forked-cd5gg5