Announcement

Collapse
No announcement yet.

dof problem

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

  • dof problem

    I have a problem here, wich i wrote in another thread, but open it here again.
    I have a project where a flying object goes inside a glass.
    camera is outside, closed to the glas.
    when i look through the glass, and i have the flying object in focus, so the glass in front is out of focus, strictly observed is all of the object seen through the glass refraction right? so when the glass in front is out of focus, the refraction of the flying object have to be out of focus too. or?
    but when i render it with dof in VRay, all from the object directly seen through the glass is sharp. i did a few tests, and its right like that. but could someone discribe why?
    and does anybody know a way to fake that effect for doing it in post without having zdepht channel works with refraction?

    Thanks in advance, and best regards

    Jonas
    Jonas

    www.jonas-balzer.de
    www.shack.de

  • #2
    Heya Johnny,

    Yep it's correct, any time you have anything to do with glass or mirrors dof can be a little tricky. What happens is that the dof doesn't appear on the surface of the mirror, in other words if something is reflecting on the surface of the mirror and the mirror is out of focus, the dof doesn't treat the reflection as if it's something lying on the surface of the mirror.

    What actually happens in real life is if you are focussing on a mirror and want to have the reflection sharp, you have to calculate first the distance from the camera to the mirror, then calculate the distance from the mirror to the object that it's reflecting - if you add those two values together, then you'll get the focus distance that you need to use to have the reflection sharp. It's the same with refracted objects too - since the rays of the object being refracted are coming from a further distance away, they will have a different plane of focus from the glass itself.

    It's weird but it's the way it is in real life too - if you take a photo using a camera with shallow focus and try taking a picture of your reflection in a window, if you focus on the window your reflection will be out of focus, if you focus on the reflection, the window will be out of focus.

    Comment


    • #3
      hey mate,
      thanks for your explanation man. i'am running around since 3 days now and take photos and stearing at glasses with pencils inside...
      but its a strange behavior if you ask me.
      and do you know a way to getting a correct z-depht channel out of it?
      since there's no refraction in zdepht, is there something like a gradient map, depent from the distance to camera? this way i could render a second manual pass, and comp them togher.

      best regards
      Jonas
      Jonas

      www.jonas-balzer.de
      www.shack.de

      Comment


      • #4
        It'd be kind of awkward to do, you'd definitely have to do a pass for the glass only since the camera is going to give you depth for the first thing it hits which is the glass - there's going to be no other way to do this aside from a 2 pass render. In terms of things like refractive surfaces, you can try using a falloff map in towards / away mode which will map the falloff by distance from camera but it's going to cause problems for your glass no matter what - the 2d post dof is going to fall down as soon as any warping effect of raytracing needs to be used.

        Comment


        • #5
          ok i'll run a few test.
          thanks for your help man. lets see, if i find smt i'll post it here.
          Jonas

          www.jonas-balzer.de
          www.shack.de

          Comment


          • #6
            No problem - it's an awkward one since the glass needs to be raytracing to bend the depth map for the straw, but it also needs to output it's own depth values or else the glass won't blur properly - difficult one with something like a straw in a wine glass.

            Comment

            Working...
            X