Git Product home page Git Product logo

Comments (11)

kfarr avatar kfarr commented on September 23, 2024

I tried that in a local copy and yes that "fixes" the issue (now the cubemap version looks the same as the equirectangular a-sky version). I think the question now is if sRGBEncoding should be default, up to you.

from aframe-cubemap-component.

bryik avatar bryik commented on September 23, 2024

Those discussions make it sound like texture.encoding = THREE.sRGBEncoding; should be the default, but when I tried it with the Yokohama example the resulting cubemap was darker than the original image:

image

Left is the original image, right is the rendered cubemap.

from aframe-cubemap-component.

bryik avatar bryik commented on September 23, 2024

For comparison, here is the current code (without texture.encoding = THREE.sRGBEncoding;).

image

Left is the original image, right is the rendered cubemap.

from aframe-cubemap-component.

bryik avatar bryik commented on September 23, 2024

I can certainly make texture encoding a property though.

from aframe-cubemap-component.

kfarr avatar kfarr commented on September 23, 2024

Good points all around, yes a property probably makes the most sense

from aframe-cubemap-component.

bryik avatar bryik commented on September 23, 2024

Did some more reading into this and found A-Frame's renderer has a colorManagement property that balances the darkness brought by texture.encoding = THREE.sRGBEncoding;.

<a-scene renderer="colorManagement: true">
  <a-entity cubemap="folder: /assets/Yokohama3/"></a-entity>
</a-scene>

image

I still think making texture encoding a property is the way to go, but maybe A-Frame will make colorManagement: true the default some day.

from aframe-cubemap-component.

kfarr avatar kfarr commented on September 23, 2024

Looks good! Thanks for digging in to that, and your new example showing what happens with colorManagement: true on the scene while using sRGBEncoding is helpful and accurate as far as I know.

In fact, it appears that when colorManagement: true, the A-Frame core material handlers use a helper applyColorCorrection function to set textures to sRGBEncoding, like in this example.

from aframe-cubemap-component.

bryik avatar bryik commented on September 23, 2024

In fact, it appears that when colorManagement: true, the A-Frame core material handlers use a helper applyColorCorrection function to set textures to sRGBEncoding, like in this example.

Oh interesting! Instead of an encoding property, we could retrieve the renderer system and apply color correction automatically just like the core library. I think this would actually be better!

Thanks for those links!

from aframe-cubemap-component.

bryik avatar bryik commented on September 23, 2024

@kfarr thoughts on this MR?

from aframe-cubemap-component.

kfarr avatar kfarr commented on September 23, 2024

Yes this looks great! I didn't test it but the logic seems right. I can test a little later or after you commit those changes.

from aframe-cubemap-component.

bryik avatar bryik commented on September 23, 2024

Yes this looks great! I didn't test it but the logic seems right. I can test a little later or after you commit those changes.

Cool.

I'll merge it in--we can patch it later if you find it's not working correctly.

from aframe-cubemap-component.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.