Notifications
Clear all

[Closed] Looking for a way to do a "soft" camera clip

Hi all,
what I need is a soft clipping plane on a camera as opposite to the build in clipping plane which clips the object literally at one distinct point in space and for that reason makes it pop up suddenly.
If objects are coming from behind the camera (really close to it), they should fade in smoothly instead of popping up at one point.

What would be a good approach for that?
I thought of adjusting an object’s visibility according to it’s distance from the camera, but that wouldn’t take into account i.e. a long cylinder shaped object pointing away from the camera and passing it very closely.
(does that make sense?)

Any hints are welcome.
Or is there a plugin out there which does the trick?

thanks a lot!
Uli

6 Replies

I’d render things out in layers and use Zbuffer channels to control opacity in post. Or there might be a way to bake this information back in and get it more modelled in…

Thanks Dave,
I’m sure the z-channel is somehow available from within Max. But right now I have no idea of how to adjust/alter/manipulate it. But it should do the trick.
Maybe with some video-post effects… I’ll have a look into that later on.
Thanks
Uli

 JHN

Yup it does, but if you’re rendering with mental ray, then there’s no luck using the visibilty, because MR only knows on or off… You don’t have to measure the pivot perse as point of reference, there’s also the $.min and $.max values that contain bounding box information. Those could be used potentially to figure out the min max values of your fading. But it’s very dependent on the size of the objects offcourse, if you want pixel leven control then rendering to layers is probably the best solution.

-Johan

you’d have to use layers with the g-buffer approach, though, as otherwise you’d only be fading the nearest surface to, say, black… rather than what’s behind that object.

you could use a falloff map set to distance from camera, driving a Blend between the original materials(s) and a fully transparent material.

Thanks for the input, guys.
I don’t really know whether Richard was referring to this approach, but I just setup a blend-material using a fallof with the “Distance Blend” feature as the mask and it did the job perfectly. Unfortunately that is on a per material basis. Would be nice to have it instantly applied to all materials or even the framebuffer itself.
Is that where G-Buffers come into play?
Anyway – thanks a lot. It does the job for my current situation here.

Now I’m just interested how this could be done affecting all or certain objects.
Richard, could you explain the g-buffer approach a little more?

Thanks!
Uli

you could script something up that would apply the effect to all materials; can’t be good for calculation times, though

as far as the g-buffers go… not too familiar with the workflow required there, myself, but basically g-buffers and g-buffer layers allow you to output two minimum required things…

  • the z-depth from the camera to a surface rendered (Z-buffer / Z G-Buffer)
  • surfaces behind other surfaces (layers)

using those, you could fade pixels on each layer based on their distance, and still have the objects behind them show through.

I’m sure that would require quite a bit of fiddling around in a compositing application that could handle these (RLA/RPF; Suppose that means Combustion and such).

Doing it in-render is certainly easier