Is shader editing possible?

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Is shader editing possible?

Post by Enjay »

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)?
Blue Shadow
Global Moderator
Global Moderator
Posts: 308
Joined: Sun Aug 29, 2010 6:09

Re: Is shader editing possible?

Post by Blue Shadow »

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 :P .
krumzy
Posts: 23
Joined: Wed Aug 01, 2012 10:13

Re: Is shader editing possible?

Post by krumzy »

I tried to create a 'warp3' a while ago but it kept coming up with this error

Code: Select all

Unable to load shader warp3::colormap:
Unable to load 'warp3'
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:

Code: Select all

Script error, "rescources.wad:ANIMDEFS" line 4:
Bad syntax.

Warp3 won't work in an animdefs lump
GooberMan
Posts: 2
Joined: Tue Jan 15, 2013 21:28

Re: Is shader editing possible?

Post by GooberMan »

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.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Is shader editing possible?

Post by Gez »

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.
GooberMan
Posts: 2
Joined: Tue Jan 15, 2013 21:28

Re: Is shader editing possible?

Post by GooberMan »

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.
Blue Shadow
Global Moderator
Global Moderator
Posts: 308
Joined: Sun Aug 29, 2010 6:09

Re: Is shader editing possible?

Post by Blue Shadow »

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)
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.
krumzy
Posts: 23
Joined: Wed Aug 01, 2012 10:13

Re: Is shader editing possible?

Post by krumzy »

You can replace existing shaders.
Spoiler: Looks better in game
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Re: Is shader editing possible?

Post by Enjay »

krumzy wrote:Looks better in game
Would you mind uploading the modified shader so I can see how it looks? :)
krumzy
Posts: 23
Joined: Wed Aug 01, 2012 10:13

Re: Is shader editing possible?

Post by krumzy »

It's a bit wonky looking, but that's because i don't know how to edit shaders :P

Download here.
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Re: Is shader editing possible?

Post by Enjay »

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.
User avatar
Rachael
Developer
Developer
Posts: 3651
Joined: Sat May 13, 2006 10:30

Re: Is shader editing possible?

Post by Rachael »

I like it too.
krumzy
Posts: 23
Joined: Wed Aug 01, 2012 10:13

Re: Is shader editing possible?

Post by krumzy »

Thanks, I'm glad that even though i had no idea what i was doing it turned out nice.
Alexandra
Posts: 4
Joined: Sat Feb 23, 2013 5:12

Re: Is shader editing possible?

Post by Alexandra »

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. :)
krumzy
Posts: 23
Joined: Wed Aug 01, 2012 10:13

Re: Is shader editing possible?

Post by krumzy »

If you like i could do the same thing for the other liquids. (lava, slime etc...)
Locked

Return to “GZDoom”