Labs Maps Baker / Normal Output 8bit / GLTF/GLB Problem

   1680   4   2
User Avatar
Member
5 posts
Joined: Dec. 2023
Offline
Hi,
we use the LabsMapsBaker in Houdini 20.0.500 to bake normal maps from highpoly to lowpoly and export it to GLB. Viewing the GLB in a web viewer it shows artifacts like this:


The normal map itself looks fine. So I made some tests and I think the problem is that the GLB export will convert the 16bit normal map (output of the baking) to 8bit which will result in the shown artifacts.
I get the same problem when I export the GLB from Blender - so looks like the normal map needs to be 8bit.

I converted the 16bit normal map with photoshop to 8bit and exported again - the result now looks fine:


So I added a convert node to the cops_baking inside the MapsBaker to convert the given input to 8bit. However, the output of this normal map will result in the same (bad) output.

So in summary: The normal manually converted from 16 to 8Bit in photoshop is working with GLB output, while the conversion to 8bit with a convert node in the cops_baking network is causing problems.


Any ideas?
Edited by noobdude3d - Aug. 23, 2024 08:17:50

Attachments:
normal_issue.JPG (43.8 KB)
normal_good.JPG (44.0 KB)

User Avatar
Member
654 posts
Joined: Aug. 2014
Offline
When Houdini converts from 16 to 8-bit texture no dithering is applied. That's the problem.

You don't need Photoshop to apply it. For example, you can use one of the tools provided by OpenColorIO:
oiiotool input.png -d uint8 -dither -o output.png

It can be put anywhere in your pipeline, but before the GLTF export. Perhaps as a pre-render script in ROP GLTF Output, PDG task, or someplace else.
User Avatar
Member
5 posts
Joined: Dec. 2023
Offline
Wow, thanks for the explanation. I probably wouldn't have thought of that...I'll integrate that into our pipeline, thank you very much!
User Avatar
Member
143 posts
Joined: June 2024
Offline
ajz3d
oiiotool input.png -d uint8 -dither -o output.png
Hell, how do you know that, man?
User Avatar
Member
654 posts
Joined: Aug. 2014
Offline
The command? I know it from OIIO docs [openimageio.readthedocs.io].

I guess one could also use ImageMagick:
convert input.png -depth 8 -dither FloydSteinberg output.png

But for some reason it never worked for me (no dithering is applied).

There are even TOPs for ImageMagick and OpenImageIO.
  • Quick Links