Download

Using lights for projection effect

I’m trying to create a projector effect in 4.27 using lights rather than use an asset from the store and i’m having some issues.

Using a popular tutorial on YouTube i’ve created the Spot Light version which works but obviously it’s a cone shape instead of a rectangle shape which isn’t what I want.

I’ve also tried lighting it on a plane but that doesn’t actually cast the materials as a light so that also doesn’t work.

3rd attempt is using a Rect Light but the texture doesn’t display correctly and seems to wrap/stretch itself as well as the texture being centered from the top left corner, i’ve tried fiddiling with the settings but I can’t find any way to change how it’s displayed by the light.

I’m still a novice at UE, is there a better way to do this? Any advice appreciated.

If the spot light works so far, then it is probably easier to shrink your film material, so that it becomes a rectangle within your round spot light. The outside of your film would be black or covered with a black mask, so that it does not send out any light in those areas.

Thanks for the response, is it possible to do this via a script? The goals is to make it into an asset that a level designer could essentially drop and drag into a scene and have to do minimal config.

Not sure about the “via script” part, but you can do all the calculations within a Material, which you then use as a light function for the spotlights. Spotlights, because lightfunctions only work as black and white mask, so to recreate acolor picture, you need one lightfunction for each color, and also one spotlight for each color.

You should be able to pack those required lights into a Blueprint actor, which then should be very configurable.

Here is a project with the materials/light functions, i just had not packed everything into an actor.

Please do not wonder, why there are 4 instances, and not just 3.
One instance acts as main instance, where you should change your texture for the projector, and adjust the texture size to get the proper aspect ratio for the beamer.

The other 3 instances with R,G,B at the end, those have the main instance as a parent, NOT the master material. With that, those 3 instances get every change, that you do within the main instance (like changing color texture and adjusting texture size), while masking out the colors, that the 3 spotlitghts need to work properly.
There may be a better way, but for a test showcase, its good enough ^.^

Video:

Project (4.26):

Beamer_LightFunction.zip (1.6 MB)

Have fun

2 Likes

Not sure if it’d would work well, have you tried with decals?

That’s exactly the effect I wanted, going to have a play around with it and see if I can add to it. Thanks so much!