PDA

View Full Version : producing displacement maps in lightwave? not so simple apparently.



Dennik
12-01-2012, 06:44 AM
I'm trying to do something (I thought was) simple, such as render a displacement map, by applying a linear gradient node on the model that receives an input from the y channel of the spot info node and rendering it using an orthographic camera.
It seemed like a easy solution however there is something definitely non linear in the output and I just can't figure it out. Also that pattern produced on the displaced model is something I'd like to remedy as well.
Does anyone have an idea what's going on?
109544109545

Sensei
12-01-2012, 07:25 AM
Color space correction turned on?

Kaptive
12-01-2012, 09:35 AM
You should have a read of the thread about the prometheus technique that is currently running... it just so happens that this is part of it. Instead of using gradients, you render out a depth map.

Image processing tab/add Image filter/Compositing Buffer Export.
Double click it once added, and select depth.
Render what you want as a depth map (head on without perspective (so move the camera really high and zoom in)).
In the image viewer (once rendered), go to your layers (top right) and select the one with depth in it.

Save that image out as a .EXR and now you should have an accurate displacement map!

Hope that helps!

Dennik
12-01-2012, 10:33 AM
Hmm. I switched to sRGB output and saved to a 48bit format instead of 24bit and that took care of most of the problems. The circular patterns are gone but the color range is still a bit off though. Close but slightly off.
109550

Sensei
12-01-2012, 10:36 AM
Hmm. I switched to sRGB output and saved

Turning off color space correction means NOT using sRGB...

Dennik
12-01-2012, 12:03 PM
Turning off color space correction means NOT using sRGB...
If I turn everything to linear on the CS panel, and save in linear, the displacement is wrong. If I keep everything linear and save in sRGB, the displacement is closer than any other setting. Don't know why but that's the case so far. Actually the only setting that makes a difference in the CS panel, is the "float files" that needs to stay in linear.
Here is the scene for you to look at.
109554

Dennik
12-01-2012, 12:37 PM
You should have a read of the thread about the prometheus technique that is currently running... it just so happens that this is part of it. Instead of using gradients, you render out a depth map.

Image processing tab/add Image filter/Compositing Buffer Export.
Double click it once added, and select depth.
Render what you want as a depth map (head on without perspective (so move the camera really high and zoom in)).
In the image viewer (once rendered), go to your layers (top right) and select the one with depth in it.

Save that image out as a .EXR and now you should have an accurate displacement map!

Hope that helps!

Thanks. I missed that thread. It does indeed render exactly the same image with the depth buffer, but with some artifacts.

Sensei
12-01-2012, 12:37 PM
Ah, so you're writing image to floating point, and loading from floating point image format. So all CS settings except Float Files are meaningless. I thought you're using normal PNG, JPG or so.

Use Texture Amplitude 0.215 instead of 0.2 and they match.

Dennik
12-01-2012, 01:22 PM
Ah, so you're writing image to floating point, and loading from floating point image format. So all CS settings except Float Files are meaningless. I thought you're using normal PNG, JPG or so.

Use Texture Amplitude 0.215 instead of 0.2 and they match.
Nope. If I match the high dome, the other domes get displaced higher than the original object.

probiner
12-01-2012, 01:52 PM
Keys smoothing/interpolation?
Try Linear instead of Spline/Hermite/Bezier

Cheers

Sensei
12-01-2012, 01:59 PM
Forget about Displacement Texture. I find it unpredictable.
I used Deform Node Editor instead.
But have to not use UV mapping, but Planar mapping.

109559

Dennik
12-02-2012, 06:27 PM
Forget about Displacement Texture. I find it unpredictable.
I used Deform Node Editor instead.
But have to not use UV mapping, but Planar mapping.

109559

Thanks Sensei. This works great! Finally an accurate result. Kinda strange how the other methods came close to accurate but not quite there.

dsol
12-03-2012, 09:06 AM
Render what you want as a depth map (head on without perspective (so move the camera really high and zoom in)).

Couldn't you just render using the Orthographic Camera? That will give you a mathematically precise dead-on view.