- Home /
2D Lantern Lighting Effects/Fog of War
REVISION: My understanding of the problem has gone up a bit, so hopefully I can direct this question a little better.
I'm looking for a general guideline on how to create a lantern light effect similar to what's used in Royal Envoy 2 (reference: http://youtu.be/WJZD6-OuREU). Initially I explored the Fog feature in the Render Settings, but the problem with this is that the fog applies to the entirety of the scene and I want to be able to lift portions of the fog by lighting lanterns in the scene.
The two best ways I can think of at the moment to approach this problem are:
1) Darken the scene's default lighting, assign point lights to lanterns and script in the appropriate functionality when other objects are lit.
2) Apply a material that emulates darkness/fog in front of the background, cut out appropriate portions of the material whenever a lantern is set to be lit.
The project I'm working on to incorporate this is similar in nature to Royal Envoy 2; most specifically, it's in 2D. Would either (or both) of these methods work? And if so, how would I go about doing them?
Answer by fafase · Apr 05, 2012 at 11:36 PM
Well not so sure what you want but there is a fog tool
http://unity3d.com/support/documentation/Components/class-RenderSettings.html and
http://unity3d.com/support/documentation/ScriptReference/RenderSettings.html
and you can control it by script of course
Awesome, this is definitely a step in the right direction. $$anonymous$$y big question, then, is say I use this to create a layer of fog over a 2D scene. If I were to do something like lighting a lantern in the scene, how would I be able to essentially hide the part of the fog that the lantern is lighting? Is this something that lighting effects can accomplish on their own, or is it something I have to script? And if I have to script it, what would be a good starting point?
I have only a couple months of solid experience with Unity and this is kind of a new thing with me, so bear with me. :\
Unfortunately. after looking around I don' think this is possible with fog. This is more for real fog effect like getting the background fading away...
BUT!!! You could try to use particle ins$$anonymous$$d. Those you can place them where you want. You make them real slow, and only where you need them. You can use this http://answers.unity3d.com/questions/10596/how-do-i-make-a-good-smoke-particle-effect.html and start tweaking value and see the result. Remember to keep thme slow so that they don't go flying away like real smoke.
Excellent, I'll give it a shot and keep things posted as to how well it works. Thanks.
Your answer
![](https://koobas.hobune.stream/wayback/20220613065949im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Extrange Behaviour with 2D Lights in Universal RP 0 Answers
Is it possible to use soft shadows in 2D using URP? 1 Answer
2D and 3D lights in a scene. URP,2D and 3D lights in scene URP 1 Answer
Modify 2D Point Light Distance in runtime? 1 Answer
How can I use a depth mask shader to have a 'shine through' effect? 0 Answers