tomekum
Chieftain
- Joined
- Oct 23, 2016
- Messages
- 91
I am trying to add clouds effect to fog of war for my Civ4 Remaster Mod. Similar effect to this in Civilization 5. I was inspired by the
f1rpo idea posted here https://forums.civfanatics.com/threads/rescaling-resource-bubbles-through-shader.669162/.
So after investigating the shader files I discovered that the shader responsible for drawing terrain and fog of war is located in Terrain_splatTile.fx file.
Here is what I did so far:
Link to video.
Here is what I changed in Terrain_splatTile.fx:
- I added fFrameTime variable which is responsible for scrolling the UV of the texture
- when Fog of War texture is 0 (so when it is black) then I replace the FOW texture with the base terrain texture
The problem is that I don't know how to inject external texture of the cloud. AFAIK it is not possible in HSLS language, so it needs to be injected by the C++ code of the application which we don't have source code to.
Another problem is that when the fog of war is not black we can see other objects in fog such as trees and rivers which are probably handled in other shaders or even in EXE code.
Does anyone know HSLS language or know how to hack EXE file to inject texture to the shader? Anyone tried to change fog of war in Civ4?
I have attached the modified shader source code + compiled FXO. If you want to try it out, you should copy it to your Beyond the Sword shader folder i.e. D:\SteamLibrary\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Shaders\FXO
f1rpo idea posted here https://forums.civfanatics.com/threads/rescaling-resource-bubbles-through-shader.669162/.
So after investigating the shader files I discovered that the shader responsible for drawing terrain and fog of war is located in Terrain_splatTile.fx file.
Here is what I did so far:
Link to video.
Here is what I changed in Terrain_splatTile.fx:
- I added fFrameTime variable which is responsible for scrolling the UV of the texture
- when Fog of War texture is 0 (so when it is black) then I replace the FOW texture with the base terrain texture
The problem is that I don't know how to inject external texture of the cloud. AFAIK it is not possible in HSLS language, so it needs to be injected by the C++ code of the application which we don't have source code to.
Another problem is that when the fog of war is not black we can see other objects in fog such as trees and rivers which are probably handled in other shaders or even in EXE code.
Does anyone know HSLS language or know how to hack EXE file to inject texture to the shader? Anyone tried to change fog of war in Civ4?
I have attached the modified shader source code + compiled FXO. If you want to try it out, you should copy it to your Beyond the Sword shader folder i.e. D:\SteamLibrary\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Shaders\FXO