POV-Ray : Newsgroups : povray.advanced-users : Fake shadows in 32-bit images? Server Time
10 May 2021 21:40:02 EDT (-0400)
  Fake shadows in 32-bit images? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Mike Horvath
Subject: Fake shadows in 32-bit images?
Date: 3 May 2021 23:59:40
Message: <6090c6ac$1@news.povray.org>
I know it's possible to create separate 8-bit shadows and 32-bit sprites 
in separate processes and then alter them in Photoshop. But could it be 
possible to do this all in one step in POV-Ray?

What I mean is, render a sprite of a 3D object with transparent 
background, but also give the object a semi-transparent shadow.

Thanks!


Mike


Post a reply to this message

From: jr
Subject: Re: Fake shadows in 32-bit images?
Date: 4 May 2021 02:35:00
Message: <web.6090e9d07599ad5279819d986cde94f1@news.povray.org>
hi,

Mike Horvath <mik### [at] gmailcom> wrote:
> ...
> What I mean is, render a sprite of a 3D object with transparent
> background, but also give the object a semi-transparent shadow.

no idea, but there's related info in the docs:
<https://wiki.povray.org/content/Reference:Image_Map#The_Filter_and_Transmit_Bitmap_Modifiers>


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Fake shadows in 32-bit images?
Date: 4 May 2021 05:55:00
Message: <web.609118ca7599ad521f9dae3025979125@news.povray.org>
http://www.imagico.de/pov/icons.php


Post a reply to this message

From: ingo
Subject: Re: Fake shadows in 32-bit images?
Date: 4 May 2021 11:17:07
Message: <XnsAD20AFD4BA02Fseed7@news.povray.org>
in news:6090c6ac$1@news.povray.org Mike Horvath wrote:

> But could it be 
> possible to do this all in one step in POV-Ray?

Never tried it, maybe with the user defined camera?

Ingo


Post a reply to this message

From: Bald Eagle
Subject: Re: Fake shadows in 32-bit images?
Date: 4 May 2021 14:25:00
Message: <web.609191017599ad521f9dae3025979125@news.povray.org>
There might be a way to do this with functions, aoi, slope, or some other
method...

But a quick and dirty cheat like this works:

Take your object(s) and put all of the parts in a merge.

Define a vector location LS for your light source.
Define a second vector location LS2 that is -vnormalize(LS) so that it is
mirrored across the origin.
Define a matrix transform with LS2 as your new y basis vector.


Put your object in the scene with the no_shadow keyword.

Put your object in the scene again, apply the matrix transform, and scale it
really small in the y direction, and apply your semi-transparent texture to it.


#version 3.8;
global_settings {assumed_gamma 1}

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

sky_sphere {pigment {rgb 1}}

#declare LS = <5, 15, -10>;

light_source {LS color rgb 1}
#declare E = 0.000001;

#declare LS2 = -vnormalize (LS);

#declare ShadowTrans = transform {
 matrix < 1, 0, 0,
   LS2.x, LS2.y, LS2.z
   0, 0, 1,
   0, 0, 0
 >
}

#declare Object =
merge {
 cylinder {0, y, 0.05}
 sphere {y, 0.25}
}

object {Object pigment {rgb z} no_shadow}

object {Object
 transform {ShadowTrans}
 scale <1, 0.001, 1>
 pigment {rgbt <0, 0, 0, 0.5>}
}


Post a reply to this message

From: Cousin Ricky
Subject: Re: Fake shadows in 32-bit images?
Date: 4 May 2021 22:48:01
Message: <60920761$1@news.povray.org>
On 2021-05-04 2:22 PM (-4), Bald Eagle wrote:
> [snip]
> 
> sky_sphere {pigment {rgb 1}}
> 
> [snip]

This needs to be sky_sphere {pigment {rgbt 1}}

And then render with +UA +FN


Post a reply to this message

From: Mike Horvath
Subject: Re: Fake shadows in 32-bit images?
Date: 4 May 2021 23:39:16
Message: <60921364$1@news.povray.org>
On 5/4/2021 5:50 AM, Bald Eagle wrote:
> 
> http://www.imagico.de/pov/icons.php
> 
> 
> 


Very nice. Does this only work with Megapov?


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Fake shadows in 32-bit images?
Date: 4 May 2021 23:44:59
Message: <609214bb$1@news.povray.org>
Thanks! I will give it a try.


On 5/4/2021 2:22 PM, Bald Eagle wrote:
> Put your object in the scene again, apply the matrix transform, and scale it
> really small in the y direction, and apply your semi-transparent texture to it.

I wish POV-Ray supported scaling objects to zero, though I have no idea 
how that should be implemented in the code. Small details like this 
really bother me, LOL!


Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: Fake shadows in 32-bit images?
Date: 5 May 2021 06:20:00
Message: <web.609270407599ad521f9dae3025979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:

> This needs to be sky_sphere {pigment {rgbt 1}}
>
> And then render with +UA +FN

Right, I figured he already knew how to do the transparent part, and I was just
working out the fake shadow.   But good for accuracy, completeness, and future
search results.  :)


Post a reply to this message

From: Alain Martel
Subject: Re: Fake shadows in 32-bit images?
Date: 6 May 2021 10:38:05
Message: <6093ff4d$1@news.povray.org>
> On 5/4/2021 5:50 AM, Bald Eagle wrote:
>>
>> http://www.imagico.de/pov/icons.php
>>
>>
>>
> 
> 
> Very nice. Does this only work with Megapov?
> 
> 
> Mike

Should work correctly using version 3.7 or later.
The author used MegaPOV because, at the time in 2014, the latest version 
was 3.6, and that version did not include the features needed. Those are 
now standard features.

The only thing that you need to do is to change the #version directive to :
#version 3.7;
or
#version 3.8;


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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