wood shader

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Hashmark13
Major
Posts: 299
Joined: Mon Nov 25, 2002 12:20 am
Location: USA

wood shader

Post 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
	}
} 
" If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside."
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

You need to add

surfaceparm wood

just below the qer_keyword lines.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

surface

Post 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.
Tom Trude,

Image
Hashmark13
Major
Posts: 299
Joined: Mon Nov 25, 2002 12:20 am
Location: USA

Post 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
" If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside."
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

docs folder

Post 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!
Tom Trude,

Image
Hashmark13
Major
Posts: 299
Joined: Mon Nov 25, 2002 12:20 am
Location: USA

Post by Hashmark13 »

doh :P thanks again
" If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside."
Hashmark13
Major
Posts: 299
Joined: Mon Nov 25, 2002 12:20 am
Location: USA

Post 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
" If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside."
Post Reply