POV-Ray : Newsgroups : povray.binaries.images : RockTest.pov reference image Server Time
29 Mar 2024 01:25:31 EDT (-0400)
  RockTest.pov reference image (Message 15 to 24 of 24)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: [GDS|Entropy]
Subject: Re: RockTest.pov reference image
Date: 13 Dec 2016 21:35:00
Message: <web.5850afb167b6c8b61c3f31c90@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 13.12.2016 um 22:15 schrieb [GDS|Entropy]:
>
> > The Fog is being a little weird, because Media without a container is only
> > visible when looking at the plane below it, and it vanishes above the horizon.
> > ?! Weeeird. Very counterintuitive.
>
> Doesn't sound like something that should happen.
>
> Care to share any details?

Sure. :)

The plane in there seems to have no effect, commented or no, which seems to be
improper based on what Alain was saying. Here is a minimal scene which
reproduces the effect being discussed.

#include "functions.inc"

#macro RRand(RS, Min, Max)
    (rand(RS) * (Max - Min) + Min)
#end

#declare Radiosity = true;
#declare AreaLight = true;

#declare globalFogActive = true;
#declare globalFogDensity = true;
#declare globalFogBaseValue = 0.1;

#local ScaleAmount = 120.0;   //    Was 60.
#local ScaleFactor = ScaleAmount / ((ScaleAmount * 2.50) * (log(ScaleAmount)));

#local ColorFactor = (((ScaleAmount * ScaleFactor) / (ScaleAmount)) /
(ScaleFactor * ScaleFactor));

global_settings
{
    assumed_gamma 1.0
    //max_trace_level 25
    #if (Radiosity)
        radiosity
        {
            pretrace_start      0.08    //    start pretrace at this size
            pretrace_end        0.04    //    end pretrace at this size
            count               35      //    higher -> higher quality (1..1600)
[35]
            nearest_count       5       //    higher -> higher quality (1..10)
[5]
            error_bound         2.8     //    higher -> smoother, less accurate
[1.8]
            recursion_limit     6       //    how much interreflections are
calculated (1..5+) [3]
            low_error_factor    0.5     //    reduce error_bound during last
pretrace step
            gray_threshold      0.0     //    increase for weakening colors
(0..1) [0]
            minimum_reuse       0.015   //    reuse of old radiosity samples
[0.015]
            brightness          1       //    brightness of radiosity effects
(0..1) [1]

            adc_bailout         0.01 / 2
            //normal on                 //    take surface normals into account
[off]
            media on                    //    take media into account [off]
            //save_file "file_name"     //    save radiosity data
            //load_file "file_name"     //    load saved radiosity data
            //always_sample off           //    turn sampling in final trace off
[on]
            always_sample on
            //max_sample 1.0            //    maximum brightness of samples
        }
    #end
}

#default
{
    texture
    {
        pigment
        {
            rgb 1
        }

        #if (Radiosity)
            finish
            {
                ambient 0.0
                diffuse 0.6
                specular 0.3
            }
        #else
            finish
            {
                ambient 0.1
                diffuse 0.6
                specular 0.3
            }
        #end
    }
}

#if (AreaLight)
    light_source
    {
        0 * x
        color rgb <0.2734, 0.5078, 0.7031>
        area_light
        <100, 0, 0>
        <0, 0, 100>
        4, 4
        adaptive 0
        jitter
        translate <0,1000,-2000>
        photons
        {
            refraction on
            reflection on
        }
    }
#else
    light_source
    {
        0 * x
        color rgb <1, 1, 1>
        translate <-20, 40, -20>
        photons
        {
            refraction on
            reflection on
        }
    }
#end

        camera
        {
         location <-5, 6, -18>
         up y * image_height
         right x * image_width
         look_at <0, 1.5, 0>
         angle 45
        }

plane
{
    z,
    100
    no_radiosity
    no_image
    no_shadow
    no_reflection
    inverse
}

//    Global media.
#macro GlobalFog(base, useDensity)

    #if (useDensity)

        media
        {
            method 3
            //samples 10, 100
            samples 1, 10

            scattering
            {
                1, <1, 1, 1> * 0.01
            }

            intervals 15

            density
            {
                //granite   //    Very wispy.
                bumps     //    Smooth, evenly changing density.

                #if (ScaleAmount > 15)
                    scale 1 / ScaleAmount
                #end

                color_map
                {
                    #local Kk = 0;

                    #while(Kk <= 10)
                        #if (Kk = 0)
                            [Kk * 0.1 rgb <Kk, Kk, Kk>]
                        #else
                            [Kk * 0.1 rgb <Kk, Kk, Kk> * (base + 0.1) /
ScaleFactor]
                        #end
                    #local Kk = Kk + 1;
                    #end

                    #while(Kk >= 10)
                        #if (Kk = 0)
                            [Kk * 0.1 rgb <Kk, Kk, Kk>]
                        #else
                            [Kk * 0.1 rgb <Kk, Kk, Kk> * (base + 0.0) /
ScaleFactor]
                        #end
                    #local Kk = Kk - 1;
                    #end
                }

                turbulence 0.25
            }
        }
    #else
        media
        {
            method 3
            //samples 10, 100
            samples 1, 10

            scattering
            {
                1, <1, 1, 1> * 0.01
            }

            intervals 15
        }
    #end
#end

#if (globalFogActive)
    GlobalFog(globalFogBaseValue, globalFogDensity)
#end

#declare f_Height =
function
{
    0.5 * f_wrinkles(x * 0.4, y * 0.4, z * 0.4)
}

#macro Ground(Height, Extent)
    #local eX = Extent.x;
    #local eY = Extent.y;
    #local eZ = Extent.z;

    #local GroundSurface =
    isosurface
    {
        function
        {
            //(y - f_Height(x, -1, z)) / Height
            (y - (0.5 * f_wrinkles(x * eX, y * eY, z * eZ))) / Height
        }

        max_gradient 2.0

        contained_by
        {
            box
            {
                <-400, -5, -400>,
                <400, 0.15, 400>
            }
        }

        accuracy 1e-3
    }

    object
    {
        GroundSurface
    }
#end

#local GroundExtent = <0.4, 0.4, 0.4>;
Ground(10.6, GroundExtent)

#macro DistributePoles(Extent, CameraLocation)
    #local RsA = seed(112080);

    #local Poles =
    union
    {
        #local I = -Extent;
        #while(I < Extent)
            #local J = -Extent;
            #while(J < Extent)

                cylinder
                {
                    <I, 0, J> * 2,
                    <I, 1, J> * 2,
                    0.25

                }

            #local J = J + 1;
            #end
        #local I = I + 1;
        #end
    }

    object
    {
        Poles
        translate <Extent * 0.5, 0, Extent * 0.5>
    }
#end

#local Extent = 20;
DistributePoles(Extent, <0, 10, -10>)


Post a reply to this message

From: omniverse
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 00:10:00
Message: <web.5850d3a067b6c8b69c5d6c810@news.povray.org>
"[GDS|Entropy]" <nomail@nomail> wrote:
> clipka <ano### [at] anonymousorg> wrote:
> > Am 13.12.2016 um 22:15 schrieb [GDS|Entropy]:
> >
> > > The Fog is being a little weird, because Media without a container is only
> > > visible when looking at the plane below it, and it vanishes above the horizon.
> > > ?! Weeeird. Very counterintuitive.
> >
> > Doesn't sound like something that should happen.
> >
> > Care to share any details?
>
> Sure. :)
>
> The plane in there seems to have no effect, commented or no, which seems to be
> improper based on what Alain was saying. Here is a minimal scene which
> reproduces the effect being discussed.

'Official' and 'alpha' versions render differently so something changed, I guess
you're not using official 3.7? I get the black void in 3.7.1.1-alpha, while
official 3.7.0 shows oversaturation of media as would be expected.

If you add the following spotlight to your (1st) light, it can apparently create
a finite region for the rays. That is mentioned in the docs:

http://wiki.povray.org/content/Reference:Atmospheric_Media

  spotlight point_at <0,-1,1> radius 18 falloff 20

This could take some tweaking to get better, I just threw it in there, but there
didn't seem to be much range beyond that radius and falloff before it fails to
look okay again. Maybe with better point_at angle, just so it isn't directed
into infinity again.

Bob


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 00:30:00
Message: <web.5850d83e67b6c8b61c3f31c90@news.povray.org>
"omniverse" <omn### [at] charternet> wrote:
> "[GDS|Entropy]" <nomail@nomail> wrote:
> > clipka <ano### [at] anonymousorg> wrote:
> > > Am 13.12.2016 um 22:15 schrieb [GDS|Entropy]:
> > >
> > > > The Fog is being a little weird, because Media without a container is only
> > > > visible when looking at the plane below it, and it vanishes above the horizon.
> > > > ?! Weeeird. Very counterintuitive.
> > >
> > > Doesn't sound like something that should happen.
> > >
> > > Care to share any details?
> >
> > Sure. :)
> >
> > The plane in there seems to have no effect, commented or no, which seems to be
> > improper based on what Alain was saying. Here is a minimal scene which
> > reproduces the effect being discussed.
>
> 'Official' and 'alpha' versions render differently so something changed, I guess
> you're not using official 3.7? I get the black void in 3.7.1.1-alpha, while
> official 3.7.0 shows oversaturation of media as would be expected.
>
> If you add the following spotlight to your (1st) light, it can apparently create
> a finite region for the rays. That is mentioned in the docs:
>
> http://wiki.povray.org/content/Reference:Atmospheric_Media
>
>   spotlight point_at <0,-1,1> radius 18 falloff 20
>
> This could take some tweaking to get better, I just threw it in there, but there
> didn't seem to be much range beyond that radius and falloff before it fails to
> look okay again. Maybe with better point_at angle, just so it isn't directed
> into infinity again.
>
> Bob

You are correct I am using UberPov, but didn't think to include that information
because I had seen this before [above horizon cutoff] in other versions of Pov.

Ian


Post a reply to this message

From: clipka
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 00:44:32
Message: <5850dc40$1@news.povray.org>
Am 14.12.2016 um 06:07 schrieb omniverse:
> "[GDS|Entropy]" <nomail@nomail> wrote:
>> clipka <ano### [at] anonymousorg> wrote:
>>> Am 13.12.2016 um 22:15 schrieb [GDS|Entropy]:
>>>
>>>> The Fog is being a little weird, because Media without a container is only
>>>> visible when looking at the plane below it, and it vanishes above the horizon.
>>>> ?! Weeeird. Very counterintuitive.
>>>
>>> Doesn't sound like something that should happen.
>>>
>>> Care to share any details?
>>
>> Sure. :)
>>
>> The plane in there seems to have no effect, commented or no, which seems to be
>> improper based on what Alain was saying. Here is a minimal scene which
>> reproduces the effect being discussed.
> 
> 'Official' and 'alpha' versions render differently so something changed, I guess
> you're not using official 3.7? I get the black void in 3.7.1.1-alpha, while
> official 3.7.0 shows oversaturation of media as would be expected.

Actually, no, that's not what is happening.

Official 3.7.0 shows oversaturation simply because media sampling method
3 had always been buggy, showing somewhat wrong results wherever the
actual number of samples is low (such as in uniform media); this has
been fixed in 3.7.1.

With media sampling methods 1 and 2, POV-Ray has always (since 3.6.2 at
any rate) shown the very same symptoms.

To demonstrate that 3.7.0 sampling method 3 behavior /cannot/ be
correct, just notice how the oversaturation disappears close to the
horizon. With proper computations we should expect exactly the opposite
effect.


Post a reply to this message

From: Jérôme M. Berger
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 01:18:06
Message: <5850e41e$1@news.povray.org>
On 12/14/2016 12:05 AM, [GDS|Entropy] wrote:
> That does make the media reappear [using either inverse or hollow], but
 also
> retains the issue of the media vanishing above horizon. I must really b
e borking
> this up lol! :)
> 
	Don't make the plane no_image no_reflection, and instead make it fully
transparent (rgbt 1).

		Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message

From: omniverse
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 02:35:01
Message: <web.5850f58967b6c8b69c5d6c810@news.povray.org>
=?UTF-8?B?SsOpcsO0bWUgTS4gQmVyZ2Vy?= <jeberger@free.fr> wrote:
> On 12/14/2016 12:05 AM, [GDS|Entropy] wrote:
> > That does make the media reappear [using either inverse or hollow], but
>  also
> > retains the issue of the media vanishing above horizon. I must really b
> e borking
> > this up lol! :)
> >
>  Don't make the plane no_image no_reflection, and instead make it fully
> transparent (rgbt 1).

Must be the no_image. I tried doing that, pigment {rgbt 1}, and it isn't needed
either.

Thanks Clipka for the media 3 explanation.


Post a reply to this message

From: clipka
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 03:41:32
Message: <585105bc$1@news.povray.org>
Am 13.12.2016 um 22:15 schrieb [GDS|Entropy]:

> Any idea why this is, and how to fix it? Is the only choice to bound the media?
> I am guessing that this is because it is not reasonable to calculate media for
> an infinite space, but I could be wrong.

Yes, I have an idea now.

It's a flaw in media computation regarding the self-extinction effect of
media.

With sampling method 3, in essence POV-Ray divides the media interval
into a number of sub-intervals, and for each sub-interval computes (a)
the emissive(*) effect and (b) the extinction effect. It then multiplies
the emissive effect of that sub-interval by a factor to account for the
extinction effect of earlier sub-intervals as self-extinction within the
sub-interval itself.

It does a clean job at accounting for the extinction effect from earlier
sub-intervals; however, when it comes to self-extinction, POV-Ray simply
pretends that a sub-interval's emissive effect is precisely located at
the center of the sub-interval, while its extinction effect is
distributed evenly alongt the entire length of the sub-interval.

That's a good enough approximation when the length of a sub-interval is
reasonably small compared to the density of the medium. However, with
sufficiently dense media or sufficiently large distances involved, this
approximation will tend to underestimate the net emissive effect, to the
point where it can turn out pitch black.

This can be fixed, by using a more precise formula for the
sub-interval's self-extinction.


Media sampling methods 1 and 2 are different beasts, which do an even
poorer job at estimating the self-extinction effect, and it may not be
feasible to fix those.


(*From the perspective of the media computations code, scattering is
also an emissive effect, the only difference being that its brightness
depends on incoming light.)


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 10:35:01
Message: <web.5851663f67b6c8b61c3f31c90@news.povray.org>
Hey thanks everyone, adjusting the plane to remove no_image did the trick, and
thank you Clipka for explaining the media internals, it is interesting to learn
how these things work!

Now I can get back to making useful bits for this. :)

I will update when more progress has been made.

Ian


Post a reply to this message

From: clipka
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 11:57:25
Message: <585179f5@news.povray.org>
Am 14.12.2016 um 16:33 schrieb [GDS|Entropy]:
> Hey thanks everyone, adjusting the plane to remove no_image did the trick, and
> thank you Clipka for explaining the media internals, it is interesting to learn
> how these things work!
> 
> Now I can get back to making useful bits for this. :)

... or try this one, with media sampling method 3:

https://github.com/POV-Ray/povray/releases/tag/v3.7.1-alpha.8917471

(Unfortunately sampling methods 1 and 2 don't lend themselves to an easy
fix for the problem.)


Post a reply to this message

From: Jérôme M. Berger
Subject: Re: RockTest.pov reference image
Date: 14 Dec 2016 14:01:04
Message: <585196f0$1@news.povray.org>
On 12/14/2016 08:32 AM, omniverse wrote:
> Must be the no_image. I tried doing that, pigment {rgbt 1}, and it isn'
t needed
> either.
> 
	rgbt 1 is not needed to make the media appear, but it is needed if you
want the plane to be invisible in all circumstances (of course, this is
not really necessary since the plane should be hidden by the media anyway
).

	You need to remove no_reflection if you want your media to work in
mirrors (not an issue with your test scene but could be an issue for
others).

		Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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