Page 1 of 1

wood shader

Posted: Thu May 15, 2003 1:15 am
by Hashmark13
ok here is part of my shader file and ive never used custom textures with a shader... and i just realized... how is the game going to know this texture is wood...? i havent tested it yet so do you think the game will know this texture is wood?

Code: Select all

textures/custom/wood1
{
	qer_keyword wall
	qer_keyword wood
	{
		map textures/custom/wood1.tga
		depthWrite
		rgbGen identity
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc GL_DST_COLOR GL_ZERO
		depthFunc equal
	}
} 

Posted: Thu May 15, 2003 6:08 am
by jv_map
You need to add

surfaceparm wood

just below the qer_keyword lines.

surface

Posted: Thu May 15, 2003 6:09 am
by tltrude
You need to give it a wood surface perameter, like this:

Code: Select all

textures/custom/wood1 
{ 
   qer_keyword wall 
   qer_keyword wood
   surfaceparm wood 
   { 
      map textures/custom/wood1.tga 
      depthWrite 
      rgbGen identity 
   } 
   { 
      map $lightmap 
      rgbGen identity 
      blendFunc GL_DST_COLOR GL_ZERO 
      depthFunc equal 
   } 
} 
The ger_keywords are for the editor so when you type "wood" or "wall", your texture will show up in the texture window. Surfaceparm tells the game what the surface is, so it will use the correct sounds and animation for that texture surface. You might consider changing the name of it to something less common, like hashmark_wood1 or hm_wood1.

Hope that helps.

Posted: Fri May 16, 2003 3:20 am
by Hashmark13
ok thanks guys that helped alot... i kinda figured what the qer thing was... no brainer, but one question about that? can you make up a new keyword... such as "poster" for instance.. and any texture you gave the keyword "poster" will load? i assume that would how it works. and what are all the surfaceparm options? cause i dont want a poster on my wall that has wood shards fly out when shot... is paper an option, im assuming that stuff like stone, wood, metal, water, glass... ect are simple ones but are there less common ones that i might not know of... cuz im looking though algiers.shader for all different options and i have all of em down already

Posted: Fri May 16, 2003 5:50 am
by wacko
You can 'invent' a new qer_keyword poster and it'll work. For an easy texture search I would recommend, though, d/ling this little programm, NatanielIP once did. It's a mohaa texture browser with copy/paste function and it comes very handy! You'll have to unpack all textures from pak2.pk3 into an extra folder (plus subfolders /algiers ...) and convert them into jpegs. You can do this with many picture viewers like ACDSee. A little work, but I'd say it's worth it!
Unfortunately, it'll be more work to add custom texures (you'll have to edit the included file textures_list.txt), but mostly you'll know your own textures and this is not really neccessary.

Posted: Fri May 16, 2003 7:04 am
by jv_map
Shader Surface Types.txt wrote: In Game Surface Types

Note: The in game surface types are not the same as the search keywords material types.

The surface type for a shader is specified via a "surfaceparm type" line, where type is the surface type to use.

Example:
surfaceparm wood

Note that only one surface type can be used at a time, and so only one should be specified in a shader.

Here's a list of each of the surface types that can be specified:
wood - wooden surface
metal - metal surface (like metal plating)
stone - stone or rock surface
dirt - dirt surface
grill - metal grill surface
grass - grass covered surface
mud - muddy or squishy sounding surface
puddle - water puddle surface
glass - glass surface
gravel - rocky gravel surface
sand - sandy surface
foliage - tree tops, bushes, or leaf covered surface
snow - snow covered surface
carpet - carpeted surface

docs folder

Posted: Fri May 16, 2003 10:43 am
by tltrude
The list is in the MOHTools/docs folder and it is named: "Shader Surface Types.txt". There are lots of good things in the docs folder!

Posted: Fri May 16, 2003 5:06 pm
by Hashmark13
doh :P thanks again

Posted: Fri May 16, 2003 5:46 pm
by Hashmark13
all i had to do was give it qer_keyword custom (or anything else i wanted) and it loaded in radiant just fine.. :D