Creating A Spotlight Cone Effect
Let the light shine on thee
Table of contentsIntroduction
Creating a Spotlight Cone
This tutorial will walk you through the creation of a spotlight cone object, as pictured here. Note that this object will not actually create any light in your scene. It is simply a graphical effect to simulate the cone of light often seen emiting from directional light sources, such as spotlights, or any type of light emiting object that is fixed in one direction.
To start, you will need a gradient like texture for the surface of the cone. Such as the one
offered below. Save this texture into your DeleD texture folder, and then add it as a material in your scene. You will need to set the texture to use the ADD blend mode.
Now you need to create an object for your spotlight cone.
Normally you would create a cylinder, and scale the top or bottom faces to create a cone like shape, but this is not necessary. Any shape can work, even a long cube if you are being conservative about your polycount. Just make sure to delete the top and bottom faces when you are done shaping the light. They are unneeded, and can look funny, or even add visual artifacts when viewed from the wrong angle (such as the texturing being blended twice once through the bottom, and again through the sides, causing a portion of the cone to appear 'doubly whitened'). Only the side faces should remain.
The remaining side faces now require the graident texture to be fitted to them. This is simple and quick. With your object selected, enter face mode 'f' and hit 'ctrl-a' to select all your faces. Now use the fit texture to face command 'shift-ctrl-f' and you are all done. The texture will line up with the light cone and create a smooth looking falloff as the distance to the light increases.
For best results you will want the spotlight polygons to remain at full brightness after a lightmapping. To do this, make sure you create the spotlight object after the lightmapping is finished, or use the trick in my other tutorial "Creating Glowing Surfaces".
One final note: the cone object is what is referred to in some engines as a detail or non-solid object. This means that game objects should not test for collision against this object. DeleD has no direct support for flagging objects as detail objects, so you are left on your own here. Either make use of the object's user tag to flag the object for use in your own map file parsers, or consult your engine's documentation.forums.