L3DT users' community
Large 3D terrain generator

32-bit image formats

It doesn't hurt to ask...

32-bit image formats

Postby Telarus » Mon Nov 08, 2010 3:22 am

Hi Aaron,

I've been experimenting with a Mud Box and Maya workflow that incorporates L3DT, and one of my biggest bottlenecks is getting an accurate representation of the height field into either Mud Box or Maya.

The issue is that both software packages have a known "stepping" issue with 16 bit file formats, and recommend using 32-bit formats such as open .exr to achieve smooth displacement when rendering (with Mental Ray).

So far, I've gotten around it with this test terrain. I exported the heightfield from L3DT in a RAW 16 format (because my height range was 1m to 513m, and the map res was 1m/px, nothing lost).

Then I used Photoshop to open the RAW 16 file (photoshop can't open the RAW32 files that L3DT exports). I then converted this into RGB 32-bit mode, and saved it out into an *.exr file.

I was then able to get it into MudBox as an image-displacement (in order to generate a low poly version of the terrain, and bake the high-poly details into a displacement map). I export the low-poly terrain and the detail map, import into Maya and render with Mental Ray.


Would you be able to add an export function for *.exr? I'm not sure what other format would be best......
Telarus
Doyen
 
Posts: 112
Joined: Mon Jun 01, 2009 12:34 am

Postby Aaron » Tue Nov 09, 2010 12:20 pm

Hi Telarus,

Thanks for the request. I've popped EXR onto the to-do list.

That said, I am a little surprised you're having trouble with precision in 16 bit files. A 16 bit integer file will represent your 1->513m heightfield with a precision of about 8 millimetres (one part in ~65 thousand), which shouldn't produce noticeable steps, assuming all the software in the toolchain is well-behaved.

Indeed, converting the 16 bit RAW file into a 32 bit EXR shouldn't remove the stepping artefacts or improve the precision of the heightfield. The 16 bit quantisation will have baked the (admittedly tiny) steps into the heights, and blowing the pixels out to 32 bits won't remove that quantisation.

If I had to guess why you'd be seeing stepping artefacts with 16 bit heightmap files, I'd say it's because some part of the toolchain (or the renderer, or importer plugins, etc.) load 16 bit images into memory as 8 bits per pixel.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby Telarus » Tue Nov 16, 2010 2:24 am

Well, the above workflow ended up not working. It seems Photoshop does some scaling and compression to 16 bit images when you convert to 32 bit (the histogram changed noticeably).

Mental Ray (the rendering engine I'm using) seems to be "allergic to tif compression", amongst other quirks in it's displacement mapping pipeline. We're still playing around with the terrain workflow at school to see where the stepping might come from.


Since the above didn't work out, I've moved on to:

- export raw undecimated mesh .obj from L3DT, import into Maya.

- align a poly-plane @ 50% height to the mesh object, use Maya's very quirky "Transfer Maps" tool to bake out a 32bit .exr displacement.

- open Mudbox, create a new plane object, subdivide (again and again, until mesh rez = heightfield rez).

- import 32bit .exr as a "deform layer", then crank the 'layer Alpha' up to the vertical height-range to get correct vertical offset.

- step dynamic mesh back to 32x32 verticies.

- bake out a 32bit .exr displacement map of the DIFFERENCE between the 32x32 simplified mesh, and the full rez heightfield (let's call this terrainDetail_Disp.exr).

- export the 32x32 mesh as a .obj.

- import 32x32 mesh into Maya, setup Sun and Sky light-bounce engine.

- link the terrainDetail_Disp.exr file to mesh Shader as a Displacement, setup mentalRay displacementApproximation node (this is the touchy node).

- Render with props and objects, thusly:
Image


Still, thanks for throwing EXR on the todo list. Appreciate it!
Telarus
Doyen
 
Posts: 112
Joined: Mon Jun 01, 2009 12:34 am

Postby Aaron » Wed Nov 17, 2010 1:58 am

Hi Telarus,

Lovely work. The shiny Athena statue is a nice touch.

I'm not that familiar with PhotoShop, but I'm guessing when you convert the image to '32 bit mode', it's not making a single 32-bit image plane, but rather four 8-bit planes for red, green, blue and alpha. This would mean that the greyscale values in the heightmap would only be encoded with 8 bits of precision, and this would create your stepping artefacts. That's my guess anyhow.

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby Telarus » Sat Nov 20, 2010 5:32 am

Thanks aaron. Here's an updated render of the scene.

Image
Telarus
Doyen
 
Posts: 112
Joined: Mon Jun 01, 2009 12:34 am


Return to Feature requests

Who is online

Users browsing this forum: No registered users and 6 guests

cron