POV-Ray : Newsgroups : povray.advanced-users : Speeding up media : Re: Speeding up media Server Time
15 Oct 2024 23:38:13 EDT (-0400)
  Re: Speeding up media  
From: Mike Horvath
Date: 5 Feb 2021 05:59:53
Message: <601d2529$1@news.povray.org>
On 2/5/2021 5:59 AM, Mike Horvath wrote:
> I have a planetary atmosphere with both scattering and absorption 
> interior media. It renders very slowly. Any tips on speeding it up? Thanks.
> 
> 
> Mike


Here is the media:


// atmosphere
#declare RWorld_Atmos_Color_Scatter	= <0.1, 0.3, 1.0>;
#declare RWorld_Atmos_Color_Absorb	= <0.9, 0.7, 0.0>;		// should be the 
inverse of RWorld_Atmos_Color_Scatter
#declare RWorld_Atmosphere_Object = difference
{
	cylinder {<0,+RWorld_Ring_Width/2,0>,		<0,-RWorld_Ring_Width/2,0>,	 
RWorld_Ring_Radius - 1}	//
	cylinder {<0,+RWorld_Ring_Width/2 + 1,0>,	<0,-RWorld_Ring_Width/2 - 
1,0>,	RWorld_Ring_Radius - RWorld_Atmosphere_Height}
	bounded_by
	{
		cylinder {<0,+RWorld_Ring_Width/2,0>,		<0,-RWorld_Ring_Width/2,0>,	 
RWorld_Ring_Radius - 1}
	}
	hollow
	material
	{
		texture
		{
			pigment {rgbt 1}
		}
		interior
		{
			media
			{
				scattering
				{
					4, RWorld_Atmos_Color_Scatter
				}
				density
				{
					// Reverse: It starts at 1.0 at the origin and decreases to a 
minimum value of 0.0 as it approaches a distance of 1 unit from the Y axis.
					function {1-f_cylindrical(x,y,z)}
					density_map
					{
						[0 rgb 0/10]
						[1-RWorld_Atmosphere_Height/RWorld_Ring_Radius rgb 0/10]
						[1 rgb 1/10]
					}
					scale RWorld_Ring_Radius
				}
			}
			media
			{
				absorption RWorld_Atmos_Color_Absorb
				density
				{
					function {1-f_cylindrical(x,y,z)}
					density_map
					{
						[0 rgb 0/10]
						[1-RWorld_Atmosphere_Height/RWorld_Ring_Radius rgb 0/10]
						[1 rgb 1/10]
					}
					scale RWorld_Ring_Radius
				}
			}
		}
	}
}


Post a reply to this message

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