zesterer / openmw-volumetric-clouds

A volumetric clouds mod for OpenMW
80 stars 12 forks source link

Effects are only visible with post-processing menu open #30

Closed jrivany closed 11 months ago

jrivany commented 11 months ago

I've been trying to use this shader with both the latest development build and the released version of 0.48 on Windows.

The effects of it are only visible while I have the post-processing menu open, as soon as I close it, it disappears. I've tested various other shaders and they don't appear to have this issue. And I've tested this both without mods, along with various mods.

My current settings.cfg:

[Camera]
viewing distance = 73728

[Fog]
sky blending = true
sky blending start = 0.8
use distant fog = false

[Post Processing]
enabled = true
chain = hdr,adjustments,clouds,ssao_hq,godrays,fxaa,vignette

[Shaders]
lighting method = shaders
max lights = 32
apply lighting to environment maps = true
auto use object normal maps = true
auto use object specular maps = true
auto use terrain normal maps = true
auto use terrain specular maps = true
light bounds multiplier = 1.65
light fade start = 0.85
maximum light distance = 8192
minimum interior brightness = 0.08
clamp lightning = false
force shaders = false
force per pixel lightning = true
soft particles = false

[Video]
resolution x = 3440
resolution y = 1440
gamma = 1.05188
vsync = true
window mode = 1

[Water]
rain ripple detail = 2
reflection detail = 5
rtt size = 2048
shader = true

[Terrain]
distant terrain = true

[Groundcover]
enabled = true

[Game]
NPCs avoid collisions = true
rebalance soul gem values = true
shield sheathing = true
smooth movement = true
turn to movement direction = true
use additional anim sources = true
use magic item animations = true
weapon sheathing = true

[Physics]
async num threads = 1

[General]
texture mipmap = nearest

[Saves]
character = player

[Shadows]
actor shadows = true
enable shadows = true
object shadows = true
player shadows = true
shadow map resolution = 4096
terrain shadows = true

[HUD]
cross

hair = false

Menu Open

Menu Closed

zesterer commented 11 months ago

Hmm, this seems most likely to be an upstream issue with OpenMW, it might be better to report it there. Shader mods are stateless and don't have any sort of control over (or even the ability to determine) whether the shader window is open.

jrivany commented 11 months ago

That was my first thought, but I wanted to report it first here, since this is the only shader that it appears to effect, and I've already tried with multiple OMW versions. So I assumed that if I said I had this specific issue with this specific shader they'd point me to make an issue here first...

zesterer commented 11 months ago

Very odd, I've never seen this before. Are you using the default shader settings, or does this only happen with some particular configuration? Also, it might be worth checking the game logs to see if there's some sort of error. Because the OpenMW shader API is built on top of the vendor's GLSL implementation, it might be that your GPU vendor has done something stupid that causes OpenMW's 'uniform baking' (i.e: translating shader uniforms into constants when not configuring them) to break.

jrivany commented 11 months ago

I've tried both the default configuration as well as adjusting all the settings, and get the same result every time. I'll have a look at the logs, and also try slotting in a different GPU (I have both AMD and NVIDIA on hand).

That's an interesting theory too. Is there a commit / area of the engine code you could point to for reference of that? I don't mind taking my own stab at debugging it as well.

zesterer commented 11 months ago

I'm not sure, sorry. I don't know much about the internals of OpenMW. Wazabear on the OpenMW Discord server might be able to help though!

jrivany commented 11 months ago

It turns out this is because I must have downloaded the wrong branch when I grabbed the repo zip, so this was just a dumb user error, but if you're curious the now fixed bug:

There appears to be driver specific shader issue when calling a functions with a mix of float and integer literals (fails on my AMD Rx 7900, but works on my 1070), in the case of the commit I had:

...mix(0.75, 1, ...)

The fragment shader then failed to compile with the following logs:

[19:26:43.352 W] FRAGMENT glCompileShader "main" FAILED
[19:26:43.353 W] FRAGMENT Shader "main" infolog:
[19:26:43.353 W] ERROR: 0:277: 'mix' : ambiguous function signature match: multiple signatures match under implicit type conversion 
[19:26:43.353 W] ERROR: 0:277: '=' :  cannot convert from ' const double' to ' temp float'
[19:26:43.353 W] ERROR: 0:277: '' : compilation terminated 
[19:26:43.353 W] ERROR: 3 compilation errors.  No code generated.
[19:26:43.353 W] 
[19:26:43.353 W] 
[19:26:43.353 W] glLinkProgram 000002667C67CC80"clouds" FAILED
[19:26:43.353 W] Program "clouds" infolog:
[19:26:43.353 W] Program Link Failed for unknown reason.

Thanks for the help regardless!

zesterer commented 11 months ago

Ah, this old chestnut. Yep, I've seen this before in other contexts. It's very strange that it worked fine when the shader menu was open, though.