POV-Ray : Newsgroups : povray.binaries.images : RockTest.pov reference image : Re: RockTest.pov reference image Server Time
29 Apr 2024 03:30:38 EDT (-0400)
  Re: RockTest.pov reference image  
From: [GDS|Entropy]
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

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