1) Z-fighting with clip 2) shader related question

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

1) Z-fighting with clip 2) shader related question

Post by monaster »

Well, question #1 is the more important since I am directly confronted with it right now: In my attempt to make a few objects with brushes and hollowing I now have the problem(?) that the playerclip texture is z-fighting with the brushes it should seal off so that noone would get stuck while passing. But: IS that really a problem? Since the playerclip is only to be seen inside the GTKRadiant and not the game itself there's no visible problem. Yeah I could cover all my objects in perfectly aligned and fitting playerclips but why make it unnecessarily complicated if there's no need for it? So if anyone tells me that z-fighting between normal visible brushes and invisible clip textures isn't a problem at all, I'd be very pleased. If it is a problem you can still tell me though (and ignore the last sentence being total crap considering grammar :dork: ).
Question #2: Think of a normal waterfall shader. Is there a chance to make that water running down vertically on an other texture like darkstone or metalbridge still having ONE shader? This would mean taking some non-liquid texture and apply the waterfall shader directly on it without having to make 2 brushes: one textured with darkstone or metalbridge or whatever and the other one completely and solely covered in the waterfall shader. If it is possible could someone be kind enough to write down the structure of that shader? I don't mean "Write me a shader I'm too dumb/lazy/... for that. I just need to know the structure. Could look like:

shader name

{non-liquid texture
{
waterfall shader
}
}

Well maybe I AM too dumb for that (having already searched the shader manual and still not knowing the solution to my problem) but still I will be grateful for any help. <3
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: 1) Z-fighting with clip 2) shader related question

Post by obsidian »

#1, no there is no problem with clip being coplanar with normal brushes. But keep in mind that normal brushes also clip by default, so if you're just overlapping your clip with a normal brush and they are completely coplanar, your clip brush isn't doing anything that your normal brush isn't already doing.

#2 You can't put a shader within a shader, but you can create a shader where you have multiple textures layered on top of each other to make it look like water is flowing over stone. This is not really functional yet, but you should be able to see the overall structure of the shader and figure it out from there:

Code: Select all

textures/shader/name
{
	{
		//first stage is your base texture
		map textures/mystuff/stone
	}
	{
		//this adds a lightmap for lighting
		map $lightmap
		blendFunc filter
	}
	{
		//3rd stage water with scrolling effect
		map textures/mystuff/water
		blendFunc add
		tcMod scroll 0 0.5
	}
}
A few notes, you mentioned hollow. I highly recommend that you avoid using hollow, it tends to create T-juncs at best and at worse can create leaks, phantom collision surfaces, etc.

If starting off with shaders, you may want to try Q3ASE. It's a little outdated so it doesn't contain all the Q3Map2 directives and it has a few quirks, but it's a good place to start. Especially if you don't understand how multiple stages and blendFuncs work, you can do a little trial and error and see the difference yourself. Also open up some stock id Software shaders in Q3ASE and try to understand what all the directives do.
http://www.bpeers.com/software/q3ase/
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: 1) Z-fighting with clip 2) shader related question

Post by monaster »

Great advises, as always. Thanks!
@: "But keep in mind that normal brushes also clip by default [...]": Don't worry I know what playerclip and the like is used for, I never intended to cover every single brush in my map with its own personal clip texture. :D It's really for brushes having a geometry you could get stuck at and making a simple 6-sided clip brush over these is much more easier than paying attention to every corner and other stuff which might turn out to be an obstacle for players and bots passing by (thus having to create many many small complicated clip brushes with dimensions like 6 x 3.5 x 7.75).
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
Post Reply