PBR shader in viewport, roughness problem and more

   2281   3   1
User Avatar
Member
5 posts
Joined: Dec. 2023
Offline
Hi,
First of all, I have to say that I'm pretty new to Houdini.
I'm in the process of building a Houdini pipeline for WebGL models. Unfortunately, I haven't been able to get a setup in which the Houdini viewport has an almost identical display as in WebGL. We use the well-known threejs as the rendering library.

As a reference, I use the example from threejs:
https://threejs.org/examples/?q=gltf#webgl_loader_gltf [threejs.org]
The model is a GLTF sample with PBR textures:
https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/DamagedHelmet/glTF [github.com]
My goal is to have a shader/representation in Houdini that is as close as possible to this reference.


what I have already tested:
Envlight with hdri and Labs PBR shader - diffuse, metallic, roughness, ao and normal maps assigned, result:


* Roughness is presented differently
* Normal map doesn't look correct
* Emission not visible
* Colors vary greatly

After further investigation I discovered:
* metallic texture is calculated (multiplied) with metallic value, so metallic value = 1
* roughness texture is also calculated with roughness value, but I don't quite understand what principle. Example: helmet with roughness texture and value 1 and value 0:


There are also problems with the normal map, it creates a strong seam in the middle. A soft normal node fixed this but I'm not sure if that's the right way.


I also tried a setup with principledshader facing similiar problems.

Is there a way to display (real-time) PBR materials correctly in the Houdini viewport? Am I doing something completely wrong here?

Thank you for your help

Attachments:
helmet_ref.JPG (132.1 KB)
helmet_allmaps.jpg (516.7 KB)
helmet_roughness.jpg (992.7 KB)
helmet_normal.jpg (689.0 KB)

User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
Is this the Houdini SOPs viewport or the Solaris Viewport? There's a gltf materialX shader that might be worth a shot.

Edit:
Nevermind, that material does not seem to be supported by the viewport at all. The render with Mantra or Karma does look a lot like the reference however. I think due to limitations in the viewer, which doesn't render roughness or metallic correctly, previewing in OpenGL is not possible. The normal map looks correct when recomputing smooth normals and tangents with polyframe.
Edited by jsmack - Dec. 21, 2023 14:39:07
User Avatar
Member
5 posts
Joined: Dec. 2023
Offline
thanks for the answer jsmack.

Using a renderview instead of the viewport would probably be my workaround, yes.
However, I would have preferred to use the viewport directly, I thought since viewport and webgl/threejs are both set to OpenGL, a similar result could be achieved here.

I have done further tests with different shaders and also a custom shader with osl properties but as I see it the problem is always the same, namely that the OpenGL viewport does not display it correctly.
For my understanding: Even if I were to load a correct, custom pbr glsl shader into Houdini (there is an option for that) the problem would still be there, right?

Thanks for the hint about the normal workflow
User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
noobdude3d
Even if I were to load a correct, custom pbr glsl shader into Houdini (there is an option for that) the problem would still be there, right?

probably not, A glsl shader should be wysiwig. The problem stems from some simplifications in the 'Normal lighting quality' shader and the translation from the principled shader to USD. Dome lights just don't look right in reflections anymore. A workaround is to use the high quality viewport, but may still require some edits to the shader as I noticed that emission was left at 0 and the metallic and roughness textures were both connected to the red channel instead of the blue and green channels upon translation.
  • Quick Links