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?

+1 it would be nice to be able to rotate a light source only without the rotating of the spotlight

Hi wARmAcH1n3,

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.

Thanks, TJ

Hi TJ,

sometimes a spotlight is needed in some situations and it would be nice to be able to rotate the spotlight light source. It isn’t very important, but sometimes the small details does matter too :slight_smile:

Just ran into this. This is not the expected behavior. [4.6.1]

He alienSkull,

Could you please clarify? This looks like the standard behavior of a Spot Light. What behavior are you expecting?

Sure. This may just be my misunderstanding of how this works.

I assumed that the source of the light should look like it does in this picture:

So the source is parallel with the mesh but the cone aimed down like in the first pic. When I rotate the actor both rotate.

It seems like the light source needs a 90deg rotation. I think this is what the others in this post were looking for, way back in April (sorry for digging up old posts, seemed relevant).

replied to wrong person… just wanted to make sure you were notified I responded. I don’t mean to come off as a pest :slight_smile:

This would be a great feature, every now and then I come across a situation where I need a spotlight that is a specific length. Sometimes I can cheat it with a point light.

Maybe add an option to use the Source Length as Focal Length or as the actual shape emitting the light. And then an option to rotate that shape independent of the direction the light is casting in.

this is incorrect behavior, I think a lighter (at Epic) should be asked to consult on the expected behavior of lights in general.

Try placing a light (point or spot; doesn’t matter) with a IES light profile- there is no way to correctly orient the source length of the light. You will essentially end up with a light that points IES lighting in one direction, and the length point in another- obvious design flaw.

To reproduce; create a flourescent light tube/fixture; drop a light (spot or point), give it a IES profile, then finally make it long by increasing the light’s source length- you’ll immediately notice there is something very wrong with how this feature was implemented in UE4. Should be an easy fix by the engine team; just reorient the direction of the light’s source by 90 degrees.

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.]

Spotlights

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:

32048-ers.jpg

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

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][3] and you can get the actual ies file [here][4]. 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.

Thank You

Eric Ketchum

OK I think I’m with you so far. I have the ies file you suggested enabled on a point light, and rotated it down -90degY. That part works great.

But now I want to add a mesh under this fluorescent light, with a flat clear coated material applied. It looks light a point light in the reflection. To make the reflection look more like a fluorescent tube I want to give the source of the light a radius and a length. This works, giving the reflected light off the clear coat surface a long fluorescent bulb shaped reflection.

The only issue with this is that the light source is rotated 90deg away from the way it seems the ies light is projected.

Also just so there isn’t any confusion, this is a blueprinted lightFixture actor, it has an abstract c++ class, with native mesh and point light components. The mesh and point light settings were edited in the derived blueprint. Not that I think that makes a difference to this, but I didn’t want any confusion from my screenshots. It sounds like Jak is having the same issues with normal light actors.

P.S. thanks Eric for taking a look at this. And thanks to TJ for getting him here :slight_smile:

Edit: words.

Hey alienSkull -

Light rendering is the most complicated and rapidly changing forms in any real time rendering situation, so I was happy to help out. I went back and took a look at the reflection issue you reported and confirmed that there is a problem with reflections not taking into account the IES Profile. I have asked our rendering engineers to look into this issue and I will report back here as soon as I know more, for reference it is issue UE-11296.

Thank You

Eric Ketchum

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.

Thank you for coming back to this old thread and confirming the issue. I hope you’ll have the time to improve area lighting in general soon, as little seems to have happened in that area in the year since this was posted. I suppose the biggest change was area lighting working in lightmass, but I believe that was a community contribution.

Anyway if you are working on it in your free time I’m sure I don’t have to convince you that it would be nice if it was prioritized a little higher, so thanks again and hopefully we won’t have to wait another year for more progress.

Hi Brian,

I just wanted to bump this thread, as the light source length is a feature that I really love, however, it is not very useful at the moment. I’m trying to re-create some florescent lights and am unable to use this feature to do so, which is a real shame, as it would be perfect for it! If possible it would be incredibly useful to be able to increase the source length in multiple directions/shift the orientation of the tube separately from the orientation of the light.
Many thanks and best wishes,

Matt Cooke

Want to get this back on Epic’s radar.

It was said that the correct way of doing something like a light tube would be:

  • use a point light
  • add IES profile
  • another post from Epic states to potentially use a static mesh to occlude light from the point light

I have to strongly disagree with these suggestions, as they’re not practical for real production. For context, I work as a senior lighter in the games industry, having worked on franchises like Call of Duty, Halo, etc. You want to keep things as optimized as possible, as we don’t want dynamic lights to overlap as much as possible, as this increases rendering cost pretty quick.

That said, using the above suggestions are not practical because you will end up with point lights (most expensive type) clipping through walls, floors, ceilings, etc. you’ll have a very expensive light rig that won’t be practical for use on any console and most PCs. Ideally, lighters want to use spot lights as they are more optimized due to their limited cone angles.

Check out this pic that was posted by one of the suggestions:

212513-2017-09-06-11-52-04-clipboard.png

This example from another suggestion doesn’t make sense either:

The problem here is you still have a point light, but now you’re forcing a shadow casting mesh sitting on top of the light, which is only going to cost more perf (albeit a small amount).

I don’t know if I’m missing something, I’ve read over the suggestions over and over again, but I’m going to stick to my guns and say that this is not practical lighting production in games and doesn’t make sense.

The solution is definitely to correct the orientation of the light source capsule, or offer a parameter to light classes that allows for rotation of source capsules by artists.

What are your thoughts?

As the original asker of this question I’m glad this got some attention again, I fully agree that none of the solutions that were provided make sense in a production environment.

However it seems like this is low priority for Epic considering nothing has changed in this regard in te last two years. I had sadly given up on this thread as a moderator kept forcing it to close by accepting this answer even though I, just like you, disagree with it. I suppose they do not see this as the right place to discuss this issue?

Anyway, for now I’ll accept Brian’s answer, even though it is not really a solution, he at least understood the issue and rightfully identified is as something that could use work.

Yes, a working source light for spot light which can be rotated would be best solution. And most easiest and realistically. I hope better source length and rotate support for source length in spot lights come on next updates.

Thank you Epic for getting around to fixing this; I can confirm that in 4.18 the source radius orientation is now correct on spot lights- great job!