POV-Ray : Newsgroups : povray.advanced-users : Fake shadows in 32-bit images? Server Time
27 Dec 2024 11:19:00 EST (-0500)
  Fake shadows in 32-bit images? (Message 2 to 11 of 21)  
<<< Previous 1 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

From: Alain Martel
Subject: Re: Fake shadows in 32-bit images?
Date: 6 May 2021 10:42:08
Message: <60940040$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;

Another thing : As that scene use radiosity, you need to replace any 


reasonable value. Something in the 0.65..0.8 range.


Post a reply to this message

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

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