POV-Ray : Newsgroups : povray.general : Trying to Apply Focal Blur on an Orthographic Projection Server Time
21 Dec 2024 11:05:51 EST (-0500)
  Trying to Apply Focal Blur on an Orthographic Projection (Message 1 to 6 of 6)  
From: Drawliphant
Subject: Trying to Apply Focal Blur on an Orthographic Projection
Date: 12 Nov 2019 19:55:01
Message: <web.5dcb53c163abcc5387560a5b0@news.povray.org>
The language allows me to define focal blur on an orthographic projection but
the results i'm getting are meaningless images of the scene blurred out of
existence (I used lots of aperture values and they where all this way). I know
focal blur doesn't make physical sense for orthographic projection. I would
define focal blur here as each ray is parallel except for a bit of a random
angle. I'm trying to simulate rays from the sun. (Like a blurred out image from
the perspective of the sun.) Has anyone gotten focal blur to produce something
good in orthographic, otherwise could I define my own camera to do this?


Post a reply to this message

From: Alain Martel
Subject: Re: Trying to Apply Focal Blur on an Orthographic Projection
Date: 12 Nov 2019 20:25:09
Message: <5dcb5b75$1@news.povray.org>
Le 2019-11-12 à 19:52, Drawliphant a écrit :
> The language allows me to define focal blur on an orthographic projection but
> the results i'm getting are meaningless images of the scene blurred out of
> existence (I used lots of aperture values and they where all this way). I know
> focal blur doesn't make physical sense for orthographic projection. I would
> define focal blur here as each ray is parallel except for a bit of a random
> angle. I'm trying to simulate rays from the sun. (Like a blurred out image from
> the perspective of the sun.) Has anyone gotten focal blur to produce something
> good in orthographic, otherwise could I define my own camera to do this?
> 
> 

Never experimented with that, but...

Make the aperture small. Start with 1/10 of the smallest value that you 
tried or smaller.
Do set look_at.
Make the focal point the same as the look_at.

Things on the plane defined by the focal point perpendicular to the 
camera's location to the focal point vector SHOULD be in focus.


Post a reply to this message

From: Bald Eagle
Subject: Re: Trying to Apply Focal Blur on an Orthographic Projection
Date: 12 Nov 2019 21:25:01
Message: <web.5dcb6921c35fe2b54eec112d0@news.povray.org>
"Drawliphant" <dra### [at] gmailcom> wrote:
> The language allows me to define focal blur on an orthographic projection but
> the results i'm getting are meaningless images of the scene blurred out of
> existence

> Has anyone gotten focal blur to produce something
> good in orthographic, otherwise could I define my own camera to do this?

I suppose there might be a way to make a user-defined camera, but maybe you
might think of physically creating a thin sheet of transparent material with an
IOR > 1 to act as a blurring "lens".
Possibly as an isosurface made with a noise function.


Post a reply to this message

From: Bald Eagle
Subject: Re: Trying to Apply Focal Blur on an Orthographic Projection
Date: 12 Nov 2019 22:40:00
Message: <web.5dcb7adac35fe2b54eec112d0@news.povray.org>
Try this for starters:


// Bill Walker "Bald Eagle" November 2019
// for user Drawliphant
// in thread
http://news.povray.org/povray.general/thread/%3Cweb.5dcb6921c35fe2b54eec112d0%40news.povray.org%3E/

#version 3.8;
global_settings {assumed_gamma 1.0 }
#include "colors.inc"
#include "functions.inc"
#include "math.inc"

#declare Zoom = 50;
camera {
 orthographic
 right     x*image_width/Zoom
 up   y*image_height/Zoom
 location <0, 0, -10>
 look_at  <0, 0, 0>
}

sky_sphere {pigment {rgb 1}}

light_source {<2, 5, -10> rgb 1 shadowless}
//light_source {<-10, 8, -1> rgb 0.8} // fill light

#declare Tan = texture {pigment {rgb <0.92, 0.60, 0.20>} finish {specular 0.2}}
#declare Tan2 = texture {pigment {rgb <0.92, 0.60, 0.20>} finish {diffuse 0.7
specular 0.2 reflection 0.02}}
#declare Gray = texture {pigment {rgb 0.5}}
#declare Gray2 = texture {pigment {rgb 0.5}finish {diffuse 0.7 specular 0.2
reflection 0.02}}

#declare Shade = 1;
#declare   _Red = texture {pigment {rgb <1, 0, 0>*Shade} finish {diffuse 0.7}}
#declare _Green = texture {pigment {rgb <0, 1, 0>*Shade} finish {diffuse 0.7}}
#declare  _Blue = texture {pigment {rgb <0, 0, 1>*Shade} finish {diffuse 0.7}}

#declare Checker = texture {pigment {checker rgb 0 rgb 1} scale 2 finish
{diffuse 1}}

//##########POV-RAY###############Bald
Eagle##############2019###################

#declare Square = union {
 triangle {<-5, 0, -5>, <-5, 0, 5>, <5, 0, -5>}
 triangle {<5, 0, -5>, <-5, 0, 5>, <5, 0, 5> }
 texture {Checker}
}

#declare Axes =
 union {
  #declare Line = 0.1;
  #declare Base = Line*3;
  #declare Length = 3.5;
  #declare Ext = 0.5;
  cylinder {<0, 0, 0>, <Length, 0, 0>, Line texture {_Red}}
   cone {<Length, 0, 0>, Base, <Length+Ext, 0, 0>, 0 texture {_Red}}
   text {ttf "timrom.ttf", "Blur       No Blur", 0.02, 0.0 texture {_Red}
    translate <-2, -1.125, 0>
   }

  cylinder {<0, 0, 0>, <0, Length, 0>, Line texture {_Green}}
   cone {<0, Length, 0>, Base, <0, Length+Ext, 0>, 0 texture {_Green}}
  cylinder {<0, 0, 0>, <0, 0, Length>, Line texture {_Blue}}
   cone {<0, 0, Length>, Base, <0, 0, Length+Ext>, 0 texture {_Blue}}
  //no_shadow
 }

//##########POV-RAY###############Bald
Eagle##############2019###################

object {Square rotate -x*90 translate z*6}
object {Axes}


#declare T_Glass=texture{
   pigment{
     color rgbt 1
   }
   finish {
     diffuse 0.04
     //reflection{ 0.5 fresnel on }
     //conserve_energy
   }
}
#declare I_Glass=interior{
   ior 1.005   // <--- change the IOR
   fade_power 2 //1.5
   fade_distance 1
   fade_color <0.70, 0.7, 0.9>
   //dispersion 1.01
   //dispersion_samples 100
}

#declare Thickness = 0.01;
#declare BlurPlane = function {z + f_noise3d(x, y, z)}


  #declare Range = 1;
  #declare Whole = yes;
  #declare Label = no;
  #declare Gradient = 50;
  #declare Min_factor= 0.6;

// for scaling the noise function
#declare XS = 0.001;
#declare YS = 0.001;
#declare ZS = 0.01;

  isosurface {

    function {abs (BlurPlane (x/XS, y/YS, z/ZS)) - Thickness}
    //open
    threshold 0.5
    //max_gradient 10
    accuracy     0.01
    evaluate Gradient*Min_factor,  sqrt(Gradient/(Gradient*Min_factor)),  min
(0.7, 1.0)
    contained_by {box {<-3, -2, -1>*Range, <Whole*3, 2.3, 1>*Range}}
    hollow
      texture {T_Glass}
      interior {I_Glass}
      //texture {Tex1}
     scale 1
     rotate x*1 // Seems absolutely essential!  :O
     translate <-1.5, -0.5, -7>
    }


Post a reply to this message

From: Drawliphant
Subject: Re: Trying to Apply Focal Blur on an Orthographic Projection
Date: 13 Nov 2019 09:55:07
Message: <web.5dcc1822c35fe2b53cd9f1c00@news.povray.org>
> // for scaling the noise function
> #declare XS = 0.001;
> #declare YS = 0.001;
> #declare ZS = 0.01;
>
>   isosurface {
>
>     function {abs (BlurPlane (x/XS, y/YS, z/ZS)) - Thickness}
>     //open
>     threshold 0.5
>     //max_gradient 10
>     accuracy     0.01
>     evaluate Gradient*Min_factor,  sqrt(Gradient/(Gradient*Min_factor)),  min
> (0.7, 1.0)
>     contained_by {box {<-3, -2, -1>*Range, <Whole*3, 2.3, 1>*Range}}
>     hollow
>       texture {T_Glass}
>       interior {I_Glass}
>       //texture {Tex1}
>      scale 1
>      rotate x*1 // Seems absolutely essential!  :O
>      translate <-1.5, -0.5, -7>
>     }

This is great! If I can't get focal blur working how I want it I can blur it
with this. I'm pretty new so when people where talking about a blur plane I had
no idea how to make that. I'll try veeery small aperatures first then try this
one


Post a reply to this message

From: Bald Eagle
Subject: Re: Trying to Apply Focal Blur on an Orthographic Projection
Date: 13 Nov 2019 13:40:01
Message: <web.5dcc4d9fc35fe2b54eec112d0@news.povray.org>
"Drawliphant" <dra### [at] gmailcom> wrote:

> This is great!

Glad you like  :)

> If I can't get focal blur working how I want it I can blur it
> with this. I'm pretty new so when people where talking about a blur plane I had
> no idea how to make that.

No worries.  Always just ask and someone can chime in at some point with an
explanation, a link, or some code.

> I'll try veeery small aperatures first then try this one

I don't really use focal blur - but when I took real photographs and developed
and printed real film and paper, the smaller the aperture, the more things were
in focus.   A greater depth of field.
So I'd tend to suggest the opposite - use a huge aperture, and look_at something
other than what you want to be out of focus.

Dan Byers just posted a great little animation - maybe poke him and ask him what
his secret is.   :)

http://news.povray.org/povray.binaries.images/message/%3Cweb.5dcb2ab9d5e268cc44b457e10%40news.povray.org%3E/#%3Cweb.5dc
b2ab9d5e268cc44b457e10%40news.povray.org%3E


Post a reply to this message

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