Hi,
I think youโre experiencing the same setup issue as DragonHunt10. Have you gone through the steps i posted in post #29? Pay particular attention to:
The FOW_Mat_Instance material must have PP_Fow_Mat as its parent. Set both of the Texture Parameter Values to a plain white texture.
If your whole scene is black it means that the post-process is projecting a black texture on your scene, which is the equivilant to having your whole scene fogged. Changing the textures to a white texture will reveal the scene.
There is no need to include FogOfWarWorker.h in FogOfWarWorker.cpp, rather include your project header-file (mine is called RpgTest.h, yours probably has a different name), and include FogOfWarWorker.h in your project header file. Iโm unsure of whether it matters if you start your project as a blueprint or c++ project. I startet mine from the Top Down template as well and just added coded through the โAdd code to projectโ-option in the editor. If you want to take a look at a working sample, thereโs a link in post #29 which should be fairly stripped down.
If you continue to struggle, I could probably take a look at your project if you make it available to me.
Hi, looks very well, but how install it? Sure i can make all these .h and .cpp files, but what about linking it to blueprints? Should i recteate it from scratch with images or hereโs just that sample project from video with things installed already? Or any other kind out of the box solution?
i made second player start by copy/past, setted number of players 2 and launched game, first player have correct fog of war, all fine, but second donโt have it at all :(, should i make any additional configuration? in RTS units usually have assigned player who control them and visibility rules between players, also in warcraft 3 there was additionaly rectangle area objects that can have visibility for certain players
I tried this effect, and it looked awesome. The problem is that when I deploy the game on to Android device, it crashed.
In order to get the C++ code built for Android SDK and IOS xcode, the modf function has to use double instead of float.
The place it crashes is the RHIUpdateTexture2D function call. I am wondering if you can find a way to fix it or go around it?
I successfully got it work on PC and mobile preview view by not using the postprocess component. But when deploy and launch the game on android device, it crashes at RHIUpdateTexture2D function call from the rendering thread. I am wondering if you can figure out a way to fix or go around this problem.
The math function modf(float, float) has to be changed to modf(double, double) for both android and ios.
The practical application of this particular FOW-solution for an RTS is way beyond the scope of the tutorial, it is only intended to illustrate a way of graphically handling FOW for a single player. You may, however, register multiple actors to a single FOW-manager by calling AFogOfWarManager::RegisterFowActor(AActor* Actor) with the desired actor as the parameter.
Iโm not entirely sure on what you mean by โin warcraft 3 there was additionaly rectangle area objects that can have visibility for certain playersโ, though I guess it would be possible to extend the solution to accomodate fogging/unfoggin of other shapes than circles, though I have unfortunately no immeadiate plans to do so.
Unfortunately I have no insight into how RHIUpdateTexture2D works on different platforms. Saw your question on the answerhub, and hopefully one of the devs or someone from the community could shed some light on it.
Regarding the modf, Iโve removed the entire line on my end since the โfractionsโ-variable is unused. For future reference I discovered later a modulo-function in Epicโs math library, FMath::Fmod(float X, float Y) that should probably work hassle-free on all platforms.
Hey I would also personally like to just use blueprints but I do know some C++ and iโm taking a course on it in college right now so I guess this would be a good project for me to just go ahead and stick with good ole code i used to make a bunch of mods with allot simpler programming languages like LUA and java. What iโm wanting is gonna need some tweaking so iโm probly gonna most likely be pming you.
Updated material and LevelInfoโs construction script for 4.9.
To upgrade, change the material node SceneTexture:Color to SceneTexture:PostProcessInput0 and change the construction script of LevelInfo to mimic the screenshot in the main post.
Hi,
This looks like a linker error where the build tool is unable to find RHI (Rendering hardware interface)-related classes. I wrote a bit about it in the main post and youโll have to:
Open the file named MyProject.Build.cs
Locate line PublicDependencyModuleNames.AddRange(new string] { โCoreโ, โEngineโโฆ
Add the strings โRHIโ, โRenderCoreโ to the array.
Yeah, its working now.
I am new in c++, is there any way to register actor to fowmanager by blueprints? Because my actor isnt controlled by player, its controlled by AI (player sending commands to AI), and it spawns not on begin play. I have no idea how to register it by c++ =/