Is there a reason that AlphaGen wave can't use noise?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Amphetamine
Posts: 76
Joined: Fri Feb 23, 2007 5:15 am

Is there a reason that AlphaGen wave can't use noise?

Post by Amphetamine »

As title really, AlphaGen wave doesn't have the noise waveform that rgbGen wave does, is there a practical reason for this other than "id didn't need to use it"?
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

I wondered about this myself and I don't see any practical reason why they didn't include it.

The noise function always seemed to be more of an afterthought since most directives using waveforms can't use it. They may have added it to rgbGen only for something specific that they wanted to do.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

Do you guys happen to have an example shader? AFAICT, Q3 parses "alphaGen wave noise" without a problem.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

Maybe it does... I'm just going off of what's in the documentation (which has plenty of holes in it, I'll admit) and a quick check in Q3ASE (which lacks any feature of adding noise waveforms to alphaGen, but does with rbgGen).
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Amphetamine
Posts: 76
Joined: Fri Feb 23, 2007 5:15 am

Post by Amphetamine »

No it doesn't, I only really noticed the other day when I wrote a shader and Q3 gave me a runtime error every time that shader came into view (didn't even error until a surface it was on was in the PVS).

The error is:

"TABLEFORFUNC CALLED WITH INVALID FUNCTION '6' IN <your/shadername>"

I was actually gonna post the error on here until I figured it out. In the end I loaded it up into Q3ASE to check there wern't any stupid errors I'd overlooked, and there it was.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

Would you mind posting the shader?
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Amphetamine
Posts: 76
Joined: Fri Feb 23, 2007 5:15 am

Post by Amphetamine »

Code: Select all

textures/construct/crypt
{
	qer_editorimage textures/construct/crypt1.tga
	surfaceparm nomarks
	surfaceparm nonsolid
	surfaceparm trans
	qer_trans 0.9
	cull none
	polygonoffset
	{
		animmap 6 textures/construct/crypt1.tga textures/construct/crypt2.tga textures/construct/crypt3.tga 
		blendfunc blend
		alphaGen wave noise 0.4 0.6 0 38 
	}
}
Designed for copying a section of geometry, clipping it into interesting shapes, cauling the lot, texturing the external faces with this shader and then placing back over the original geometry. It's for a digital corruption effect on surfaces in The Construct.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

Curious, I tried adding alphaGen wave noise to one of my own shaders and Q3 crashes with the same error. I guess it's broken.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

Indeed. Q3 parses the "noise" bit just fine but doesn't know how to deal with it later on. I wrote a fairly trivial patch that I'll submit to ioquake3 after I get the chance to test it properly (not at home right now and won't be for the next ten days). Not really relevant for the Q3 mapping crowd perhaps, but it might turn out useful for standalone games.

Seven or eight years working with this engine and you still find new things (and bugs). :)
Amphetamine
Posts: 76
Joined: Fri Feb 23, 2007 5:15 am

Post by Amphetamine »

Probably more use than you'd think, OpenArena uses ioquake as it's base, so your fix will eventually work it's way into their code base, and then trickly down into standalone mods and other games that use OpenArena as a base. You never know where that code's going to end up.
Post Reply