Code Monkey home page Code Monkey logo

Comments (6)

gpablo-genies avatar gpablo-genies commented on June 14, 2024 1

UnityGLTF-Smoothness2Roughness-Test.zip (2022.3.17f1)

@hybridherbst I'm including a zip with a testing project. It contains a scene with a simple quad using the URP/Lit material with a plain metallic-smoothness map (metallic set to 1 and smoothness to 0.2). The project contains the dev branch of UnityGLTF as an embedded local package in the Packages folder, with no modifications (except a test Debug.Log to see when we use the gloss-roughness swap material to process a texture).

I did two glTF exports of the quad that you can find in the Assets/_Exports folder:

  • CurrentExport: the quad exported with no modifications on the UnityGLTF package. Put it on the scene and compare to the original quad, you will see how the roughness looks different.
  • FixedExport: he quad exported with the GammaToLinearSpace line removed from the shader. It looks identical to the original quad.
  • GLB-Export: for some reason GLB exports are not using the shader so removing the line will do nothing here. GLB exports are also exporting the roughness incorrectly.

Screenshots of original vs current vs fixed exports:

Original Current Export Fixed Export
image image image

Notes: I cannot share the models that I used originally to debug this issue, but I would like to mention that in that case the roughness difference is huge (a character with a really glossy skin when exported). For that project I used the latest Unity 2021 LTS.

from unitygltf.

gpablo-genies avatar gpablo-genies commented on June 14, 2024 1

I can confirm that the issue is fixed in the latest HEAD from the dev branch. Thank you so much!

from unitygltf.

hybridherbst avatar hybridherbst commented on June 14, 2024

it always outputs an incorrect map

The colorspaces for exported textures have underwent pretty rigorous testing for linear color space correctness, including automated tests. Could you add a model where you see that issue and a video of it? Thanks!

We will also triple check the tests here to ensure nothing new has crept in.

from unitygltf.

gpablo-genies avatar gpablo-genies commented on June 14, 2024

Will try to provide the models this week, but may delay to next. Anyways I want to point out that the returned color by the tex2D sampler method will always be in linear space when the project is set to linear mode. So it really makes no sense to make the GammaToLinearSpace correction here (maybe it should be at the other side of the #ifdef?)

from unitygltf.

pfcDorn avatar pfcDorn commented on June 14, 2024

Hey, can you please retest it with the new latest version?
I tested it with your sample and it seems to works fine now :)

from unitygltf.

pfcDorn avatar pfcDorn commented on June 14, 2024

Happy to hear :)

from unitygltf.

Related Issues (20)

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.