POV-Ray : Newsgroups : povray.binaries.images : Re: Cloud Surface : Re: Cloud Surface Server Time
15 May 2024 10:57:13 EDT (-0400)
  Re: Cloud Surface  
From: Alain
Date: 29 Nov 2017 19:07:46
Message: <5a1f4bd2$1@news.povray.org>

> Alain <kua### [at] videotronca> wrote:

>>> I'm thinking media won't be able to do what's wanted anyway. Sure, emitting
>>> media will illuminate surrounding objects, but cast shadows like a light on
>>> distant things? No, don't believe it can.
>>
>> Emissive media CAN cast shadows.
>> For that to happen, you need to use radiosity with "media on" in the
>> radiosity block.
>> That way, the media can act like a fuzzy area_light whose brightness can
>> vary across it's visible surface.
>>
>> radiosity{count 20000 media on}
>> default{radiosity{importance 75/20000}}
>> sphere{100*x 2 hollow pigment{rgbt 1}
>>    interior{media{emission rgb<100, 50, 20>*25 samples 20}
>>    radiosity{importance 1}}
>>
>> Will use an average of 75 radiosity samples for most of the scene's
>> objects, but a very high count density for that relatively small and
>> bright object.
> 
> Well, seeing is believing... and unfortunately I wasn't able to do that. Test
> scene below, comparing actual light with emitting media. I don't want to doubt
> your idea but here's what I tried.
> 
> Curiously, after getting nowhere at first, I found radiosity 'brightness' needed
> to be increased. Rather drastically, from what I've done with it before.
> 
> Still very different thing for these two illumination methods, like I expected,
> no well-defined shadows. Probably because of how radiosity acts on both light
> and shadow regions... or do I recall someone saying unlit portions are
> ignored...?
> 
> Anyway... for your perusal, a test scene:
> 
> //--------------------------------------------------------------------------
> #version 3.7;
> //--------------------------------------------------------------------------
> #default{ finish{ ambient 0 diffuse 1 }}
> //------------------------------------------
> 
> #local NoLight=yes;  // yes = emitting media sphere, else light
> 
> 
> global_settings{
>   assumed_gamma 1
>    ambient_light 0
>      radiosity{
>      pretrace_start 0.04
>      pretrace_end 0.01
> 
>      count 20000 //1601
> 
>      recursion_limit 3
> 
>      nearest_count 10 //12
> 
>      always_sample off
>      max_sample 0.9
> 
>      error_bound 1.33 //1.2 //0.4
/*You may need a smaller value here.
   Smaller values tend to allow sharper shadows.
*/
>      low_error_factor 0.4 //0.8
//Should be OK
// Default is 0.5
// Was 0.8 back in version 3.5
> 
>      maximum_reuse 0.16*2 //0.2
>      minimum_reuse 0.028*2 //0.015
> 
>      adc_bailout 1/127 //0.01
> 
>      gray_threshold 0.0 //0
>      brightness #if (NoLight) 20 #else 1 #end
/* Don't increase this.
If you increase brightness like that, it will play havoc elsewhere.
It's usually better to leave this parameter out.
*/
> 
>      normal on
>      media on
>    }
>   }// end global_settings
> // ----------------------------------------
> 
> #default{radiosity{importance 75/20000}}
> 
> //sky_sphere{ pigment { color rgb <1,1,1>} }
> 
> camera{ location <0, 22, -33>
>          right x*image_width/image_height
>          rotate 12*y
>          look_at <-1.25,2.8,0>
>          angle 50
>        }
> 
> plane{ <0,1,0>,0 // floor
>    texture{
>      pigment { color rgb 1 }
>      finish {
>        ambient 0.0
>        diffuse 1
>        specular 0.4
>        roughness 0.01
>      }
>    }
> }
> // -----------------------------------------
> 
> union {
> #for (Cnt,1,3)
>    difference {
>       box { <-1,-1,-1>,<1,1,1> }
>       sphere {0,1.40 inverse  texture{ pigment{ color rgb <1,1,1>*0.5}}  }
>       sphere {0,1.25}
>       texture{ pigment{ color rgb <1,1,1>}
>                finish{ phong 1 diffuse 1-Cnt/10 }
>              }
>       translate <0,0,0>
>       scale 1+Cnt*0.65
>       translate <0,1+Cnt*0.30,0>
>       rotate Cnt*<0,-22,0>
>     }//----------
> #end
> scale <1,1,1>
> translate <0,1,0>
> hollow on
> }
> // -----------------------------------------
> 
> #if (NoLight)
> 
> sphere {
>   0, 1
>   hollow on
>   pigment {color rgbt 1}
>   interior {
>    media {
>     emission <100, 50, 20>*25
//You probably need to crank this up, maybe a LOT!
// try emission <100, 50, 20>*250

>     //scattering {1, 1}
>     samples 20
>     density {
>      spherical
>      density_map {
>       [0 rgb 0]
>       [1 rgb 1]
>      }
>     }
>    }
>   }
>   scale 2
>   translate <-5,5,-5>*2 // near comment out *2, or far
>   radiosity {importance 1}
> }
> 
> #else
> 
> light_source {
>   <-5,5,-5>*2,
>   color <100, 50, 20>/100
>   looks_like {sphere {0,2
>    pigment {color rgb <100, 50, 20>/20}
>   finish {emission 1}}}
>   area_light x*2,y*2,10,10 jitter circular orient adaptive 2
Here, 10,10 becomes 17,17 due to the way that adaptive work.

> }
> 
> #end
> 
> 

The emissive illumination fade out according to the square of the 
distance. It can come from an emissive surface or media.
The net effect is proportional to the intensity of the emission, time, 
the emissive surface area, divided by the square of the distance to the 
illuminated surface.
For a normal light to behave like this, you need to add (in this case):
fade_power 2
fade_distance 2

and increase the light's intensity :
color <100, 50, 20>

When using adaptive, the number of sub lights can only take some values. 
The first are : 2 (2^0+1), 3 (2^1+1), 5 (2^2+1), 9 (2^3+1), 17 (2^4+1), 
33 (2^5+1), 65 (2^6+1), ...
In between values are bumped up to the next value in the list.
Formula : (2 ^MaxSubdivisionSteps)+1


Post a reply to this message

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