Europa Universalis IV

Europa Universalis IV

Yet Another Graphics Overhaul: Map Shaders (1.2)
49 Comments
Coac Apr 23 @ 1:11am 
It's probably something to do my computer
CptWesley  [author] Apr 23 @ 12:21am 
@NII It works for some people, but apperently not for all...
Coac Apr 22 @ 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 Apr 22 @ 8:19am 
@CptWesley. Hi there. So do you have confirmation mod indeed fixed on Linux/Mac?
CptWesley  [author] Apr 22 @ 12:37am 
@Coac Could you try again with the 1.2 version and let me know if that solved it for you?
Coac Apr 21 @ 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] Apr 19 @ 11:09pm 
Should be fixed on unix based systems now (linux/mac)
Fractal Nightmare Apr 16 @ 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.
Fractal Nightmare Apr 16 @ 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.
Fractal Nightmare Apr 16 @ 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] Apr 16 @ 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] Apr 16 @ 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.
Fractal Nightmare Apr 16 @ 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.
Fractal Nightmare Apr 16 @ 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 Feb 9 @ 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 Dec 10, 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] Dec 9, 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 Dec 9, 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 Dec 9, 2023 @ 6:04pm 
Hi, not sure if it's just me but the mod no longer works, only fonts work sadly
MamaSagtNein Nov 16, 2023 @ 8:48am 
@Jökull fjällgård
Same problem here. Also Mac.
Clark Crente Sep 7, 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] Feb 5, 2023 @ 11:54am 
@EtheralShade the mod should still work, even though it's for an older version of the game.
The Spectre of Communism Feb 5, 2023 @ 2:56am 
update?
John Oct 18, 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 Oct 15, 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 Sep 20, 2022 @ 2:54am 
Would it be possible to make this collection compatible with Typus Orbis Terrarum Reloaded [ https://steamcommunity.com/sharedfiles/filedetails/?id=1895087235 ] ?
Argacyan Sep 4, 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] Jul 2, 2022 @ 9:44pm 
@humbleacadie That should be possible indeed.
humbleacadie Jul 1, 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] Jul 1, 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 Jul 1, 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] Jun 26, 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://steamcommunity.com/sharedfiles/filedetails/?id=2826163305 Please let me know if that one does work.
Jökull fjällgård Jun 25, 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] Jun 24, 2022 @ 11:38pm 
@Hvitserk Jutulheim
Are you using any other mods that might be changing some of the shaders?
Jökull fjällgård Jun 24, 2022 @ 10:46am 
what am i doing wrong when i enable this mod my map turns black
Giocatore Singolo Jun 18, 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 Jun 12, 2022 @ 3:48pm 
Thanks a lot, i will try that and let you know
CptWesley  [author] Jun 12, 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 Jun 12, 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 Jun 12, 2022 @ 6:10am 
Wow, it actually looks like HOI. I love when gfx modders achieve new kind of looks
CptWesley  [author] Jun 8, 2022 @ 12:52pm 
@Borsch will look into it when I have some more time
Borsch Jun 8, 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] Jun 8, 2022 @ 12:27am 
@Borsch in what sense?
Borsch Jun 7, 2022 @ 7:54am 
That's great! Is it possible to enable this effect for the Terrain map mode?
CptWesley  [author] Jun 7, 2022 @ 4:12am 
@Borsch yes it is
Borsch Jun 7, 2022 @ 1:52am 
Looks awesome! Is this mod Ironman-compatible?
CptWesley  [author] Jun 5, 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.
gkd Jun 5, 2022 @ 8:44am 
Taking up too many system resources
gkd Jun 4, 2022 @ 8:36am 
Beautiful