Europa Universalis IV

Europa Universalis IV

Yet Another Graphics Overhaul: Map Shaders (1.2)
52 Comments
n3uva 26 Jan @ 2:28am 
some country colours look really glitchy and bad with this mod, could that possibly get fixed?
Clark Crente 30 Nov, 2024 @ 4:25am 
Hey, this mod is great. I'm trying to emulate HOI4 aspect and just need some tweaks to make it very similar. How do I make the province borders to now show the "color waves" from inside the border? Also, wanted to make the colors when the camera is far - seeing the whole europe for example - being little colder and less bright.

Thanks in advance!
hybriyd 20 Nov, 2024 @ 10:57am 
finally wanted something that had the terrain texture butt wasnt over the top
Coac 23 Apr, 2024 @ 1:11am 
It's probably something to do my computer
CptWesley  [author] 23 Apr, 2024 @ 12:21am 
@NII It works for some people, but apperently not for all...
Coac 22 Apr, 2024 @ 2:39pm 
@CptWesley It renders now but it shades every province instead of just the country borders and the performance is significantly worse than on Windows, especially on the normal version of the mod. The lite version seems to work fine. I'm not sure what causes the weird rendering bug on the normal version on Linux but changing the float number in int distanceToBorder from 0.1f to 0.38f alleviated it but it causes some borders between similarly colored nations to not get shaded.
NatusInIgnis | NII 22 Apr, 2024 @ 8:19am 
@CptWesley. Hi there. So do you have confirmation mod indeed fixed on Linux/Mac?
CptWesley  [author] 22 Apr, 2024 @ 12:37am 
@Coac Could you try again with the 1.2 version and let me know if that solved it for you?
Coac 21 Apr, 2024 @ 1:14am 
It doesn't work for me on Linux and the terrain was all black. This was in the error log

[gfx_opengl.cpp:1695]: ACTUAL FAULTY LINE:
int minDist = min(d1, min(d2, min(d3, min(d4, min(d5, min(d6, min(d7, d8)))))));
[gfx_opengl.cpp:1791]:
Failed pixel shader:
0(865) : error C1101: ambiguous overloaded function reference "min(int, int)"
(0) : gp5 cp50 fp50 vp50 gp50 cpf fpf vpf gpf superp float min(superp float, superp float)
(0) : mediump float min(mediump float, int)
(0) : ps gp5 gp4 cp50 fp50 vp50 gp50 cpf fpf vpf gpf lowp float min(lowp float, lowp float)
(0) : ps gp5 gp4 cp50 fp50 vp50 gp50 cpf fpf vpf gpf mediump float min(mediump float, mediump float)
(0) : float min(float, float)
CptWesley  [author] 19 Apr, 2024 @ 11:09pm 
Should be fixed on unix based systems now (linux/mac)
Roaring Knight 16 Apr, 2024 @ 10:40pm 
Oh nvm. I am just dumb. I forgot to define "DistanceToBorder". Now all just works fine. Simply replacing "uint" with "int" shall do the trick.
Roaring Knight 16 Apr, 2024 @ 10:32pm 
I would love to help you in testing this so your mod can run on linux and potentially on mac. If you want me to debug you results in case you want your code pristine and untouched (I more than happily will oblige), we can do that. Else, if you allow me to contribute, I can add you as friend so we can discuss this easily and bypass steam's comment's limits.

Cheers.
Roaring Knight 16 Apr, 2024 @ 10:30pm 
Hello, it is as you've said. Replacing each instance of uint with int has solved the issue, however, the error log now spits the following:

0:921(11): error: no function with name 'DistanceToBorder'
0:922(11): error: no function with name 'DistanceToBorder'
0:923(11): error: no function with name 'DistanceToBorder'
0:924(11): error: no function with name 'DistanceToBorder'
0:925(11): error: no function with name 'DistanceToBorder'
0:926(11): error: no function with name 'DistanceToBorder'
0:927(11): error: no function with name 'DistanceToBorder'
0:928(11): error: no function with name 'DistanceToBorder'
0:929(68): warning: `d7' used uninitialized
0:929(72): warning: `d8' used uninitialized
0:929(60): warning: `d6' used uninitialized
0:929(52): warning: `d5' used uninitialized
0:929(44): warning: `d4' used uninitialized
0:929(36): warning: `d3' used uninitialized
0:929(28): warning: `d2' used uninitialized
0:929(20): warning: `d1' used uninitialized
CptWesley  [author] 16 Apr, 2024 @ 10:26pm 
It appears uint was introduced in GLSL 1.3, so I would expect it to be supported, I am surprised to see that the game is still using this ancient version of GLSL. If they happen to be compiling this particular shader with an older GLSL version (which is relatively common practise in graphics world afaik), it might indeed not work.

Simply replacing "uint" with "int" in the code should then fix the issue. Could you let me know if that is the case?
CptWesley  [author] 16 Apr, 2024 @ 10:17pm 
uint is the keyword for an unsigned 32 bit integer in GLSL (OpenGL's shader language) https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Scalars . The .shader and .fxh files appear to be using some derrivative of GLSL. I don't think C or C# are not relevant for this issues (even though they might be similar in syntax). However, uint does indeed not seem to be used anywhere else in the EU4 shader files.

Similarly, min is a predfined function in OpenGL https://registry.khronos.org/OpenGL-Refpages/gl4/html/min.xhtml and is being used in standardfuncsgfx.fxh

I can make a new version that uses ints instead of uints, but I am skeptical about that being the solution. I am also not able to test whether or not it actually solves the issue on Linux with my current setup.
Roaring Knight 16 Apr, 2024 @ 10:12pm 
https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)
https://eu4.paradoxwikis.com/Europa_Universalis_IV

EU4 wiki says it uses opengl version 2,1 on Linux and Mac, meanwhile explicitly saying that the "uint" call that is made is ONLY available in version 4.0 (and above, presumably.)

If this is true and my logic is not wrong, for this mod to work on both windows and linux, a different method will have to be applied that does not rely on C sharp as that makes it windows only exclusively.

This now makes sense to me because at some point I used to run this game and hoi4 under proton, and I remember this mod in particular working for me, but that's most likely because of WINE doing the heavy lifting and interpreting uint properly.
Roaring Knight 16 Apr, 2024 @ 9:52pm 
@SpaceNomad

I have found the faulty code.

Returns in the error logs:

[gfx_opengl.cpp:1695]: ACTUAL FAULTY LINE:

uint DistanceToAnyBorder(float3 color, float2 pos, float dx, uint maxDistance, in sampler2D IndirectionMap, float2 IndirectionMapSize, in sampler2D ColorMap, float2 ColorMapSize)

Then opengl completely kills itself.

From what I see in the code, the code in here is completely unique, paradox (using hoi4 in comparison), does not (as far as i am aware) use uint or min in any case. This is potentially because perhaps these calls are only available for Windows and not GCC or anyother C interpreters. As far as I know, C sharp is what this is referring to, but for some reason linux cannot seem to comprehend the syntax. I am currently trying to fix this myself but if a clue could be found I would appreciate it.
SpaceNomad 9 Feb, 2024 @ 7:31am 
Does not seem to work on Linux (neither does the lite version): All land masses turn black. Trees on top of it are still green and borders are colored. I tested with no other mods enabled (except for music mods).
Since a MacOS user reported the same issue, my guess is that you made some mistake in the shaders that only manifests when using OpenGL.
Duke of Bosnia 10 Dec, 2023 @ 5:23am 
Yup I've done that and it still doesn't work. The only one that works is the "Map Shaders Lite", it's something but sadly the border shaders don't work and those were pretty cool.
CptWesley  [author] 9 Dec, 2023 @ 10:43pm 
@Duke of Bosnia We haven't changed anything on our side, so I assume Anbennar made a change that overrides this mod. You could try to swap around the load order of this mod and Anbennar inside the launcher.
Duke of Bosnia 9 Dec, 2023 @ 6:21pm 
Okay, apparently it only doesn't work with Anbennar, I always played with this mod in combination with Anbennar and it worked just fine, any way you guys could make it compatible again?
Duke of Bosnia 9 Dec, 2023 @ 6:04pm 
Hi, not sure if it's just me but the mod no longer works, only fonts work sadly
MamaSagtNein 16 Nov, 2023 @ 8:48am 
@Jökull fjällgård
Same problem here. Also Mac.
Clark Crente 7 Sep, 2023 @ 3:04pm 
Great mod, with my own version it almost makes the game to look like HOI4, straight up lol

Is there a version different than lite that the effects are still the same when zoomed out but "less brighter" when really closed? I can send you screenshots showing how awesome it looks.

Thanks for the mod, again
CptWesley  [author] 5 Feb, 2023 @ 11:54am 
@EtheralShade the mod should still work, even though it's for an older version of the game.
Usernemaname 5 Feb, 2023 @ 2:56am 
update?
John 18 Oct, 2022 @ 3:27pm 
I figured it out myself, but i have another question. how do you mess with making the political map transparent with the more zoom? Im trying to make it fully transparent as soon as the name disappears.
John 15 Oct, 2022 @ 3:08pm 
Could you make a version without terrain shadows, or how do i disable them myself? I love this mod but i really dislike EU4's mountain shadows
Dete 20 Sep, 2022 @ 2:54am 
Would it be possible to make this collection compatible with Typus Orbis Terrarum Reloaded [ https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1895087235 ] ?
Argakyan 4 Sep, 2022 @ 6:34pm 
I know that the description already pre-empts this, but I went the extra mile to test around & can confirm that while this works with a lot of smaller graphics mods changing stuff such as borderlines, it conflicts with Ad Lucem as a big graphics overhaul mod.
CptWesley  [author] 2 Jul, 2022 @ 9:44pm 
@humbleacadie That should be possible indeed.
humbleacadie 1 Jul, 2022 @ 2:55pm 
Thank you. I get that the engine has many limitations.
What about removing the "heightmap" (or at least the terrain shadow generated by the bumpmap) above a certain camera height ? I know that there are some shaders who are able to "mimic" a flat map without editing heightmap.bmp. The idea is to always get more detail and terrain feature while zooming in, while getting a flat "poster-like" map at cloud height
CptWesley  [author] 1 Jul, 2022 @ 9:41am 
@humbleacadie I'm not sure if either of those things are possible within a shader alone, since that information is not given as input to the shader and I don't think it's possible to add that info without altering the executable of the game, which probably violates some ToS.
humbleacadie 1 Jul, 2022 @ 8:23am 
@Cptwesley your code works fine, although I had to tweak the numbers.
Any idea if it’s even possible to do two other things as shader modding ? :
- vassal colored with parent color (a la CK3)
- detailed terrain (colored) appearing while closer, while « paper map » appearing when zooming out (ala ck3) ?

Thanks
CptWesley  [author] 26 Jun, 2022 @ 12:55am 
@Hvitserk Jutulheim
It might be due to some hardware limitations. Could you try out the Lite version of this mod that I just uploaded? https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2826163305 Please let me know if that one does work.
𝕭𝕵𝕺𝕽𝕶 25 Jun, 2022 @ 2:42pm 
no i tried disabling all my other mods and the same thing happend i think the issue is im using a macpc
CptWesley  [author] 24 Jun, 2022 @ 11:38pm 
@Hvitserk Jutulheim
Are you using any other mods that might be changing some of the shaders?
𝕭𝕵𝕺𝕽𝕶 24 Jun, 2022 @ 10:46am 
what am i doing wrong when i enable this mod my map turns black
Giocatore Singolo 18 Jun, 2022 @ 9:20am 
Is there a way to instead remove or greatly reduce the terrain visbility? It takes away too much color for me and also makes small countries basically invisible, as their provinces look like uncolonized
humbleacadie 12 Jun, 2022 @ 3:48pm 
Thanks a lot, i will try that and let you know
CptWesley  [author] 12 Jun, 2022 @ 1:16pm 
@humbleacadie
Line 609:
```
vOut = lerp( terrain_color, vColorMapSample.rgb, color_ratio);
```
Performs linear interpolation between the terrain and the colored map with factor `color_ratio`. If you replace this with:
```
vOut = terrain_color;
```
It might have the desired effect.
humbleacadie 12 Jun, 2022 @ 9:47am 
Thanks for this mod.
Is there any way that I could remove the "color fill" editing one line of the code (setting the fill to 0% while keeping border color) ? I'm experience with map modding but not with shaders.
Giocatore Singolo 12 Jun, 2022 @ 6:10am 
Wow, it actually looks like HOI. I love when gfx modders achieve new kind of looks
CptWesley  [author] 8 Jun, 2022 @ 12:52pm 
@Borsch will look into it when I have some more time
Borsch 8 Jun, 2022 @ 12:49pm 
Can the border gradient effect be made visible in the default "Terrain" map mode, so that it appears alongside trees and other map sprites?
CptWesley  [author] 8 Jun, 2022 @ 12:27am 
@Borsch in what sense?
Borsch 7 Jun, 2022 @ 7:54am 
That's great! Is it possible to enable this effect for the Terrain map mode?
CptWesley  [author] 7 Jun, 2022 @ 4:12am 
@Borsch yes it is
Borsch 7 Jun, 2022 @ 1:52am 
Looks awesome! Is this mod Ironman-compatible?
CptWesley  [author] 5 Jun, 2022 @ 9:32am 
@gkd It does make the computations for the GPU more complicated, so it does indeed require more resources than the base game. I will consider creating a "lite" version.