How to export jpegs instead of PNGs from 3ds max

Morning,

Firstly the 3ds max Babylon exporter is is amazing, Our dev has noticed that all our exported textures are being converted from jpeg to png. Is there a way to have them export to jpeg instead to keep the file size down? We’re exporting to .glb as well.

Cheers

Please do not forget to add a link to a Playground to get a faster answer:

Hello and welcome to the Babylon community! ccing @PatrickRyan

@Stocktonios, welcome to the Babylon.js community! Unfortunately, we don’t write out textures to .jpg format in our exporters. Part of that reasoning is that .jpg is only appropriate for the color data textures such as base color (albedo) and emissive textures. This is because all of the non-color data textures - normal or channel packed occlusion, roughness, metallic - will suffer from the .jpg compression “cross-talk” between channels. The compression evaluates across all three channels for compression values, and for non-color data like a normal texture, that will change the normal vector contained in the pixel. This is why we use .png files as the compression in that format is lossless and does not compress across channels.

Though I also understand the need to keep file sizes down for color data textures and using .jpg for that is preferable. The pipeline that I use when I need to reduce file size through compression is to export to .glTF instead of .glb because you can replace the textures linked in the glTF with anything you want. If you do change to .jpg, a quick edit of the .glTF json to update the extension will be needed. You can then compress to .glb using bghgary/glTF-Shell-Extensions: Microsoft Windows shell extensions that pack .gltf to .glb and unpack .glb to .gltf (github.com) that was written by one of our team members.

I understand this workflow isn’t as easy as a direct export. Unfortunately, we are no longer going to be developing our Autodesk exporters which you can read about at No Longer Actively Supporting Autodesk Exporters

I wish there was a better answer here, but hopefully we will see native export in Max in the near future.

2 Likes

You can also use glTF-Transform to manipulate the gltf/glb to convert the textures.

3 Likes

Works Perfect!!

The best choice to optimize