POV-Ray : Newsgroups : povray.binaries.images : Ambient Occlusion Test Server Time
25 Apr 2024 07:47:18 EDT (-0400)
  Ambient Occlusion Test (Message 1 to 8 of 8)  
From: Robert McGregor
Subject: Ambient Occlusion Test
Date: 16 Oct 2008 08:55:00
Message: <web.48f739123ce46002bd1b3ad10@news.povray.org>
Hi all, for the last few months I've been reading about Ambient Occlusion
techniques used by the high-end renderer$ and it seems pretty common to have a
render pass for AO, a "pretty" pass for texture and lighting, and maybe even
have a transparency pass, specular pass, media pass, photon pass, etc.,  that
are all composited into a final image. I suppose that's similar to doing a
save/load radiosity pass and a save/load photon pass rendered into a final POV
image...  except those big money renderer$ apparently use shader "slots" that
are wired together in various ways to make all kinds of crazy combinations of
realistic rendering voodoo...

Well, I'm a POV guy so that's all a bit foreign to me, so I hacked out a few
passes today to see if AO would really make a noticeable difference in my
renders. I used radiosity with a highly ambient sky_sphere to render a
monochrome AO "mask" (no lights), followed by a fully textured version with
lights.

Okay, maybe I just haven't been keeping up with latest techniques, and maybe

that this type of AO compositing can make quite a difference in the final image
quality... here's an example.

Cheers,
Rob

"Yeay! Wrath of the Lich King is just around the corner!"  <-- WoW geek


Post a reply to this message


Attachments:
Download 'ambientocclusiontest.jpg' (568 KB)

Preview of image 'ambientocclusiontest.jpg'
ambientocclusiontest.jpg


 

From: Robert McGregor
Subject: Re: Ambient Occlusion Test
Date: 16 Oct 2008 13:35:01
Message: <web.48f77ac79db86a5abd1b3ad10@news.povray.org>
Here's another AO test, inspired by the recent "corrosive Buddha" post by
Edouard Poor

-Rob

"Yeay! Wrath of the Lich King is just around the corner!"  <-- WoW geek


Post a reply to this message


Attachments:
Download 'ambientocclusiontest2.jpg' (445 KB)

Preview of image 'ambientocclusiontest2.jpg'
ambientocclusiontest2.jpg


 

From: nemesis
Subject: Re: Ambient Occlusion Test
Date: 16 Oct 2008 14:56:57
Message: <48f78e79@news.povray.org>
Yes, much better.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Ambient Occlusion Test
Date: 17 Oct 2008 03:17:18
Message: <48f83bfe@news.povray.org>
That looks very convincing, Robert. How did you do the compositing?

Thomas


Post a reply to this message

From: Robert McGregor
Subject: Re: Ambient Occlusion Test
Date: 17 Oct 2008 12:45:00
Message: <web.48f8c04b9db86a5a86ff1d480@news.povray.org>
"Thomas de Groot" <t.d### [at] internlDOTnet> wrote:
> That looks very convincing, Robert. How did you do the compositing?

It was inspired by some code Mike Williams wrote a few years back for color
attenuating an image. This is just a quick hack - I plan to refine it in the
next few days into something more useful:

global_settings { assumed_gamma 1 }

camera {
   orthographic
   location <0, 0, -1>
   look_at <0, 0, 0>
   right  x*image_width/image_height
}

#declare DT_AO     = 1;  // the ambient occlusion map
#declare DT_Normal = 2;  // the normal render map
#declare DT_Mult   = 3;  // the multiplied AO*Normal map

//#declare Display_Type = DT_AO;
//#declare Display_Type = DT_Normal;
#declare Display_Type = DT_Mult;

#declare p1 = pigment {
   image_map { tga "budha_ao.tga" interpolate 2 map_type 0 once }
   translate -0.5
}
#declare p2 = pigment {
   image_map { tga "budha.tga" interpolate 2 map_type 0 once }
   translate -0.5
}

#declare fp1 = function { pigment { p1 } };
#declare fp2 = function { pigment { p2 } };

#declare RED = pigment {
   function { fp1(x,y,z).red * fp2(x,y,z).red }
   color_map { [0 rgb 0][1 rgb <1,0,0>] }
}

#declare GREEN = pigment {
   function { fp1(x,y,z).green * fp2(x,y,z).green }
   color_map { [0 rgb 0][1 rgb <0,1,0>] }
}

#declare BLUE = pigment {
   function { fp1(x,y,z).blue * fp2(x,y,z).blue }
   color_map { [0 rgb 0][1 rgb <0,0,1>] }
}

#declare p3 = pigment {
   average
   pigment_map {
      [1 RED]
      [1 GREEN]
      [1 BLUE]
   }
}

plane { z, 0
   hollow
   #switch (Display_Type)
      #case (DT_AO)
         pigment { p1 }
         finish { ambient 1 diffuse 0 }
         #break
      #case (DT_Normal)
         pigment { p2 }
         finish { ambient 1 diffuse 0 }
         #break
      #case (DT_Mult)
         pigment { p3 }
         finish { ambient 3 diffuse 0 }
         #break
   #end
}


Post a reply to this message

From: Carlo C 
Subject: Re: Ambient Occlusion Test
Date: 17 Oct 2008 17:00:01
Message: <web.48f8fc279db86a5ada767270@news.povray.org>
"Robert McGregor" <rob### [at] mcgregorfineartcom> wrote:
> "Thomas de Groot" <t.d### [at] internlDOTnet> wrote:
> > That looks very convincing, Robert. How did you do the compositing?
>
> It was inspired by some code Mike Williams wrote a few years back for color
> attenuating an image. This is just a quick hack - I plan to refine it in the
> next few days into something more useful:
>
> global_settings { assumed_gamma 1 }
>
> camera {
>    orthographic
>    location <0, 0, -1>
>    look_at <0, 0, 0>
>    right  x*image_width/image_height
> }
>
> #declare DT_AO     = 1;  // the ambient occlusion map
> #declare DT_Normal = 2;  // the normal render map
> #declare DT_Mult   = 3;  // the multiplied AO*Normal map
>
> //#declare Display_Type = DT_AO;
> //#declare Display_Type = DT_Normal;
> #declare Display_Type = DT_Mult;
>
> #declare p1 = pigment {
>    image_map { tga "budha_ao.tga" interpolate 2 map_type 0 once }
>    translate -0.5
> }
> #declare p2 = pigment {
>    image_map { tga "budha.tga" interpolate 2 map_type 0 once }
>    translate -0.5
> }
>
> #declare fp1 = function { pigment { p1 } };
> #declare fp2 = function { pigment { p2 } };
>
> #declare RED = pigment {
>    function { fp1(x,y,z).red * fp2(x,y,z).red }
>    color_map { [0 rgb 0][1 rgb <1,0,0>] }
> }
>
> #declare GREEN = pigment {
>    function { fp1(x,y,z).green * fp2(x,y,z).green }
>    color_map { [0 rgb 0][1 rgb <0,1,0>] }
> }
>
> #declare BLUE = pigment {
>    function { fp1(x,y,z).blue * fp2(x,y,z).blue }
>    color_map { [0 rgb 0][1 rgb <0,0,1>] }
> }
>
> #declare p3 = pigment {
>    average
>    pigment_map {
>       [1 RED]
>       [1 GREEN]
>       [1 BLUE]
>    }
> }
>
> plane { z, 0
>    hollow
>    #switch (Display_Type)
>       #case (DT_AO)
>          pigment { p1 }
>          finish { ambient 1 diffuse 0 }
>          #break
>       #case (DT_Normal)
>          pigment { p2 }
>          finish { ambient 1 diffuse 0 }
>          #break
>       #case (DT_Mult)
>          pigment { p3 }
>          finish { ambient 3 diffuse 0 }
>          #break
>    #end
> }

Thank you.
I find it very interesting.


Post a reply to this message

From: Kenneth
Subject: Re: Ambient Occlusion Test
Date: 17 Oct 2008 18:10:01
Message: <web.48f90cf29db86a5a78dcad930@news.povray.org>
"Robert McGregor" <rob### [at] mcgregorfineartcom> wrote:
> Here's another AO test, inspired by the recent "corrosive Buddha" post by
> Edouard Poor
>

Some really nice images, and an intriguing technique. Thanks for posting your
code, with the 'compositing' steps.  I'll definitely give it a try.

Ken W.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Ambient Occlusion Test
Date: 18 Oct 2008 03:18:34
Message: <48f98dca@news.povray.org>
"Robert McGregor" <rob### [at] mcgregorfineartcom> schreef in bericht 
news:web.48f8c04b9db86a5a86ff1d480@news.povray.org...
> "Thomas de Groot" <t.d### [at] internlDOTnet> wrote:
>> That looks very convincing, Robert. How did you do the compositing?
>
> It was inspired by some code Mike Williams wrote a few years back for 
> color
> attenuating an image. This is just a quick hack - I plan to refine it in 
> the
> next few days into something more useful:
>

Thank you Robert. I shall have to try this out, just to get the feeling of 
it.

Thomas


Post a reply to this message

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