Shader error with Umbra of Fate
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Shader error with Umbra of Fate
Using homebrew executable with latest vulkan2 branch.
Mod download: https://www.doomworld.com/idgames/level ... ts/s-u/uof
Re: Shader error with Umbra of Fate
This is a shader error. Both shaders attempts to declare its own uniforms, which is not allowed. I'm not sure if very old hardware shaders allowed this, so I added some code removing declarations of 'tex' and 'timer'.
For postprocess shaders it has never been allowed. It is pure luck the shader even works in OpenGL as postprocess never binds 'uniform sampler2D tex;' to anything.
I'm not sure what is the best thing to do here since the error message may be a little confusing. Ideally GZDoom should detect if the uniform keyword is used outside a comment and write it is forbidden for the shader to declare its own input. They are either built-in uniforms or to be declared in GLDEFS.
For postprocess shaders it has never been allowed. It is pure luck the shader even works in OpenGL as postprocess never binds 'uniform sampler2D tex;' to anything.
I'm not sure what is the best thing to do here since the error message may be a little confusing. Ideally GZDoom should detect if the uniform keyword is used outside a comment and write it is forbidden for the shader to declare its own input. They are either built-in uniforms or to be declared in GLDEFS.
- YukiRaven
- Posts: 43
- Joined: Mon Jul 09, 2018 11:13 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Colorado, United States
- Contact:
Re: Shader error with Umbra of Fate
For one, don't download it from idgames. That's a super old version, and I don't upload to idgames anymore :^) Always grab my mods from here instead: http://alexa.partition36.com/games-and-mods/doom/
First, a note: I am very noob-ish when it comes to GLSL shaders. Bear with me here.
I think I missed that the sampler2D tex was always available when I read through the wiki when writing these. I should be able to just remove that uniform, right? Though "It is pure luck the shader even works in OpenGL as postprocess never binds 'uniform sampler2D tex;' to anything." kind of concerns me here. This contradicts what I see on the wiki where it says it's always available.
Also, do these error messages not report which shader failed to compile?
First, a note: I am very noob-ish when it comes to GLSL shaders. Bear with me here.
I think I missed that the sampler2D tex was always available when I read through the wiki when writing these. I should be able to just remove that uniform, right? Though "It is pure luck the shader even works in OpenGL as postprocess never binds 'uniform sampler2D tex;' to anything." kind of concerns me here. This contradicts what I see on the wiki where it says it's always available.
Also, do these error messages not report which shader failed to compile?
Re: Shader error with Umbra of Fate
The GLDEFS page is unfortunately not very good. I really should try create an account on the wiki one day and rewrite the section on shaders.
What worries me here is how many other mods might have made this mistake, since OpenGL didn't complain about it. The 'tex' sampler only exists for hardware/material shaders and not post process shaders. For post process the sampler is called 'InputTexture'. Even for hardware shaders this actually declares the sampler twice, which apparently no GLSL compiler in the past disliked.
What worries me here is how many other mods might have made this mistake, since OpenGL didn't complain about it. The 'tex' sampler only exists for hardware/material shaders and not post process shaders. For post process the sampler is called 'InputTexture'. Even for hardware shaders this actually declares the sampler twice, which apparently no GLSL compiler in the past disliked.
- YukiRaven
- Posts: 43
- Joined: Mon Jul 09, 2018 11:13 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Colorado, United States
- Contact:
Re: Shader error with Umbra of Fate
So I can't even get the Vulkan renderer to work with UoF on my system. X11 completely hangs until I log in through SSH and force kill the process from the command line. No error messages, it just hangs after "TITLEMAP - Umbra of Fate Title Map" is shown in the terminal.
I did go through the shaders and removed the duplicate declaration, though, then switched to using InputTexture. Nothing breaks in OpenGL. If someone else can confirm this fixes it in Vulkan, I'll push a new release to my website with the fixed shaders.
I did go through the shaders and removed the duplicate declaration, though, then switched to using InputTexture. Nothing breaks in OpenGL. If someone else can confirm this fixes it in Vulkan, I'll push a new release to my website with the fixed shaders.
Re: Shader error with Umbra of Fate
Care to post the relevant changes in which file? I'll do a local edit and test with a fresh pull of the latest vulkan2 branch to confirm.YukiRaven wrote:So I can't even get the Vulkan renderer to work with UoF on my system. X11 completely hangs until I log in through SSH and force kill the process from the command line. No error messages, it just hangs after "TITLEMAP - Umbra of Fate Title Map" is shown in the terminal.
I did go through the shaders and removed the duplicate declaration, though, then switched to using InputTexture. Nothing breaks in OpenGL. If someone else can confirm this fixes it in Vulkan, I'll push a new release to my website with the fixed shaders.
- YukiRaven
- Posts: 43
- Joined: Mon Jul 09, 2018 11:13 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Colorado, United States
- Contact:
Re: Shader error with Umbra of Fate
Forgot to reply to this, sorry.
I just tested with 4.1 and the changes I made (which were super small: remove the "uniform sampler2D tex;" declaration and switch to using "InputTexture" where needed) allow it to run.
I'm having different issues now, but I'll make a new thread for them. I'll also get updates for Umbra of Fate and Freaky Panties pushed to my website sometime soon.
I just tested with 4.1 and the changes I made (which were super small: remove the "uniform sampler2D tex;" declaration and switch to using "InputTexture" where needed) allow it to run.
I'm having different issues now, but I'll make a new thread for them. I'll also get updates for Umbra of Fate and Freaky Panties pushed to my website sometime soon.
Re: Shader error with Umbra of Fate
This ticket can be closed now, right? The errors in the shaders were fixed by YukiRaven and the error messages have been improved so it is more clear which shader has a problem.