View Full Version : can u seperate a render based on distance to camera?

05-09-2004, 09:25 PM
i don't think this is possible but i thought it wouldn't hurt to ask....I want to seperate the foreground and the background into 2 seperate renders. however the foregound and background are part of the same object and so not seperatable in terms of rendering only one object or the other.

i guess i better specify: i have about 8 capsule shapes arrayed to form a ring. there are about 4 layers of these. they rotate, and while the camera sees 1 in the foreground there are about 20 in the background.

I really need to seperate them in the render so i can treat them differently later on. But as the "foreground" capsule will, upon rotation, later be a background capsule and is all part of one object, i can't do it by conventional methods.

the only way i can think of is if i could tell lightwave only to render things say within 4 metres of the camera and then later, only further than 4 m from the camera.

anyone know if such a thing is possible?

thanks! anna

05-09-2004, 11:16 PM
I suppose you could set up a clipmap for the object(s) which uses a gradient set to distance to camera and has a stepped smoothing. That should let you slice off the object at a given distance from the camera.

05-10-2004, 07:44 PM
thanks! I'm not too good with gradients- and all this one seems to do is make the whole object dissappera, I have spun the gradients every which way i can think of and they always either reveal or hide the whole object regardless of distance to camera. Is there anything obvious I'm doing wrong?

oh and the closest objects are about 2m away and furthest about 6-7 m

05-10-2004, 09:10 PM
evenflcw's idea should work. You also could do an RPF export and use the depth data in post to separate your object. However the RPF exporter for LW has some problems, and you have to fool around in post to make it work, but you can do it.

05-10-2004, 09:11 PM
Indeed, it does seem the camera option does not function correctly/as expected. So instead, add a null and parent it to the camera so it snaps to the same position, and use Distance to Object option instead.

However, when I tried this I noticed you'll get small gaps/seams between the slices if you use AA. To fix this I tried making a small buffert in the gradient, but there was still a noticable seam, the cause of which was probably related to how the alpha channels are handled. I'm no compositing genie, but perhaps you'll know what to do.

05-10-2004, 09:35 PM
thank you!! yes the distance to object worked perfectly- the seam thing isn't proving to be a problem as there are quite wide gaps between the pieces of my object so they're not visible.

05-10-2004, 09:51 PM
Glad you got it to work out. :)