BabylonJS Sandbox - Roughness texture in UI?

Roughness texture isn’t listed in the Textures section. This seems like a bug to me?

This makes it difficult to QA glTF files, since it looks like no roughness texture was supplied in the material.

Also I can’t “solo” the roughness easily on the model, as I can with Albedo, Metalness, Occlusion, etc. I can if I drill down to the Debug option, but that’s less convenient.

If I choose the ORM texture in the Scene Explorer, then the roughness is clearly visible in the green channel:

And it does appear properly in Debug mode:

Thanks!

Example glb
roughness_spheres_glb.zip (666.0 KB)

pinging @sebavan

Actually it is normal since the roughness is pack in the metallic texture. This way, it really represents the underlying material setup helping to easily catch what could be wrong.

Do you think it is not clear enough ? Maybe we should rename the texture ?

Isn’t the texture actually three textures packed into one? Occlusion (red), Roughness (green), and Metalness (blue). At least, that’s how I’m using it.

There’s a UI control to solo the Occlusion, and another to solo the Metalness, but none to solo the Roughness.

I’d just like parity for my old friend Roughness. :slight_smile:

Are you sure it shows them in the UI, I thought it was only showing it if the equivalent property was set ?

I am afraid it will be confusing if we show unpacked packed texture, also all the interactions like replacing and so on would not be working as expected ?

Adding @PatrickRyan from the artist POV as I might be to much on the dev one :slight_smile:

Here’s an example with occlusion, roughness, and metalness packed into a single ORM bitmap.

mcrr2003.zip (843.6 KB)

Loaded into Sandbox:

  1. Display Inspector.
  2. Scene Explorer > Materials > select the material named “babylonjs”.
  3. Inspector > Textures
    (Metallic and Ambient are both shown in the UI, and each can be shown on the model using the wrench icon)


image image

  1. Go back to the material, to see the Textures list. Click on the link for the Ambient bitmap (“data:file:156865189…” )
    (the ORM texture is shown. red = ambient, green = roughness, blue = metalness)

Why can’t I do the same for the Roughness texture? It should be no different than Ambient or Metallic, according to your existing UI convention.

It would be really helpful if the ORM Roughness had the same UI treatment as the Metallic and Ambient textures.

Thank you!

It is actually because ambient and metallic are different samplers in this case.

Both the property metallicTexture and ambientTexture of the PBRMaterial are being set. You then do not have one texture but 2 of them and it is easy to identify from the inspector.

The property useAmbientOcclusionFromMetallicTextureRed is not used by the gltf loader. Adding @bghgary to see why as I can not remember ?

So basically, in this case, the inspector displays the exact material setup as well.

1 Like

@echadwick-wayfair, I spoke with @Deltakosh and @bghgary and we agree that the pattern we’ve set up by displaying the debug mode of metallic or occlusion means we should do the same for roughness. The issue was that we only have samplers for metallic and occlusion because roughness has to be packed with metallic, but occlusion does not have to be in glTF. The texture panel populates what samplers we have access to so there was a miss for roughness.

@Deltakosh is working on a fix that exposes UI around roughness like metallic and occlusion, and if you click on the texture link, you will get the metallic texture since that is where the roughness lives. This seems to fill the gap in the UI while not breaking the requirements for glTF. We are building a fix now and it should be up soon.

2 Likes

So ambient will need to do the same in this case even if packed ?

Thanks guys, good to know I’m not asking for something crazy!

1 Like

From what we saw, occlusion is already using a debug flag when the channel is isolated so it doesn’t matter if it is coming from an ORM packed file or a stand alone texture. We just added one for roughness so that metallic, roughness, and occlusion were all using the same technique.

2 Likes