Spotlight - inner cone angle

BlitzMax Forums/BlitzMax OpenGL Programming/Spotlight - inner cone angle

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks for the info. I will use this.

Because hardware lights are more or less infinite, and do not have a linear range, I recommend setting the attenuation to 0 (no attenutation) and multiplying the light color by a falloff value based on entity distance. For example, if the light's range is 100, the light color is 255,255,255, and a mesh is 75 units of distance away from the light, set the light color to 64,64,64 and render with no attentuation.

Before rendering each mesh, you have to enable and set up lights that are to effect that mesh. This also lets you check the line of sight, to test whether the light should effect the mesh or not. In my own engine, I only test the line of sight with brushes (which is fast), and don't worry about whether a mesh occludes another mesh.