Is shader editing possible?
Moderator: Graf Zahl
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
Is shader editing possible?
I thought that this had already been asked but I can't find an answer.
I think that Korshun made some edits to the shaders for his "blocky" version of the software lighting emulation. It got me wondering how shader editing can be done. I poked around inside gzdoom.pk3 but didn't find anything that I could make much sense of.
So, is it possible to edit the shaders? If so, is there any documentation anywhere that might help? If editing is possible, is adding new shaders possible (eg to make a warp3 or something)?
I think that Korshun made some edits to the shaders for his "blocky" version of the software lighting emulation. It got me wondering how shader editing can be done. I poked around inside gzdoom.pk3 but didn't find anything that I could make much sense of.
So, is it possible to edit the shaders? If so, is there any documentation anywhere that might help? If editing is possible, is adding new shaders possible (eg to make a warp3 or something)?
-
- Global Moderator
- Posts: 308
- Joined: Sun Aug 29, 2010 6:09
Re: Is shader editing possible?
This is probably not gonna help but apparently you can use GLDEFS to apply custom shaders on graphics.
As how to write them, I have no clue
.
As how to write them, I have no clue

-
- Posts: 23
- Joined: Wed Aug 01, 2012 10:13
Re: Is shader editing possible?
I tried to create a 'warp3' a while ago but it kept coming up with this error
I don't really know anything about hardware shaders but i would like to create my own like warp3.
Edit:
Never mind, i fixed that error. Which brought up a new one:
Warp3 won't work in an animdefs lump
Code: Select all
Unable to load shader warp3::colormap:
Unable to load 'warp3'
Edit:
Never mind, i fixed that error. Which brought up a new one:
Code: Select all
Script error, "rescources.wad:ANIMDEFS" line 4:
Bad syntax.
Warp3 won't work in an animdefs lump
-
- Posts: 2
- Joined: Tue Jan 15, 2013 21:28
Re: Is shader editing possible?
Well, I probably won't get around to writing shaders myself for Prime Directive. But looking at that example on the ZDoom wiki, I can only assume pretty much no one has used this feature. A list of uniforms and varyings that are exposed to those shaders would be nice.
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
Re: Is shader editing possible?
They are extremely limited. You can only make shaders for individual sprites and textures, not for the entire screen. The "software" light mode required to add special support in the C++ side too; something which is out of reach of a normal mod.
If you want examples, look at the shaders used for texture warping and the various types of fuzz. Other examples of shaders can be found in some closed bug reports.
If you want examples, look at the shaders used for texture warping and the various types of fuzz. Other examples of shaders can be found in some closed bug reports.
-
- Posts: 2
- Joined: Tue Jan 15, 2013 21:28
Re: Is shader editing possible?
Yes, well, I'm quite well versed in GL (having had to write at least 3 GL codebases from scratch for various employers over the last few years) and I already determined that they're for pixel shaders only and only for use on flats/patches/etc.
I've already got the GZDoom SVN repository downloaded on my computer. I might dig through it and document it properly myself.
EDIT: And I have done just that. I hope it's clearer for everyone. It certainly makes sense to me. The old documentation required me to make too many assumptions based on my prior graphics programming knowledge, so I can't imagine it would have been easy for anyone who hasn't programmed shaders before.
I've already got the GZDoom SVN repository downloaded on my computer. I might dig through it and document it properly myself.
EDIT: And I have done just that. I hope it's clearer for everyone. It certainly makes sense to me. The old documentation required me to make too many assumptions based on my prior graphics programming knowledge, so I can't imagine it would have been easy for anyone who hasn't programmed shaders before.
-
- Global Moderator
- Posts: 308
- Joined: Sun Aug 29, 2010 6:09
Re: Is shader editing possible?
It's unfortunate that you can't do coding for anything but the company you work for, otherwise we would have ourselves a new GZDoom developer working on its renderer.GooberMan wrote:Yes, well, I'm quite well versed in GL (having had to write at least 3 GL codebases from scratch for various employers over the last few years)
-
- Posts: 23
- Joined: Wed Aug 01, 2012 10:13
Re: Is shader editing possible?
You can replace existing shaders.
Spoiler: Looks better in game
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
Re: Is shader editing possible?
Would you mind uploading the modified shader so I can see how it looks?krumzy wrote:Looks better in game

-
- Posts: 23
- Joined: Wed Aug 01, 2012 10:13
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
Re: Is shader editing possible?
Thanks. It looks pretty cool to me. I like how it has the smaller ripple-like effects but there is a larger wave-like effect over the top of it.
- Rachael
- Developer
- Posts: 3651
- Joined: Sat May 13, 2006 10:30
Re: Is shader editing possible?
I like it too.
-
- Posts: 23
- Joined: Wed Aug 01, 2012 10:13
Re: Is shader editing possible?
Thanks, I'm glad that even though i had no idea what i was doing it turned out nice.
-
- Posts: 4
- Joined: Sat Feb 23, 2013 5:12
Re: Is shader editing possible?
Hey, this looks really nice. For the first time ever in Doom I feel like I'm looking at a liquid. Adding to the autoload. 

-
- Posts: 23
- Joined: Wed Aug 01, 2012 10:13
Re: Is shader editing possible?
If you like i could do the same thing for the other liquids. (lava, slime etc...)