Announcement

Collapse
No announcement yet.

Changing dof aperture map based on distance to camera

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing dof aperture map based on distance to camera

    Hi!

    I have a scene where I'm trying to match the depth of field characteristic of a macro lens.
    The red channel behaves differently than the green and blue depending on the distance from the focus plane.

    When far away from the focus plane there is a cyan fringe and when closer to camera than focus plane there is a red fringe (see attached images).
    Far:
    Click image for larger version

Name:	aperture_far.png
Views:	1
Size:	46.5 KB
ID:	883105
    Near:
    Click image for larger version

Name:	aperture_close.png
Views:	1
Size:	53.6 KB
ID:	883106

    I'm trying to setup a network where I'm changing the aperture map going into a vray physical camera depending on distance from focus plane, but with no success.
    I have tried to switch aperture map based on path length in sampler info and also based on a ramp projection parented to the focus plane.

    The only thing that happens is that a small part of the bokeh gets one of the maps, and the other part gets the other independent of distance to focus plane.
    Click image for larger version

Name:	aperture_bad.png
Views:	1
Size:	54.5 KB
ID:	883107


    My guess is that the vray physical camera selects the aperture map in screen space before shooting out rays, is this correct?

    If so, is it possible in some way to change aperture map based on distance to camera.

    /Simon

  • #2
    Have you tried to use BlendColor texture and switch textures depending on Focus Distance of the Camera?
    Here is a quick example of that setup: http://ftp.chaosgroup.com/support/sc..._expression.mb

    BlendColor texture is pluged into Camera Aperture Map and its Blender-value is controlled via expression depending the Focus Distance of the Camera.
    If the distance is greater than 10 Blender value is 0(First Map is 100% visible) if the distance is less or equal to 10 Blender value is 1(Second map is 100% visible):
    Click image for larger version

Name:	Screenshot-13-29-27.png
Views:	1
Size:	177.3 KB
ID:	859091

    The camera in the scene is animated, if you scrub the timeline you will notice that till the frame 5 the Aperture Map is blue then at frame 6 and above it changes to red.
    Svetlozar Draganov | Senior Manager 3D Support | contact us
    Chaos & Enscape & Cylindo are now one!

    Comment

    Working...
    X