How to do depth of field in Light tracing? back

Board: Home Board index Raytracing General Development

(L) [2013/12/06] [ost by shiqiu1105] [How to do depth of field in Light tracing?] Wayback!

I am trying to implement depth of field in my bidirectional path tracer.
I know how to do that when tracing rays from the camera.

But when connecting light path directly to camera, that's like light tracing, where points are projected back directly to pixel positions.
So I tried to purturb the projected pixel coordinates based on the camera lens radius and focus distance, but the images I get still has artifact on the edges of objects.

Anybody done this before?
(L) [2013/12/06] [ost by friedlinguini] [How to do depth of field in Light tracing?] Wayback!

I haven't tried it myself, but I imagine you pick a random point on your lens, connect to the surface point, and then calculate pixel coordinates based on where the segment formed crosses the focal plane
(L) [2013/12/06] [ost by Zelcious] [How to do depth of field in Light tracing?] Wayback!

To account for implicit paths you also need to intersect with the lens geometry.
(L) [2013/12/10] [ost by shocker_0x15] [How to do depth of field in Light tracing?] Wayback!

I think you do the following process in, for example, path tracing.
1.Select a pixel position in image sensor(perhaps, this is thought of as virtual plane).
   This determines a "raw" direction.
2.Select a lens position in lens aperture, and perturb the raw direction, you get the corresponding ray.
3.Transform the ray into the world coordinate.
You can see this process in the PBRT book.

In light tracing(using next event estimation), you just need to do the opposite process.
1.You can determine a world coordinate ray which connects a position in lens to world.
2.Transform the ray into the camera coordinate by using the inverse matrix used in the step 3 on the above.
3.You can find the raw vector from the local ray, this vector means the corresponding pixel position.

Sorry for my poor English  [SMILEY ;)]

back