Shader error with Umbra of Fate

Bugs that have been investigated and resolved somehow.

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.
Post Reply
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Shader error with Umbra of Fate

Post by Nash »



Using homebrew executable with latest vulkan2 branch.

Mod download: https://www.doomworld.com/idgames/level ... ts/s-u/uof
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Shader error with Umbra of Fate

Post by dpJudas »

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.
User avatar
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

Post by YukiRaven »

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?
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Shader error with Umbra of Fate

Post by dpJudas »

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.
User avatar
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

Post by YukiRaven »

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.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Shader error with Umbra of Fate

Post by Nash »

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.
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.
User avatar
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

Post by YukiRaven »

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.
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Shader error with Umbra of Fate

Post by dpJudas »

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.
Post Reply

Return to “Closed Bugs [GZDoom]”