Infrared lights and lasers

I posted this in the Rendering section but I’m not quite sure where this question falls since I’m not sure if its feasible or not to do it through just post process and other rendering tricks.

I’m trying to figure out ways to handle night vision and IR lights/lasers. Currently my night vision works like this. I have a post process which gets applied to the camera that sets the color and amplifies light. for the IR laser I’m using stencils so the laser is only visible if that post process is applied. The dot is just an emissive decal with a super low emissiveness so normal post processes cant see it but the night vision one can. I’m doing the same thing for the lights with just a super dim light that is just barely visible without the night vision post process. One thing I was thinking of was caching all the lights with IR ability and turning them off/on based on whether or not you have night vision on and based on the state of the IR, but I would like to keep all the logic contained inside of my light/laser actor class. I didnt know if anyone had any ideas on a better way to handle it. Caching all the IR lights and lasers is kind of my last resort option.

1 Like

If I understand correctly, it sounds like you are attempting a literal simulation of night vision?

Is it not possible to just toggle on/off the IR lights based on night vision being enabled/disabled? What difference does it make to the player?

Where the code lives should not be something that ties you down - if you want it on the lights, you can just bind them to an Event Dispatch from whoever is toggling night vision on and off, as one example.

1 Like

The difficulty is this is for a plugin that’s designed around being a robust framework. I could keep a replicated array somewhere like the game state that contains said IR devices and handle it from there but I don’t want people to have to derive their game state from mine just for that. That’s actually not a bad idea there!

multiplayer is way over my head.

I thought that if you send an event dispatch when toggle night vision on/off though, there is no need to know what IR lights exist anywhere. Just if some IR light subscribes to that event, then they toggle appropriately.

Alrighty I’ve rewritten my response about 4 times now as each time I type I think of a better way to handle it lol. With your initial suggestion thats somewhat I’ll be doing so when the IR device gets created I need to get the local clients component thats on his character (this exists on every character that uses the system) and store it, then on that component add that IR devices to an array on the component. When the light turns on it checks that component to see if night vision is on, if it is then it will display it. Then if the character turns on his night vision it will parse through those IR devices to toggle them based on the change. I need to completely refactor my light/laser system anyhow so I’ll try this route once I have it. Was hoping there was a simple check box kinda way lol.

1 Like