POV-Ray : Newsgroups : povray.general : scattering media oddities : Re: scattering media oddities Server Time
30 Jul 2024 00:28:14 EDT (-0400)
  Re: scattering media oddities  
From: Alain
Date: 15 Mar 2010 18:31:45
Message: <4b9eb551$1@news.povray.org>

> Alain<aze### [at] qwertyorg>  wrote:
>> You want to model a lump of foam, but you model a box filled with smoke.
>> That's not the same thing.
>
> Both media show the physical process of scattering due to scatterers (quote from
> wikipedia: "The types of non-uniformities which can cause scattering, sometimes
> known as scatterers or scattering centers, are too numerous to list, but a small
> sample includes particles, bubbles, droplets, density fluctuations in fluids,
> defects in crystalline solids, surface roughness, cells in organisms, ...")
>
> The idea was to use the media scattering to exploit the (probably) higher
> efficiency and not modeling the micro cells of the foam explicitly.
>
> The objective is to get the scattering look of a dense media, without overly
> bright surface. Single foam cells do not need to be visible. The picture I
> posted was a little misleading in this aspect, but it shows nicely the desired
> light glow at the edges of surfaces in shadow areas.
>
>> Despite the dimention of your object, your media is not what I call dense.
>
> How could the density be increased? Setting the scatter rgb to higher values
> leads to way to high brightness levels on the surface. Using attenuation and
> extinction this could be fixed, but was not changing the demonstrated visibility
> issues.
>
> And what I still don't get is why a simple division of the same media into
> several boxes yields a completely different result.
>
>> You should try with an isosurface using some function that have
>> repeating holes, like leopard. Use "all_intersections. Use a material
>> with some transparency, an interior with an ior of about 1.4 to 1.7,
>> fade_color fade_distance and fade_power 1 or fade_power 1001.
>> The texture should have some transparency:
>>    rgbf<Red_Value, Green_Value, Blue_Value, 0.7>
>> Add some specular to the finish: specular 0.5 roughness 0.01.
>
> My first try was actually to model the foam cells explicitly, I used a script
> generated mesh2 with irregular cells for this purpose. Due to the numerous
> partly filtering surface layers there was actually no need for fading, but the
> light glow due to scattering was not very realistic. And the performance was not
> very good, especially with the high number of cells needed to get a fine foam.
>
> Whats wrong is not the foamy look of the surface, but the feature visibility of
> objects in the media. If they are behind the media volume, the suddenly
> disappear -- instead of fading away with distance. This effect is demonstrated
> in the model I posted: just increase the number of media slices, and the object
> visibility changes despite the fact that the media effectly stays unchanged and
> is only distributed along several boxes. This seems quite illogical to me.
>
>
>
You should be concious of a stiff limitation/assumption with medias:
ALL medias assume that any ray going through the media will only 
interact with it about 1 time or less. That is, NO multiple interactions.

As Christian Froelichlin mentioned, you may have beter results using the 
current 3.7 beta and the SSLT feature. It assume that there are MANY 
interactions between any ray and the material encountered.
With that, you model your object as a box with a buzzy normal and some 
fine texture, or an isosurface that have a rough surface using something 
like f_granite, f_agate or f_wrinkles.

You can also use your actual model and add fade_color, fade_distance and 
fade_power 1001 to your interior.
Adding some ior and playing with the normal will also increase the 
beleivability.

Try this:
Add the following to your box just before it's closing bracket:
  normal{granite 0.3 scale 0.01}

Then, change your material ass follow:
#declare M_fog =
material {
  texture {
   pigment { color rgbf <1,1,1,1> }
   finish{specular 0.3 roughness 0.01}
	}
  interior {
   //fade_color rgb<0.5, 0.5, 0.5> fade_distance 0.01 fade_power 1001
   //media {  scattering { 1,     White *0.08  }      }
   ior 1.44
    }
}

Render like this, then, try uncommenting the media or the fade_... lines.
With just the ior and normal, the surface becomes very grainny and your 
cylinder quickly "dissolve" away.
Play with the scale and depth of the normal as well as the ior to 
controll the effect.
Antialiasing will change the general aspect, making it much smoother.


Alain


Post a reply to this message

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