Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Thanks for your clarification. The problem is that the 2D renderer doesn’t support scriptable render passes which are required for the Fog of War effect to work. You can see a forum thread regarding this issue here - https://forum.unity.com/threads/urp-2d-renderer-custom-feature.778946/. It was created in 2019 and only a month ago someone from Unity replied that “The work on this has officially started.” Even though I have no experience with the 2D renderer, I think that it should be easy to add support for the Fog of War effect once they release a version with custom render passes.

As far as I know, you should be able to use 3D lights in a 2D project without any big problems. From what I can tell, the 2D lights are better optimized for 2D games than 3D lights and they also come with some additional features. But there are people using Edgar with URP, the Forward Renderer and 3D lights and it seems like it works for them.

Also, I would not recommend you to replicate the FOW effect yourself. First, there’s that problem with not supported custom render passes. Second, I spent quite a lot of time on that and it requires you to know some internals of Edgar to do that properly.

Very well, I will try again to use 3D lighting in my project, hopefully I will make it work this time x).

Thank you for the informations and for your time.

Hello !

I investigated a bit on renderer features and I found this thread -https://github.com/InitialPrefabs/UGUIDOTS/issues/44

If I understood well, it is a way to add renderer features to a 2D renderer.

Do you think there is any chance I could make this work?

I think that it might work but I cannot be completely sure without trying that myself. Please let me know if it works for you. Should you have any problems, I might try it aswell.

I tried and it seems that the renderer feature is not recognized by the FOW script.

I am getting this warning : "The Fog of War feature is enabled but the shader was not yet applied. It seems like you are using URP or LWRP and did not add the custom render feature. Please visit the documentation to see which additional steps are needed to enable this feature in URP and LWRP."

I tried it and it worked. You have to make sure that you’re editing the correct Renderer2D.cs file. The location of the file on my system was “Project root\Library\PackageCache\com.unity.render-pipelines.universal@8.2.0\Runtime\2D”. When you paste the snippet to that file, try to add some debug message to that function to make sure that the Setup function is really called. Then I followed the instructions. I added the Fog of War URP feature to the Forward Renderer and from there I assigned is to the Renderer Features field of the 2D renderer and it worked.

Ok, I did it again and it worked! 

Thank you, that was very helpful!

Hopefully this will help someone else as well :)

I’m glad it worked! I might add a note to the documentation that it’s possible to make it work with the 2D renderer.