PDA

View Full Version : Reverse Engineer a Displacement/Bump Map


Wheeler
07-24-2003, 09:55 AM
I saw a thread on this once, but I can't find it now. I have some geometry I want to replicate in a displacement map. There was a tip about adjusting lighting and fog in Layout to create this. Anyone remember how to do it? Thanks!

Neil_Campbell
07-24-2003, 10:56 AM
Rotate your surface so it's normal to the camera - ie facing it so the displacement is 'coming towards' the camera. Switch lights off. Set up render passes and export a depth map - you should end up with a greyscale image that reflects the displaced height of the object. You will probably want to do a levels adjustment in Photoshop to get more 'stretch' to the greyscale. Then you can just map that image onto the new geometry.

Alternatively if you want a bit more control in LW without needing Photoshop levels, line up the camera and object as before, place 2 nulls in the scene, one on the highest bit of geometry that's nearest the camera and one on the lowest bit - then add fog and set the min and max distances to correspond to the distance from the camera to the high and low nulls. Make your object luminous white, fog and background black - render - the object should get darker with distance - one displacement map.

Wheeler
07-24-2003, 11:14 AM
You'll have to bear with me on this. I've got it placed and the lights are off. I'm confused about render passes and exporting the depth map. BTW...thanks for the quick response.

Neil_Campbell
07-24-2003, 11:36 AM
Under the Scene > Image Process tab, add an image filter -t's called Buffer View I think

Double click to open Buffer View and check the Depth tickbox

Now when you render you'll get a black image, but in Image View select the layers pulldown and you should see something like Unnamed_003 and also Depth - select that and you've got a depth map.

UnCommonGrafx
07-24-2003, 11:43 AM
Today is a lw learning day!!

That is very cool. Buffer view, the technique. Cool looking at all those buffers as inputs on my VT.

Thanks!

Neil_Campbell
07-24-2003, 11:55 AM
The fog method gives more control over the level of contrast you get with the object. Those nulls and the linear fog can be used to make the top of the object white and the bottom of the object black (where by top and bottom I'm referring to the height of displacement, if that's not turned all your axes around :) ). The one problem with the fog approach is that it's conic rather than linear. What I mean is that a flat plane placed normal to the camera axis will not render at a constrant shade of grey, because the edges are actually further away than the centre (basic pythagoras) and so are shaded more darkly than those near the centre. How acceptable that is will depend on the geometry you're trying to model and the accuracy you need.

So in some respects it might seem that Buffer View is the better method for getting reverse engineered depth maps. but with this method you don't have the control over the greyscale contrast, so if your object is relatively shallow (ie there's no much height variation across it), the depth map won't have much detail in it (in terms of different shades of grey), and there's only so much you can do in Photoshop to stretch it. Although rendering in Image FP gives you more lattitude. And you could scale it along the camera axis, to pull the near geometry closer to the camera (ie make it whiter) and push the far geometry halfway to infinity (ie make it blacker), just be careful not to use too wide angle a lens because you'll get some distortion and you'll lose some geometry.

It depends on the geometry which is best.

Neil_Campbell
07-24-2003, 12:23 PM
Thinking about the problem with fog, that can be largely overcome by narrowing the conic angle - drag the camera waaay out away from the object, and then zoom it back in again - now the off-axis fog distance will be almost the same as the on axis fog distance, so a flat plate will render as uniform grey

Neil_Campbell
07-24-2003, 12:24 PM
Or just put a gradient in the luminosity channel, key the luminosity off the distance from the near null to the far null and another depth map results

Wheeler
07-24-2003, 12:28 PM
Man, Neil...you Rock! These solutions are perfect! Thanks again.

Neil_Campbell
07-24-2003, 12:44 PM
You're welcome