For a game I’m developing, I’m intending to have a kind of light reflection mechanic. Basically, there will be lights that can be moved, and mirrors that can reflect that light. This is a mechanic, but the rendering of it is the difficult part, hence why I’m asking in this forum.
The key thing I need for this is a light that acts like a searchlight, also called a spotlight. However, in a true searchlight, all the light rays are parallel, so the emitted light forms a cylindrical beam with a consistent radius, so, the UE4 spotlight (which is conical) will not work… This photo shows an example:
I’ve been working on a faked light beam system using line traces and emissive decals to simulate this, and it works well, mechanically. However, there are obviously a lot of things I miss out on from UE4’s built-in lighting, since this faked light beam just adds an emissive value to surfaces (so no proper surface roughness, no use of volumetric fog, etc.).
So, what I want with this thread is a brainstorm for ideas on how to achieve this, preferably using UE4’s lighting system, but I’m open to faked alternatives if they can fulfill my needs. To summarize, what I need is a light with a 2-dimensional source (circular), which then emits all light in the same direction.
The three possibilities I’m looking at:
1. Programming a custom light shape
I have some experience with C++, but I can’t find much info on how to go about implementing custom light shapes. I get the feeling that this would be very difficult, since there’s nothing like it in the engine already. However, it would be the preferred solution since I could then use the existing lighting and shading systems. Specifically, I’d like to use volumetric fog to emphasize the light beam’s position (see the image).
2. Using existing lights
I’ve experimented a lot with the existing light shapes, and tried for example using normal spotlights with occluders, or barn door lights, and much more, but I’ve yet to find something that works satisfactorily. However, there are a lot of options altogether, so there might be some way to achieve it that I’m missing.
3. Faking the light beam
If I can find a way to simulate light relatively realistically without using the built-in lighting system, that might work. As said, I currently have a system where I am simulating a light beam with decals. I am primarily going for a fairly realistic style, so while there are some very easy ways to do this mechanic with a stylized art style (for example, a transparent cylinder mesh representing the light beam), that’s not what I’m looking for.
Any info or ideas that I can get are appreciated.