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:

Re: Is shader editing possible?

Post by Enjay »

That would be cool but am I right in saying that they couldn't actually be added to the game as additional choices rather than replacements?

For lava, I imagine that something quite subtle like a heat haze effect might be quite neat.
krumzy
Posts: 23
Joined: Wed Aug 01, 2012 10:13

Re: Is shader editing possible?

Post by krumzy »

Enjay wrote:That would be cool but am I right in saying that they couldn't actually be added to the game as additional choices rather than replacements?

For lava, I imagine that something quite subtle like a heat haze effect might be quite neat.
They can, because all i am doing is replacing warp2.
User avatar
Rachael
Developer
Developer
Posts: 3651
Joined: Sat May 13, 2006 10:30

Re: Is shader editing possible?

Post by Rachael »

You could just define a new one couldn't you? Last time I looked at GLDEFS you could just use arbitrary custom shaders.
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:They can, because all i am doing is replacing warp2.
Yes, that's what I meant. All that's happening is that WARP2 is being replaced. So, I no longer have WARP2. I have WARP and WARP2.1 only. I don't have WARP, WARP2 and WARP3.

Though, if what Eruanna says is correct, then it may be that possible extra ones can be added.

[edit]Hmmm I tried renaming the function to warp3 and then using warp3 in animdefs but that complained of a syntax error in animdefs. I'm not sure what else should be changed (if anything)[/edit]
Blue Shadow
Global Moderator
Global Moderator
Posts: 308
Joined: Sun Aug 29, 2010 6:09

Re: Is shader editing possible?

Post by Blue Shadow »

ZDoom Wiki wrote:The second step to implementing custom fragment shaders is to define a HardwareShader entry in GLDEFS. Only one shader can be defined per valid graphic. A definition takes the following form:

Code: Select all

HardwareShader [Type] <LumpName>
{
	Shader "<File>"
	Speed <Value>
}
[Type] is an optional and is one of either Flat, Sprite, Texture. This is useful to prevent ambiguity if the same name is used by several graphics of different kinds. <LumpName> corresponds to the graphic to which it is applied. <File> corresponds to the text lump containing your Process function. <Value> is a floating point value that defines a multiplier to be applied to the timer uniform.
If I understand that correctly, the application is done from within GLDEFS as opposed to ANIMDEFS for custom shaders.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Is shader editing possible?

Post by Graf Zahl »

Precisely, since they are an OpenGL feature.
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 »

Ah, OK. That suddenly makes things a lot more useful. Or rather, it doesn't make them any more useful at all but it lets me know that they are far more useful than I thought they were. :lol:
krumzy
Posts: 23
Joined: Wed Aug 01, 2012 10:13

Re: Is shader editing possible?

Post by krumzy »

Blue Shadow wrote:
ZDoom Wiki wrote:The second step to implementing custom fragment shaders is to define a HardwareShader entry in GLDEFS. Only one shader can be defined per valid graphic. A definition takes the following form:

Code: Select all

HardwareShader [Type] <LumpName>
{
	Shader "<File>"
	Speed <Value>
}
[Type] is an optional and is one of either Flat, Sprite, Texture. This is useful to prevent ambiguity if the same name is used by several graphics of different kinds. <LumpName> corresponds to the graphic to which it is applied. <File> corresponds to the text lump containing your Process function. <Value> is a floating point value that defines a multiplier to be applied to the timer uniform.
If I understand that correctly, the application is done from within GLDEFS as opposed to ANIMDEFS for custom shaders.
So for <File> i put the file name and it came up with this:

Code: Select all

Unable to load shader func_warp3::colormap:
Unable to load 'func_warp3'
Do i have to add the location of the file as well?
(also i know that zandronum doesn't define hardwareshaders so how could i convert this to zandronum?)
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Is shader editing possible?

Post by Gez »

krumzy wrote:Do i have to add the location of the file as well?
Yes.
krumzy wrote:(also i know that zandronum doesn't define hardwareshaders so how could i convert this to zandronum?)
You make a fork of Zandronum in which you port the relevant code from GZDoom.

There are no other options. This isn't something that can be "converted" into other features.
User avatar
Rachael
Developer
Developer
Posts: 3651
Joined: Sat May 13, 2006 10:30

Re: Is shader editing possible?

Post by Rachael »

You might also see if Zandronum's coding team is willing to port it for you, but I would imagine they're more than likely very busy with other projects right now. But they do have a bug tracker you can use and you can point to this topic.
Locked

Return to “GZDoom”