[Fixed] Shader error with Umbra of Fate

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Shader error with Umbra of Fate

Postby Nash » Wed Apr 17, 2019 5:10 pm



Using homebrew executable with latest vulkan2 branch.

Mod download: https://www.doomworld.com/idgames/level ... ts/s-u/uof
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Shader error with Umbra of Fate

Postby dpJudas » Wed Apr 17, 2019 6:19 pm

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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Shader error with Umbra of Fate

Postby YukiRaven » Thu Apr 18, 2019 3:48 pm

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?
User avatar
YukiRaven
 
Joined: 10 Jul 2018
Location: Colorado, United States
Discord: YukiRaven#6258
Twitch ID: Yuki_the_Cat
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Shader error with Umbra of Fate

Postby dpJudas » Thu Apr 18, 2019 4:07 pm

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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Shader error with Umbra of Fate

Postby YukiRaven » Thu Apr 18, 2019 5:34 pm

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
YukiRaven
 
Joined: 10 Jul 2018
Location: Colorado, United States
Discord: YukiRaven#6258
Twitch ID: Yuki_the_Cat
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Shader error with Umbra of Fate

Postby Nash » Fri Apr 19, 2019 4:00 am

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
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Shader error with Umbra of Fate

Postby YukiRaven » Sun Apr 28, 2019 4:25 am

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.
User avatar
YukiRaven
 
Joined: 10 Jul 2018
Location: Colorado, United States
Discord: YukiRaven#6258
Twitch ID: Yuki_the_Cat
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Shader error with Umbra of Fate

Postby dpJudas » Thu May 09, 2019 11:36 am

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.
dpJudas
 
 
 
Joined: 28 May 2016


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 3 guests