POV-Ray : Newsgroups : povray.advanced-users : Fake shadows in 32-bit images? Server Time
20 Apr 2024 06:40:55 EDT (-0400)
  Fake shadows in 32-bit images? (Message 4 to 13 of 21)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 8 Messages >>>
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

From: Norbert Kern
Subject: Re: Fake shadows in 32-bit images?
Date: 6 May 2021 18:55:00
Message: <web.6094444e7599ad52fd796d7fb7ae6630@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:

>
> Another thing : As that scene use radiosity, you need to replace any
>
>
> reasonable value. Something in the 0.65..0.8 range.


Hi,

When using radiosity it's useful to include a big sphere and a ground plane,
each with no_image.
I also added some zeros to the y scale of the "shadow" to remove an artifact at
Bald Eagle's nice solution.


Norbert


// +fn +ua

#version 3.7;

#declare RAD = 4;

global_settings {
        assumed_gamma 1
        max_trace_level 5
        noise_generator 2
        #if (RAD > 0)
                radiosity {
                        pretrace_start 0.08
                        pretrace_end 0.04/RAD
                        count 30*RAD
                        nearest_count min (20, RAD)
                        error_bound 2/RAD
                        low_error_factor 0.5
                        recursion_limit 1
                        gray_threshold 0
                        minimum_reuse 0.015
                        brightness 1
                        adc_bailout 0.005
                        normal on
                        media on
                }
        #end
}

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

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

light_source {LS color rgb <1,0.96,0.9>}

#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 =
union {
        cylinder {0, y, 0.05}
        sphere {y, 0.25}
}

object {Object pigment {rgb 1} no_shadow}

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

plane {y, 0 pigment {color rgb 1} no_image}

sphere {
        0, 1000
        pigment {color rgb <0.3,0.4,0.7>}
        no_image
}


Post a reply to this message

From: Bald Eagle
Subject: Re: Fake shadows in 32-bit images?
Date: 6 May 2021 19:20:00
Message: <web.6094796d7599ad521f9dae3025979125@news.povray.org>
"Norbert Kern" <nor### [at] t-onlinede> wrote:

> I also added some zeros to the y scale of the "shadow" to remove an artifact at
> Bald Eagle's nice solution.

Thanks Norbert,

I actually had quite a few zeros and removed them because I had an issue with
the "shadow" even showing up.

I am curious about the artifact (was that at the connection of the sphere and
cylinder?  That's why I switched from union {} to merge {}, to minimize that).

I also just deleted a bunch of stuff about the results of your scene, because:
It looks like _total_ crap in my qtpovray render window.
It looks pretty nice in my directory preview window, when I went to attach it -
it has a very light gray background.
It looks great, but different still, when I open the actual file and view the
result, where it has a very dark gray background.

Hmmmm.....

Thanks,

Bill


Post a reply to this message

<<< Previous 3 Messages Goto Latest 10 Messages Next 8 Messages >>>

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