Page 2 of 2

Re: Is shader editing possible?

Posted: Tue Feb 26, 2013 10:19
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.

Re: Is shader editing possible?

Posted: Wed Feb 27, 2013 5:03
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.

Re: Is shader editing possible?

Posted: Wed Feb 27, 2013 6:08
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.

Re: Is shader editing possible?

Posted: Wed Feb 27, 2013 11:52
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]

Re: Is shader editing possible?

Posted: Wed Feb 27, 2013 13:27
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.

Re: Is shader editing possible?

Posted: Wed Feb 27, 2013 15:39
by Graf Zahl
Precisely, since they are an OpenGL feature.

Re: Is shader editing possible?

Posted: Thu Feb 28, 2013 10:59
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:

Re: Is shader editing possible?

Posted: Fri Mar 01, 2013 4:56
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?)

Re: Is shader editing possible?

Posted: Sat Mar 02, 2013 11:16
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.

Re: Is shader editing possible?

Posted: Mon Mar 04, 2013 8:53
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.