POV-Ray : Newsgroups : povray.advanced-users : Area light : Area light Server Time
19 Apr 2024 22:58:54 EDT (-0400)
  Area light  
From: Mike Horvath
Date: 6 Aug 2018 01:57:30
Message: <5b67e34a$1@news.povray.org>
In one of my scenes, I have constructed my own area light by placing 
multiple point lights using spherical coordinates, so that a bulb or sun 
is simulated and shadows are smoothed a bit.

////////////////////////////////////////////////////////////////////
#if (Toggle_Area_Light = true)
	// my version of an area light, very slow
	#local light_radius		= RWorld_sun_radius;
	#local light_theta		= 0;
	#local light_theta_num	= 8;
	#local light_theta_dif	= 2 * pi/light_theta_num;
	#local light_phi_num	= 4;
	#local light_phi_dif	= pi/light_phi_num;

	#declare light_lumens	= 2/light_theta_num/light_phi_num;		// float
	#declare light_temp		= Daylight(5800);				// float
	#declare light_color	= Light_Color(light_temp,light_lumens);		// vector

	#for (i, 1, light_theta_num)
		#local light_phi = 0;
		#for (j, 1, light_phi_num)
			#local light_x = light_radius * cos(light_theta) * sin(light_phi);
			#local light_y = light_radius * cos(light_phi);
			#local light_z = light_radius * sin(light_theta) * sin(light_phi);
			light_source
			{
				<light_x, light_y, light_z>
				light_color
			}
			#local light_phi = light_phi + light_phi_dif;
		#end
		#local light_theta = light_theta + light_theta_dif;
	#end
#else
	#declare light_lumens	= 2;						// float
	#declare light_temp		= Daylight(5800);				// float
	#declare light_color	= Light_Color(light_temp,light_lumens);		// vector
//	#declare light_color	= light_color * light_color;

	light_source
	{
		0
		light_color
	}
#end
////////////////////////////////////////////////////////////////////

However, IIRC, POV-Ray's own area light syntax allows for similar 
effects. What are the advantages of POV-Ray area lights over the method 
I selected above?

Thanks.


Mike


Post a reply to this message

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