Not getting proper metal roughness texture out of Unity Toolkit

Hi @MackeyK24 (or anyone else who knows the Unity exporter) I’m using your Toolkit to export scene geometry and lightmaps, but I’m having trouble getting accurate metallic roughness textures.

Here is a test model in Substance Painter with 3 full metal spheres, with roughnesses of 0, 0.33, and 0.67 respectively:

When export my textures and place everything in Unity I get this (so far so good):

…but when I export to BJS from the Babylon Toolkit, I get this:

Any ideas what I might be doing wrong? Thanks.

Can you zip up the project and send d to me?

DM’d you a link, thank you!!

Yo @papajuan … so there are some differences in the lighting and material systems.

I cant tell whats is going on Blender but re-setup the project and disabled specular highlights as i dont really support those right now. and even with the metallic textures and the extra row i made without using flat roughness values (0, 0.33 and 0.66) they seem to be working as expected except for the level of the reflections. In unity, the more rough the material the less of the reflection environment texture you see (looks like its faded and blurred the rougher it is). The default render model for pbr materials dont do that out-of-the-box. I am looking into to see there is anything that can be done.

For your reference, you can follow my questions here:

and this one here:

Thanks for digging into this. Idk what the hell I’m talking about here, but in case it’s of any help, I noticed that I get slightly different metallic roughnesses textures exporting to BJS directly from Substance Painter versus the BJS Toolkit:


When I smuggle in the metallic roughness from Substance Painter into BJS, I get the correct reflections:


Wild hypothesis: is it a gamma space vs linear space issue? I ask only because I noticed that when I take the metallic roughness texture generated by the Toolkit and “de-gamma” it in Photoshop (basically applying a the inverse-gamma gamma value of 0.4545) I get a metallic roughness texture that is identical to what I’m getting out Substance Painter, and the BJS reflections match what I see in both SP and Unity.

Yo @papajuan

The above reflection texture does NOT look like the scene you sent me.

Can you send me this exact scene with this environment texture you are using so I can see the same cause and effect you are getting.

May we can hope on google meet and knock this out once and for all

omg :man_facepalming: sorry, that metal rough texture was from another test. HOWEVER, the same issue is present in the project I sent you.

In case it’s helpful, here is a visual summary of all of my tests so far:

TL;DR: it seems like the Toolkit is treating the metal rough texture as a color image (gamma space) rather than non-color data (linear space). When I correct for that, it all works. (The specular thing seems like a separate issue)

YES I’d be happy to hop on a call to sort this out; we can coordinate over DM. Thanks so much for helping me out w this!!