POV-Ray : Newsgroups : povray.binaries.images : 35mm Camera Macro Server Time
1 Aug 2024 04:14:17 EDT (-0400)
  35mm Camera Macro (Message 11 to 20 of 21)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>
From: triple r
Subject: Re: 35mm Camera Macro
Date: 26 Feb 2009 20:40:00
Message: <web.49a743f555a0132e63a1b7c30@news.povray.org>
"Edouard Poor" <pov### [at] edouardinfo> wrote:
> I agree with Ricky - while the POV focal blur system has it's flaws, I think it
> gets the actual blur amount in front of and behind the focal plane correct.

I have to confess that this comes from experience.  I actually wrote a raytracer
once to simulate the projection of a scene onto a piece of film with a thin
lens.  Once I completed this, I realized it was entirely equivalent to
POV-Ray's simplified model.

 - Ricky


Post a reply to this message

From: Thomas de Groot
Subject: Re: 35mm Camera Macro
Date: 27 Feb 2009 03:37:10
Message: <49a7a636@news.povray.org>
I see it now. I overlooked the fact that all units should be consistent. My 
original object where much too small. It works now. Thank you indeed.

Thomas


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: 35mm Camera Macro
Date: 27 Feb 2009 14:22:45
Message: <49a83d85$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kenneth wrote:
> "Edouard Poor" <pov### [at] edouardinfo> wrote:
> 
>> I agree with Ricky - while the POV focal blur system has it's flaws, I think
>> it gets the actual blur amount in front of and behind the focal plane correct.
> 
> The concept of 'hyperfocal distance' has been with me since I was a teenager,
> when I used to shoot lots of B&W 35mm stills.  But I decided to look up the
> actual definition(!) To my surprise, there are *two* definitions, both equally
> valid (if slightly different as to the 'acceptable focus' range.) The first
> assumes setting the camera focus at a point somewhere off in the distance
> (though not at infinity) to get the maximum focus-range from 1/2 that distance
> *to* infinity. The other assumes setting the camera focus *at* infinity, which
> produces a nearly equal 'acceptable focus' range. (My own concept has always
> been the former one.)
> 
	The two definitions are the same: if you set focus at infinity the
focus range goes from H to infinity and if you set focus at H the
focus range goes from H/2 to infinity. The value of H is the same in
both cases (all other parameters being equal).

		Jerome
- --
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmoPYEACgkQd0kWM4JG3k8AYACfaVHSZuskM6AkuP2jmnRTUVm2
MRIAoLztPFP3dsgnlIDZSEzMOvRn0ev0
=7O7/
-----END PGP SIGNATURE-----


Post a reply to this message

From: Alain
Subject: Re: 35mm Camera Macro
Date: 27 Feb 2009 16:42:50
Message: <49a85e5a$1@news.povray.org>
Edouard Poor nous illumina en ce 2009-02-26 15:27 -->
> "Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote:
>> It is probably my misunderstanding of your macro, but I get weird results.
>> In particular by just changing fstop, the camera seems to jump from inside
>> one of the objects to outside. So, how do you define the parameters? just as
>> in RL photography? i.e. focal_length is 50 or 105; fstop is 1.4 or 16?
>>
>> Thomas
> 
> Yes - it should work like that. Since the camera is declared in mm, the rest of
> the scene has to be in mm as well. Or you can change the camera to be 0.05
> meters if you scene is in meters of course.
> 
> fstop is 1.4 or 16 as you say.
> 
> One sort of limitation is that I've only got a camera and look_at position. The
> focal plane goes through the look_at position, which made sense for me, but the
> macro could be changed to have a separate focal point, or a focal distance.
> 
> Future plans:
>   o Another macro to automatically focus at the hyperfocal distance
>   o Take the image size into account for the "circle of confusion" (in the
> hyperfocal case)
>   o Auto-focus! Give the camera an object, and use trace() to focus on it
>   o Also post my Stochastic Render Rig version of the same macro (just got to
> tweak the AA values a bit more).
> 
> Here's the scene:
> 
> #include "transforms.inc"
> 
> #macro Camera35mm( cam_pos, look_pos, focal_length, fstop, num_samples )
>  #local film_width = 35;
>  #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
>  #local apertureDiameter = focal_length / fstop;
>  #local focal_distance = vlength( look_pos - cam_pos);
> 
>  camera {
>   perspective
> 
>   focal_point look_pos
>   blur_samples num_samples
>   aperture (apertureDiameter / focal_distance) * 1000  // Magic Number
> 
>   location cam_pos
>   look_at look_pos
>   angle fov
>   right x * 1
>   up y * image_height/image_width
>  }
> #end
> 
> #declare cam_pos = < 0, 150, -500 >;  // in mm
> #declare look_pos = < 0, 50, 0 >;  // in mm
> 
> #declare lens = 50;  // mm
> #declare f_ratio = 4;  // Aperture as f ratio
> #declare num_samples = 19;  // 7, 19 & 37 happen to be hexagonal
> 
> Camera35mm( cam_pos, look_pos, lens, f_ratio, num_samples )
> 
> 
If I change look_pos to <0, -120, 1000>, the balls are blury, but the horizon is 
sharp. The ground start to be sharp about 2 or 3 tiles after the green ball. (at 
1024*768)

-- 
Alain
-------------------------------------------------
Existentialism: What is shit, anyway?


Post a reply to this message

From: Kenneth
Subject: Re: 35mm Camera Macro
Date: 28 Feb 2009 00:35:00
Message: <web.49a8cba755a0132ef50167bc0@news.povray.org>
>  The two definitions are the same: if you set focus at infinity the
> focus range goes from H to infinity and if you set focus at H the
> focus range goes from H/2 to infinity. The value of H is the same in
> both cases (all other parameters being equal).
>
>   Jerome

From what I've read about this recently, the only (small) difference in setting
focus at H is that the 'acceptable focus' range is *between* H/2 and
infinity--meaning that infinity is at the 'edge' of the acceptable focus.
(Which for most practical purposes, means that it *is* in focus there.)
Apparently, though, many photographers don't adhere strictly to the hyperfocal
distance H, but move it slightly out past that point, to be sure to get the
infinite-distance details pin-sharp.

KW


Post a reply to this message

From: Edouard Poor
Subject: Re: 35mm Camera Macro
Date: 28 Feb 2009 05:10:01
Message: <web.49a90d5655a0132ebd47b0730@news.povray.org>
I wrote:

> A simple macro I put together that approximates a 35mm camera in the scene.

Updated macros - with a major bug fixed in the Camera35mm macro (I was putting
the distance to the focal point in the calculation of the aperture - which was
a hang over from my stochastic code, but completely wrong for the POV focal
blur).

I've also done a couple of Hyperfocal versions of the macro - one that takes the
image sensor (i.e. the picture resolution) into account, and one that doesn't
(and sets the circle of confusion to 0.03mm, which is roughly the right value
for 35mm film).

Any other additions people would like?


#macro Camera35mm( cam_pos, look_pos, focal_length, fstop, num_samples )
 #local film_width = 36;
 #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
 #local apertureDiameter = focal_length / fstop;
 #local focal_distance = vlength( look_pos - cam_pos);

 camera {
  perspective

  focal_point look_pos
  blur_samples num_samples
  aperture (apertureDiameter ) * 2  // Magic Number

  location cam_pos
  look_at look_pos
  angle fov
  right x * 1
  up y * image_height/image_width
 }
#end

#macro HyperfocalCamera35mm( cam_pos, look_pos, focal_length, fstop, num_samples
)
 #local film_width = 36;
 #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
 #local apertureDiameter = focal_length / fstop;
 #local look_distance = vlength( look_pos - cam_pos);
 #local circle_of_confusion = film_width / image_width;
 #local hyperfocal_distance = ((focal_length * focal_length) / (fstop *
circle_of_confusion)) + focal_length;
 #debug concat( "Field of View is ", str( fov, 0, 1 ), " degrees\n" )
 #debug concat( "Circle of confusion is ", str( circle_of_confusion, 0, 2 ),
"mm\n" )
 #debug concat( "Hyperfocal distance is ", str( hyperfocal_distance, 0, 0 ),
"mm\n" )
 #debug concat( "Min distance in focus is ", str( hyperfocal_distance/2, 0, 0 ),
"mm\n" )

 camera {
  perspective

  focal_point ((cam_pos - look_pos) / look_distance) * hyperfocal_distance
  blur_samples num_samples
  aperture (apertureDiameter) * 2  // Magic Number

  location cam_pos
  look_at look_pos
  angle fov
  right x * 1
  up y * image_height/image_width
 }
#end

#macro HyperfocalCamera35mm_fixed_circle_of_confusion( cam_pos, look_pos,
focal_length, fstop, num_samples )
 #local film_width = 36;
 #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
 #local apertureDiameter = focal_length / fstop;
 #local look_distance = vlength( look_pos - cam_pos);
 #local circle_of_confusion = 0.03; // std circle of confusion for 35mm film
 #local hyperfocal_distance = ((focal_length * focal_length) / (fstop *
circle_of_confusion)) + focal_length;
 #debug concat( "Field of View is ", str( fov, 0, 1 ), " degrees\n" )
 #debug concat( "Circle of confusion is ", str( circle_of_confusion, 0, 2 ),
"mm\n" )
 #debug concat( "Hyperfocal distance is ", str( hyperfocal_distance, 0, 0 ),
"mm\n" )
 #debug concat( "Min distance in focus is ", str( hyperfocal_distance/2, 0, 0 ),
"mm\n" )

 camera {
  perspective

  focal_point ((cam_pos - look_pos) / look_distance) * hyperfocal_distance
  blur_samples num_samples
  aperture (apertureDiameter) * 2  // Magic Number

  location cam_pos
  look_at look_pos
  angle fov
  right x * 1
  up y * image_height/image_width
 }
#end


Post a reply to this message

From: Thomas de Groot
Subject: Re: 35mm Camera Macro
Date: 28 Feb 2009 07:31:34
Message: <49a92ea6$1@news.povray.org>
Great! I love this because it makes possible to simulate a real camera, 
which can be interesting in some cases.

Thanks a lot.

Thomas


Post a reply to this message

From: Cousin Ricky
Subject: Re: 35mm Camera Macro
Date: 28 Feb 2009 16:50:00
Message: <web.49a9b05855a0132e85de7b680@news.povray.org>
"Edouard Poor" <pov### [at] edouardinfo> wrote:
>
> Any other additions people would like?

A parameter for focal blur variance.  This smooths out the graininess, often
taking less time than increasing blur_samples.


Post a reply to this message

From: Carlo C 
Subject: Re: 35mm Camera Macro
Date: 2 Mar 2009 11:00:00
Message: <web.49ac021555a0132ecc3c8ce00@news.povray.org>
"Edouard Poor" <pov### [at] edouardinfo> wrote:
> I wrote:
>
> > A simple macro I put together that approximates a 35mm camera in the scene.
>
> Updated macros - with a major bug fixed in the Camera35mm macro (I was putting
> the distance to the focal point in the calculation of the aperture - which was
> a hang over from my stochastic code, but completely wrong for the POV focal
> blur).
>
> I've also done a couple of Hyperfocal versions of the macro - one that takes the
> image sensor (i.e. the picture resolution) into account, and one that doesn't
> (and sets the circle of confusion to 0.03mm, which is roughly the right value
> for 35mm film).
>
> Any other additions people would like?
>
>
> #macro Camera35mm( cam_pos, look_pos, focal_length, fstop, num_samples )
>  #local film_width = 36;
>  #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
>  #local apertureDiameter = focal_length / fstop;
>  #local focal_distance = vlength( look_pos - cam_pos);
>
>  camera {
>   perspective
>
>   focal_point look_pos
>   blur_samples num_samples
>   aperture (apertureDiameter ) * 2  // Magic Number
>
>   location cam_pos
>   look_at look_pos
>   angle fov
>   right x * 1
>   up y * image_height/image_width
>  }
> #end
>
> #macro HyperfocalCamera35mm( cam_pos, look_pos, focal_length, fstop, num_samples
> )
>  #local film_width = 36;
>  #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
>  #local apertureDiameter = focal_length / fstop;
>  #local look_distance = vlength( look_pos - cam_pos);
>  #local circle_of_confusion = film_width / image_width;
>  #local hyperfocal_distance = ((focal_length * focal_length) / (fstop *
> circle_of_confusion)) + focal_length;
>  #debug concat( "Field of View is ", str( fov, 0, 1 ), " degrees\n" )
>  #debug concat( "Circle of confusion is ", str( circle_of_confusion, 0, 2 ),
> "mm\n" )
>  #debug concat( "Hyperfocal distance is ", str( hyperfocal_distance, 0, 0 ),
> "mm\n" )
>  #debug concat( "Min distance in focus is ", str( hyperfocal_distance/2, 0, 0 ),
> "mm\n" )
>
>  camera {
>   perspective
>
>   focal_point ((cam_pos - look_pos) / look_distance) * hyperfocal_distance
>   blur_samples num_samples
>   aperture (apertureDiameter) * 2  // Magic Number
>
>   location cam_pos
>   look_at look_pos
>   angle fov
>   right x * 1
>   up y * image_height/image_width
>  }
> #end
>
> #macro HyperfocalCamera35mm_fixed_circle_of_confusion( cam_pos, look_pos,
> focal_length, fstop, num_samples )
>  #local film_width = 36;
>  #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
>  #local apertureDiameter = focal_length / fstop;
>  #local look_distance = vlength( look_pos - cam_pos);
>  #local circle_of_confusion = 0.03; // std circle of confusion for 35mm film
>  #local hyperfocal_distance = ((focal_length * focal_length) / (fstop *
> circle_of_confusion)) + focal_length;
>  #debug concat( "Field of View is ", str( fov, 0, 1 ), " degrees\n" )
>  #debug concat( "Circle of confusion is ", str( circle_of_confusion, 0, 2 ),
> "mm\n" )
>  #debug concat( "Hyperfocal distance is ", str( hyperfocal_distance, 0, 0 ),
> "mm\n" )
>  #debug concat( "Min distance in focus is ", str( hyperfocal_distance/2, 0, 0 ),
> "mm\n" )
>
>  camera {
>   perspective
>
>   focal_point ((cam_pos - look_pos) / look_distance) * hyperfocal_distance
>   blur_samples num_samples
>   aperture (apertureDiameter) * 2  // Magic Number
>
>   location cam_pos
>   look_at look_pos
>   angle fov
>   right x * 1
>   up y * image_height/image_width
>  }
> #end

uhm...
I find that this is really interesting!
:-)


Post a reply to this message

From: Ingwer
Subject: Re: 35mm Camera Macro
Date: 23 Oct 2013 10:15:01
Message: <web.5267d8fb55a0132e9eead1c0@news.povray.org>
"Edouard Poor" <pov### [at] edouardinfo> wrote:
> I wrote:
>
> > A simple macro I put together that approximates a 35mm camera in the scene.
>
> Updated macros - with a major bug fixed in the Camera35mm macro (I was putting
> the distance to the focal point in the calculation of the aperture - which was
> a hang over from my stochastic code, but completely wrong for the POV focal
> blur).
>
> I've also done a couple of Hyperfocal versions of the macro - one that takes the
> image sensor (i.e. the picture resolution) into account, and one that doesn't
> (and sets the circle of confusion to 0.03mm, which is roughly the right value
> for 35mm film).
>
> Any other additions people would like?
>
>
> #macro Camera35mm( cam_pos, look_pos, focal_length, fstop, num_samples )
>  #local film_width = 36;
>  #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
>  #local apertureDiameter = focal_length / fstop;
>  #local focal_distance = vlength( look_pos - cam_pos);
>
>  camera {
>   perspective
>
>   focal_point look_pos
>   blur_samples num_samples
>   aperture (apertureDiameter ) * 2  // Magic Number
>
>   location cam_pos
>   look_at look_pos
>   angle fov
>   right x * 1
>   up y * image_height/image_width
>  }
> #end
>
> #macro HyperfocalCamera35mm( cam_pos, look_pos, focal_length, fstop, num_samples
> )
>  #local film_width = 36;
>  #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
>  #local apertureDiameter = focal_length / fstop;
>  #local look_distance = vlength( look_pos - cam_pos);
>  #local circle_of_confusion = film_width / image_width;
>  #local hyperfocal_distance = ((focal_length * focal_length) / (fstop *
> circle_of_confusion)) + focal_length;
>  #debug concat( "Field of View is ", str( fov, 0, 1 ), " degrees\n" )
>  #debug concat( "Circle of confusion is ", str( circle_of_confusion, 0, 2 ),
> "mm\n" )
>  #debug concat( "Hyperfocal distance is ", str( hyperfocal_distance, 0, 0 ),
> "mm\n" )
>  #debug concat( "Min distance in focus is ", str( hyperfocal_distance/2, 0, 0 ),
> "mm\n" )
>
>  camera {
>   perspective
>
>   focal_point ((cam_pos - look_pos) / look_distance) * hyperfocal_distance
>   blur_samples num_samples
>   aperture (apertureDiameter) * 2  // Magic Number
>
>   location cam_pos
>   look_at look_pos
>   angle fov
>   right x * 1
>   up y * image_height/image_width
>  }
> #end
>
> #macro HyperfocalCamera35mm_fixed_circle_of_confusion( cam_pos, look_pos,
> focal_length, fstop, num_samples )
>  #local film_width = 36;
>  #local fov = degrees( atan( (film_width / 2) / focal_length ) * 2 );
>  #local apertureDiameter = focal_length / fstop;
>  #local look_distance = vlength( look_pos - cam_pos);
>  #local circle_of_confusion = 0.03; // std circle of confusion for 35mm film
>  #local hyperfocal_distance = ((focal_length * focal_length) / (fstop *
> circle_of_confusion)) + focal_length;
>  #debug concat( "Field of View is ", str( fov, 0, 1 ), " degrees\n" )
>  #debug concat( "Circle of confusion is ", str( circle_of_confusion, 0, 2 ),
> "mm\n" )
>  #debug concat( "Hyperfocal distance is ", str( hyperfocal_distance, 0, 0 ),
> "mm\n" )
>  #debug concat( "Min distance in focus is ", str( hyperfocal_distance/2, 0, 0 ),
> "mm\n" )
>
>  camera {
>   perspective
>
>   focal_point ((cam_pos - look_pos) / look_distance) * hyperfocal_distance
>   blur_samples num_samples
>   aperture (apertureDiameter) * 2  // Magic Number
>
>   location cam_pos
>   look_at look_pos
>   angle fov
>   right x * 1
>   up y * image_height/image_width
>  }
> #end

hi,

you are doing a great job. but I have a question about the aperture.

> apertureDiameter = focal_length / fstop
  (fot real camera this is 100 percent correct)
> aperture (apertureDiameter / focal_distance) * 1000
  this is what I am looking for. but where did you get this formula? I look up
the Povray reference, hut there is no such a description. Can you tell me the
principle or theory?

thanks.

Ingwer


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.