POV-Ray : Newsgroups : povray.binaries.images : Composite object in photo : Re: Composite object in photo Server Time
25 Oct 2021 20:01:18 EDT (-0400)
  Re: Composite object in photo  
From: s day
Date: 24 Aug 2021 05:00:00
Message: <web.6124b3ebf317f20f517b74976a8f0b95@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Thanks for the reminder - I ​had a no_shadow method you might be
> interested in too:
>
http://news.povray.org/povray.advanced-users/thread/%3C6090c6ac%241%40news.povray.org%3E/?mtop=434002

Thanks, that is an interesting approach I had not seen. My image was created by
rendering 2 images, the first just has the tripods with "no_image" set on the
tripods and a box where the ground would be to get the shadow. I tried to keep
the background similar in colour but didn't put that much effort in because as
long as it wasn't too different it had little effect on the end result.

I then had to edit that in an image editing app to tidy up the shadows a bit
(where the feet were just to lose the shadow that would be under the tripods
feet.

Attached is a scaled down copy of the edit image used.

Then I render the scene with the background and the tripods which gives a high
quality copy but without the shadows.

Finally take both images and render them using the scene below (Thanks to Robert
McGregor), I modified the final line of Robert's code to scale by
image_width/image_height but don't think I changed anything else.


#version 3.7;
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 { png "tripod_shadow.png" interpolate 2 map_type 0 once }
   translate -0.5
}
#declare p2 = pigment {
   image_map { png "tripod_objects.png" 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
   scale <image_width/image_height, 1, 1>
}


Post a reply to this message


Attachments:
Download 'tripod_shadow.jpg' (20 KB)

Preview of image 'tripod_shadow.jpg'
tripod_shadow.jpg


 

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