Procedural Water/Fluid Shader

Procedural Water/Fluid Shader

Postby RiboNucleic Asshat » Thu Feb 21, 2019 4:40 am

Simple shader that replaces the vanilla water animations with a smoother procedural one, based on voronoi cells.
Only for Doom! Does not work in the Raven games!

!!!!!!!BIG HUGE SUPER MEGA DANGER WARNING: TEXTURE RESIZING (NOT FILTERING) IRREPARABLY BREAKS THE SHADER. DO NOT USE IT!!!!!!!!
I wish there was a way to force resizing not to apply to specific textures used by a shader, but there isn't, so you'll have to deal with it. Pester the devs instead (please don't actually pester them).



Rather hefty on the GPU for how simple the effect is, and only water is fully accurate to the original texture, buuuut... I like how it looks. Plus, maybe someone could sift through the mess of a shader I wrote and use it as inspiration.

DOES NOT WORK WITH CUSTOM WATER ANIMATIONS THAT USE MORE FRAMES THAN VANILLA. This means it's borked in BTSX and other similar wads.

IT DOES, however, support custom palettes. The shader uses a small LUT in Doom graphics format, which means it'll change with the palette.

DOWNLOAD!!!

(or don't)
fluidshader-1.1.pk3
(14.68 KiB) Downloaded 38 times
Last edited by RiboNucleic Asshat on Sat Feb 23, 2019 2:53 pm, edited 1 time in total.
User avatar
RiboNucleic Asshat
I'm gay in every way
 
Joined: 09 May 2013
Location: Exactly where I am
Discord: Ribonucleic Asshat#7687
Twitch ID: ribonucleicasshat
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia GTX or Quadro with Vulkan support

Re: Procedural Water/Fluid Shader

Postby NightFright » Sat Feb 23, 2019 11:17 am

This looks interesting, but unfortunately it won't work for me. Ultimate Doom crashes with an error when trying to load the game and Doom II is loading but liquids still look just the way they used to before. I wouldn't say I have the wrong hardware for this since I am using a Geforce 1070, also with latest version of GZDoom (3.7.2).
User avatar
NightFright
 
Joined: 02 May 2008
Location: Germany

Re: Procedural Water/Fluid Shader

Postby RiboNucleic Asshat » Sat Feb 23, 2019 2:25 pm

That's odd, I have an NVIDIA card too (GTX 970) and have no issues. Are there any errors in the console, or what error does trying to load Ultimate Doom give you? I'm afraid that my knowledge of device-specific GLSL quirks is rather lacking, so I'm uncertain what could cause that.

EDIT: Ok, so it turns out the crashing with UDoom was because there are no SLIME0* textures in Doom 1, and apparently using missing textures in GLDEFS just straight-up crashes the engine instead of giving an error, so that's fixed now. Still uncertain why it wouldn't work in Doom 2, though.
User avatar
RiboNucleic Asshat
I'm gay in every way
 
Joined: 09 May 2013
Location: Exactly where I am
Discord: Ribonucleic Asshat#7687
Twitch ID: ribonucleicasshat
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia GTX or Quadro with Vulkan support

Re: Procedural Water/Fluid Shader

Postby NightFright » Sat Feb 23, 2019 5:19 pm

Does it maybe require a certain option to be activated in the menus? As far as I know I should have all eye-candy-related options activated, though. Also shouldn't be running any mods that could collide with this, just the spritefix project, PerK's sound improvements and a statusbar mod. Nothing that contains its own gldefs file, even though that shouldn't matter.

And yes, GZDoom crashing because it doesn't find textures isn't exactly the best way to handle the issue. I would have rather expected a warning message.
User avatar
NightFright
 
Joined: 02 May 2008
Location: Germany

Re: Procedural Water/Fluid Shader

Postby RiboNucleic Asshat » Sat Feb 23, 2019 5:53 pm

Can you try running it on a completely clean version of GZDoom (no ini or extra files loaded at all)? There shouldn't be any options or CVARs that would disable the shader. The only thing I can think of is that somehow your flat names are different, or possibly the shader is silently failing to compile in the background.
User avatar
RiboNucleic Asshat
I'm gay in every way
 
Joined: 09 May 2013
Location: Exactly where I am
Discord: Ribonucleic Asshat#7687
Twitch ID: ribonucleicasshat
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia GTX or Quadro with Vulkan support

Re: Procedural Water/Fluid Shader

Postby NightFright » Sat Feb 23, 2019 6:14 pm

Just remembered one thing: I am using custom brightmaps which are also applied to some textures, among them liquids. Could those interfere with the shader?
User avatar
NightFright
 
Joined: 02 May 2008
Location: Germany

Re: Procedural Water/Fluid Shader

Postby RiboNucleic Asshat » Sat Feb 23, 2019 8:14 pm

Ah! That could be it! Brightmaps are applied with a shader, so if you've got brightmaps that match up to the liquid textures (even if they're all black, which would be... wasteful) it's possible that it's going to knock out the water shader. If that isn't it, then I'm genuinely stumped. I would need more people to test it on a variety of systems and report any issues.
User avatar
RiboNucleic Asshat
I'm gay in every way
 
Joined: 09 May 2013
Location: Exactly where I am
Discord: Ribonucleic Asshat#7687
Twitch ID: ribonucleicasshat
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia GTX or Quadro with Vulkan support

Re: Procedural Water/Fluid Shader

Postby Zackdoessomething » Wed Feb 27, 2019 12:34 pm

Hey i gotta say,
t h a t s s o m e n i c e a n i m a t i o n s B-)
no really, that is very cool to look at! btw, can you make a FreeDooM version of it if you want to? because i like it's liquids more than Doom's. :thumb:
Zackdoessomething
 
Joined: 25 Nov 2017

Re: Procedural Water/Fluid Shader

Postby NightFright » Wed Feb 27, 2019 2:36 pm

Two question from my side:
1) Lava isn't included on purpose?
2) Would you also consider making these shaders for Heretic?

I still need to try getting these to work with my brightmaps. Right now I don't have access to my computer, so it'll have to wait.
User avatar
NightFright
 
Joined: 02 May 2008
Location: Germany

Re: Procedural Water/Fluid Shader

Postby RiboNucleic Asshat » Thu Feb 28, 2019 3:23 am

The reason certain textures aren't included is because this particular method can't accurately recreate those textures; I'll have to find a different procedural method. Those include one of the SLIME* animations (can be seen in Plutonia MAP01; it won't be replaced) and lava. Brightmaps won't ever work with this shader unless it's modified to use custom logic (though I feel it would be more appropriate if GZDoom were to override the brightmap shader and not vice versa in situations like this). Lighting is a component of any texture shader, so "brightmaps" can be created by simply not multiplying it in to varying degrees.

Currently I've got a fair few other projects tying me up, but perhaps I can get around to doing it later. I'll try to finish Doom's liquids first then move on to other games.
User avatar
RiboNucleic Asshat
I'm gay in every way
 
Joined: 09 May 2013
Location: Exactly where I am
Discord: Ribonucleic Asshat#7687
Twitch ID: ribonucleicasshat
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia GTX or Quadro with Vulkan support

Re: Procedural Water/Fluid Shader

Postby doomfiend » Thu Mar 14, 2019 2:42 pm

Would one be interested as releasing these as animated textures? I'd totally like test Normal / Specular maps to these liquids xD
User avatar
doomfiend
 
Joined: 27 Aug 2006
Location: some where


Return to Shaders

Who is online

Users browsing this forum: No registered users and 2 guests