I have been scouring the internet for solutions or ideas for how to create this. None of them come close, and are rarely relevant as they seem to focus on RTS Fog of War where it’s just a circle revealed around a unit.
I am working with blueprints so will resort to code only if necessary.
The shadow created by a point light originating from the player’s location is pretty much all the information I need. But that’s as far as I can get. Never done anything remotely like this.
I made a quick image to illustrate what I’m after. The edges would not need to be soft.
If anyone can offer any information that might help it would be much appreciated. I don’t know where to start. Thank you.
so you want to know how to attach a point light to your pawn then is what you’re after?
can you attach a light to a socket like how a weapon is attached and then use kismet (or whatever UE4 equivalent is, I’m new from UDK) to control the transition between level lights and the fog light?
I like the spheremap idea. But how to get the objectworldposition for the pawn into each material? Isn’t there some sort of node that connects to kismet from the material editor? Maybe you could make a kismet entity that holds the playerpawn XYZ create a new branch in your level materials that multiplies a speheremask based on that vector location? Wish I had time to mess with this myself now. It’s a very interesting problem.
[EDIT]ah nm the sperhemap won’t work because it will light the backs of walls that are out of the player pawn’s line of sight. darn. same reason the z planar map idea wouldn’t work… Seems like a light is the best idea so far.
It is good that no one replied for a while, because when I posted this I was still very new to UE4 and had never used any unreal engine prior to 4.
I have not attempted anything towards this solution since I posted this due to working on other stuff and learning the engine properly, but reading the responses made me start again.
However, I don’t feel like any of the proposed ideas in the linked threads (or, anywhere really) are necessary. Now that I am more familiar with the engine and know what it can do (that is - everything) and how to use it, I have formulated an extremely simple and efficient system and after implementing and testing it I will make a guide to creating it.
But, working for my purpose doesn’t meant it’ll work for yours. Expect a reply in 2-3 days or sooner.
Sorry for the long period of silence. I made a fair bit of progress but have stopped with the project, and my next one doesn’t require the fog of war system. I had completely forgotten about this until it popped into my head for whatever reason.
The last step I had was drawing a rectangle from vectors (four, one for each corner) using a post-process material. If anyone has an example of that being done I can probably jump back in and finish it up but since I haven’t spent any time with post-processing it would take more time than I have.
No guarantee, though. It was in a stage IIRC that having that would show me whether the whole thing works or not.
If it works I’ll gladly make a basic version and throw it up here.
EQS system seems like it’d solve the problem of RTS type fog of war quite nicely. However, I’m looking for something similar to what Nox had (old PC game, Westwood studios).
Would you have any insight on how to use the EQS to achieve the fog effect?
I’m very noob and don’t seem to be able to find any documentation on how to work with EQS (Except applied to AI).
Right, so i tried to use the EQS system, and as far as i can see, it returns the vector co-ordinates of points hidden from sight one at a time, and it has to be keyed in to a blackboard asset. Hence, if i want to spawn say some particles at that point, or some additive materials to make it look darker, it takes a lo0ng time to show up and kind of breaks the thing. I am include snaps of what iv done so far.