Properly setting up shader paths and names?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Properly setting up shader paths and names?

Post by AEon »

Presently creating the shaders for the pk02 texture set by philipk, noticed a large amount of junk in the texture window of GTKradiant though making me wonder about a few things.

All the textures are in the baseq3\textures\aemod\ folder, and a scripts\aemod.shader exists and is mentioned in the shaderlist.txt.

1. Compile Only Shaders

Using this shader to add the step sounds to the texture named textures/aemod/pk02_floor_cyl01.tga:

Code: Select all

textures/aemod/pk02_floor_cyl01:q3map
{
	surfaceparm metalsteps
}
But in GTKradiant 1.6.4 I am seeing the texture and the shader, the shader has no proper image ("Shader Image Missing")... this makes things confusion and adds visual spam.

Question is... would selecting textures/aemod/pk02_floor_cyl01.tga actually add the metal step sound, even though I did not select the shader? IMO, pk02_floor_cyl01:q3map needs selecting, but then I have no proper editor image for it? Anyone had experience with this?

As a hard-fix I could create a proper default lightmapped shader, as the shader manual mentions, but that would be kinda redundant.


2. Lights and Shaders

Creating a light shader is pretty much documented, and I have been using them for a long time. You usually have the light texture image (the light fitting) and the "blend" texture that defines e.g. the areas that are supposed to glow, e.g.

Code: Select all

textures/aemod/pk02_ceiling02
{
	qer_editorimage textures/aemod/pk02_ceiling02_C.tga
	surfaceparm nodlight
	surfaceparm nomarks
	q3map_lightimage textures/aemod/pk02_ceiling02_I.tga
	q3map_backsplash 1 23
	q3map_lightsubdivide 64
	q3map_surfacelight 300
	{
		map textures/aemod/pk02_ceiling02_C.tga
		rgbGen identity
	}
	{
		map $lightmap
		blendfunc filter
		tcGen lightmap
	}
	{
		map textures/aemod/pk02_ceiling02_I.tga
		blendfunc add
		rgbGen wave sin 0.93 0.04 0 5
	}
}
Now in GTKradiant's texture window I am seeing not only the shader that is fine, but also the "junk" images of both textures used by the shader. How does one not show those? For AEblocks I added a sub-folder named "lights", i.e. textures\aeblocks\lights\, placed all light textures into that folder and thus would only see the light shaders in the main aeblocks texture folder in Radiant's texture window.

Is that the only way to clean up "redundant images" in Radiant's the texture window?

(I assumed that when a shader has the same name as the texture is uses that the shader will supersede the textures, and indeed that is the case, but with the above naming if at all, only the "_C.tga" (colour) could be superseded, the "_I.tga" (blend) texture would still be shown in the texture window).

All this I seem to have overlooked most of the time, because I don't use shaders that much, or shaders usually have the same name as the texture. Trying to debug my shaders presently made me notice all this though.

Any methodical tips to fix such things appreciated.

Update: solution for 2.... removed the "_C" from all texture names, so that the main texture (colour) matches the shader name. All the blend textures moved into an textures\aemod\blend\ folder. Updated pathing in shader. So now anything that used blend textures no longer shows "junk" textures in Radiant's main window, only valid textures or shaders.
cityy
Posts: 1020
Joined: Mon Aug 10, 2009 8:23 am

Re: Properly setting up shader paths and names?

Post by cityy »

AEon wrote:Presently creating the shaders for the pk02 texture set by philipk, noticed a large amount of junk in the texture window of GTKradiant though making me wonder about a few things.

All the textures are in the baseq3\textures\aemod\ folder, and a scripts\aemod.shader exists and is mentioned in the shaderlist.txt.

1. Compile Only Shaders

Using this shader to add the step sounds to the texture named textures/aemod/pk02_floor_cyl01.tga:

Code: Select all

textures/aemod/pk02_floor_cyl01:q3map
{
	surfaceparm metalsteps
}
But in GTKradiant 1.6.4 I am seeing the texture and the shader, the shader has no proper image ("Shader Image Missing")... this makes things confusion and adds visual spam.

Question is... would selecting textures/aemod/pk02_floor_cyl01.tga actually add the metal step sound, even though I did not select the shader? IMO, pk02_floor_cyl01:q3map needs selecting, but then I have no proper editor image for it? Anyone had experience with this?

As a hard-fix I could create a proper default lightmapped shader, as the shader manual mentions, but that would be kinda redundant.
Why not use qer_editorimage in the main shader stage? The automation will only work if your shader name is the exact same as your texture name (without extension).
www.ferdinandlist.de/leveldesign
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Re: Properly setting up shader paths and names?

Post by AEon »

I was thinking of doing that, but was wondering why that did not come up in the Shader Manual.

I have the shaders all set up now... they compile and seem to work. Though the metal steps sound code will need fixing.
Post Reply