Rotating the source of a spotlight with source length > 0
When creating a spotlight with a source length greater then 0 the light always seems to extend in the direction of the spot with no apparent method to change the source's orientation.
A fluorescent tube would seem like an obvious use-case for capsule shaped lights. However when using a spotlight to simulate a fluorescent tube with a reflector you would expect the source shape to be perpendicular to the spotlight's direction not parallel to it. Is it possible to somehow change the source shape's orientation without rotating the actual light?
Hello Everyone -
Since Jak had asked for a Lighter, TJ has asked me to come in and answer the question regarding the behavior of spotlights, IES textures and Source Length. Just to blow my own horn since most people on Answerhub and Forums know me for my particle effects and rendering answers, before I worked at Epic, I worked as a Lighting Designer professionally in an architectural and theatrical capacity designing lights for building interior and off-Broadway productions as well as teaching lighting design on the secondary, collegiate and graduate level. I hold a Master's degree from the University of Florida in Lighting Design and Technical Production and was a member of the Illuminating Engineering Society of North America and my graduate adviser holds membership on the IES Museum & Art Gallery Lighting committee. [Horn down.]
The spotlights in the engine function identically to spotlights in the real world. Spotlights must contain 3 things to functionally be a spotlight over an open lamp (light bulb) which is exactly what the Point Light stands in for in the engine. Spotlights must have a lamp (source), a reflector (various types in the real world including parabolic, spherical and ellipsoidal [the engine specifically uses an ellipsoidal]) and at least 1 lens. For a spotlight to work the source (lamp) reflects light like any lamp in all directions then the light is reflected to a singular focal point which is then passed through a lens or a series of lens in order to generate a light cone. Here are some good reference pictures:
Since the Spotlight in the engine shares mathematically the same behavior as our images above, lets look at what would happen to our spotlight if you increased the source length or source radius. With Source Radius, you are limited by the reflector's size in the real world and in the engine you will be limited by the Inner and Outer Light Angles which will stop all light. Source Length is actually far more complicated as it has no actual real world equivalent as increasing the source point would effectively destroy the relationship between the reflector and the lens and ultimately would defeat the focusing nature of a spotlight. So, in general, for a spotlight I would not recommend adjusting the Source Radius or Length if you are trying to duplicate real world conditions. The same would be true for wanting to rotate a source length in a spotlight, this would effectively break the real world nature of the light source in the engine.
IES textures are mathematical ASCII files which describe the lumen (lighting intensity) output of a particular fixture within the 360 degree space around the fixture. There are two important factors of IES files that need to be remembered when placing them in your light in the engine. One is that all IES profiles are setup to describe a particular fixture, some are for bare bulbs but in most cases it is not only a specific bulb but a specific housing and power output. Architectural Designers and Electrical Engineers need this setup to accurately determine the necessary number of fixtures to place in a given space. Two is that IES profiles are actually converted in the engine to a masking texture and are not kept as mathematically files so they do not scale and do not auto correct for lighting adjustments very well. This is different then in a modeling or CAD software which keeps and calculates the mathematical nature of the file on each light build. This change in UE4 is done wholly for performance reasons.
Fluorescent Fixture Light with IES Profile
So for a Florescent light, you will want to find a IES file that describes the nature of your bulbs and housing as close as possible. For the original image above you would want a Fluorescent unit which has two bulbs and a metallic housing (looking at the interior reflector), in this case I chose the Lithonia Lighting Z Series Fluorescent Striplights LOW-PROFILE STRIPLIGHT, 4FT LONG, WITH TWO LAMPS AND SYMMETRIC PERFORATED SPECULAR SILVER REFLECTOR and you can get the actual ies file here. Because the IES file has all the behavior of that particular light all I need to do is place it in a point light and my point light will become this fixture as long as I have set it to do so by using the IES intensity:
Step 1 - Make sure to check Use IES Intensity to true! This obviously doesn't look right at least according to the IES Visualization in the engine.
Step 2 - All we need to do is rotate the point light -90 degrees on the Y Axis and the light is now correct, but not in line with our fixture on the wall.
Step 3 - Place the Point Light under my Fluorescent Fixture with Emissive Bulbs via Material and I have a perfect Fluorescent light.
Hopefully all of this will clear up some confusion with the way to use IES textures and the nature of a spotlight.
answered Mar 04 '15 at 12:22 AM
Lovecraft_K ♦♦ STAFF
This is a known issue since day one and one I'd like to fix. Having a tube light oriented along the spot axis is basically useless. I've had very little time to work on area lights in general unfortunately which is why it is the way that it is. I only had the time to implement the omni light version correctly, not the spot version.
IES are a more complicated matter. Technically the measured data stored in the IES is coming from a point. It is measured in polar coordinates from that point. It is ambiguous how to use that data when the source shape isn't a point. Is it angle from center point? Is the IES profile integrated over the area? Is it applied from the closest point on the surface of the shape?
"So, in general, for a spotlight I would not recommend adjusting the Source Radius or Length if you are trying to duplicate real world conditions."
I disagree with that. We simulate spot shapes as shadowing functions as if the fixture is blocking the light outside of the cone angle. This is different from a reflector or lens focusing the light. If we did the later the center of the spot light would get bright if the cone angle was smaller. With this in mind having a sphere shape source is totally valid. A spot light probably makes more sense to be a disk but again I haven't had time to implement that. If/when I fix the length axis to tangent to the spot axis a tube light would make sense as well. I've worked on rect lights in my free time but they are WAY harder. No one at this time has a good solution for them.
answered Apr 09 '15 at 12:04 AM
The Source Length of a Spot Light only adjusts the focal length of the light beam. The reason it extends behind the light as well is because it is basically a child of the Point Light.
I would recommend using a Point Light to create a fluorescent light. You can change the Source Radius and Length to mimic the light and use a casing to direct the light just like a real fluorescent light by making the inside a reflective material.
answered Jul 08 '14 at 02:36 PM
TJ V ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here