Code Monkey home page Code Monkey logo

Comments (8)

zellski avatar zellski commented on June 19, 2024 1

Stingray PBS is far and beyond the best result in general -- but yes, I definitely want the conversion to work, so I'm grateful for the .fbx that shows it failing.

from fbx2gltf.

zellski avatar zellski commented on June 19, 2024 1

I was just taking too many liberties with the conversion. I suspect I should just throw Phong -> PBR out. But until I can dig into it more thoroughly, I've bastardised the expressions I was using, kind of randomly, with the result being fairly reasonable:

image

from fbx2gltf.

zellski avatar zellski commented on June 19, 2024

I'll take a look at this shortly. That said -- does the texture actually work when you try to render the model? I noticed recently that I always write four-channel PNGs, which is pretty silly since it'll render them transparent in an image viewer. I'll file an issue to fix that, too, ASAP. :)

from fbx2gltf.

FreakTheMighty avatar FreakTheMighty commented on June 19, 2024

from fbx2gltf.

zellski avatar zellski commented on June 19, 2024

First of all, I should say, you're running into some very newly written code and it's not well tested. I appreciate the feedback & especially supplying me with a model to duplicate the problem.

But also you're running into a fundamental problem that's explained in the Readme in some detail.

GLTF 2.0 is a PBR format. There is no built-in support for traditional materials such as Phong, which this model uses. The converter tries to convert old textures, like a straight diffuse, to something that'll work okay in PBR. That's why it doesn't just copy. It does some pretty fancy calculations to come up with baseColor (albedo), roughness and metalness.

Clearly something in that process is going wrong, though, cause the whole point is that it should come up with something fairly close to the original. I will dig in later and try to work out what's failing, hopefully tonight, but I can't make promises -- it's mostly a hobby project. :)

from fbx2gltf.

FreakTheMighty avatar FreakTheMighty commented on June 19, 2024

Ah, thanks for the info. I'm exporting from Maya LT, so given what you said about having to convert from Phong I thought I would try the Stingray PBS material. Unfortunately the FBX export does something weird with the texture maps. I'll dig into this workflow a bit more.

Anywho, thanks a ton for the tool and for looking into this.

from fbx2gltf.

FreakTheMighty avatar FreakTheMighty commented on June 19, 2024

I take that last comment back, using Stingray PBS does fix the problem. That's a pretty good solution for me, though it would of course be great if it worked magic on the older materials.

from fbx2gltf.

zellski avatar zellski commented on June 19, 2024

Did a bit more digging -- this isn't a coding error, it's a problem with the underlying equations, or with how I use them here. In practice, what happens is there is no specular map; specularFactor is 1, 1, 1, 0, which means a 100% metallic material, which in turn means baseColor is entirely composed of the specular contribution, is... (1, 1, 1, 0), basically. I'm not sure what can be salvaged here -- maybe the whole silly idea was not just silly, but doomed.

from fbx2gltf.

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.