POV-Ray : Newsgroups : povray.advanced-users : The Mathematics Behind Spotlights : Re: The Mathematics Behind Spotlights Server Time
28 Jul 2024 16:25:31 EDT (-0400)
  Re: The Mathematics Behind Spotlights  
From: Alain
Date: 4 Dec 2004 17:30:04
Message: <41b23a6c$1@news.povray.org>
Captain Chemistry nous apporta ses lumieres ainsi en ce 2004-12-04 
15:47... :

>I am interested in exactly how spotlights work.
>
>If you chuck a spotlight through some scattering media you get a nice effect
>but it takes ages.
>
>What if I told you that the SAME EFFECT could be obtained by creating some
>functions that *simulate* spotlight intensity at all points in it's cone
>and then using those functions in some EMITTING media which can be maybe
>100 times faster than scattering media in a slightly detailed image (no
>joke).
>
>For the following functions I assume the spotlight points up in the positive
>y direction and starts as a point at the origin.
>
>At this point, I need to know several functions:
>* a 3D function to assign a value between 0 and 1 for all points in a
>spotlight cone given these parameters: radius, falloff, tightness
>
>* a light fading function. This is (i think) in the pov documentation so
>that's not as important.
>
>I am mainly interested in the first function. At all points in the radius
>cone (where the angle between the point and the y axis is less than the
>"radius") the light intensity multiplier is 1.
>
>At all points in the falloff section the light intensity multiplier falls
>off from 1 and reaches zero by the time the angle reaches "falloff"
>degrees.
>
>I am guessing that there is an exponential decay here (something like an
>s-bend thing) but the documentation doesn't go into the actual formula.
>
>I should like to know that formula.
>
>If anyone could help (even dudes on the pov-team that made this stuff) I
>would be very grateful.
>
>Nathan Jolly (Captain Chemistry)
>
>
>  
>
What realy take long, is the media itself, not the spotlight. If the 
media is not important for the rest of your scene, try containing it in 
some invisible (rgbt 1) object like a cone slightly larger than the beam 
of your spotlight.
A problem with the method you describe: you don't get any light to shine 
on anything that the spotlight is suposed to light up, even with 
radiosity and media on.
Emiting madia is not faster than a scattering one, and solving your 
function will take some extra time making your scene longer to render.

Alain


Post a reply to this message

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