custom texture

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
At0miC
General
Posts: 1164
Joined: Fri Feb 27, 2004 11:29 pm
Location: The Netherlands

custom texture

Post by At0miC »

I have edited an original texture like this:
Image

The only thing I want to know is, what must I add to my custom shader for this texture, to let the black color disappear in the game? So you can look through it you know.

Thank you,
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 make an alpha channel to the texture in which the opaque part is white and the transparent part is black. The shader should say s/th like this:

Code: Select all

textures/mytextures/mytexture
{
  cull none // if you want it two-sided
  qer_editorimage textures/mytextures/mytexture.tga
  surfaceparm wood
  {
    map textures/mytextures/mytexture.tga
    blendfunc blend
    alphafunc GT0
    depthwrite
  }
  {
    map $lightmap
    blendfunc filter
    depthfunc equal
  }
}
g/l :wink:
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

thats all that goes into a shader file? name it after the texture and put it in a textures folder and that's it? that's all you have to do? awesome! (obviously change values as wanted...)
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

lol lizard seems to be in state of shock!

window shaders tend to be a bit longer, but most of them are about that size.

oh you might want keywords too. depending on your mapping style.
When I am king, you will be first against the wall~
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

well ya i expected something much more complex... i have a coupel textures in the works and if that's all i need to do....
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

yea.. its simple, I use tons of custom textures(taken mostly from image packs that I add shaders to)

just put em in your pk3 in scripts labeled mapname(or whatever).shader and the textures themselves in texture/mapname(or again whatever)

for instance, I always use the mapname or working map name... and all the contruction shaders go together in one shader... in this case -

scripts/gefangenshaft.shader
textures/gefangenshaft/

Code: Select all

textures/gefangenschaft/wall_concrete_pattern2
{
	qer_keyword stone		
	qer_keyword wall
	surfaceparm stone
	{
		map textures/gefangenschaft/wall_concrete_pattern2.jpg
		depthWrite
		rgbGen identity
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc GL_DST_COLOR GL_ZERO
		depthFunc equal
	}
}
textures/gefangenschaft/floor_bunker_pattern1
{
	//Origin - ?
	qer_keyword stone
	qer_keyword floor
	surfaceparm stone
	{
		map textures/gefangenschaft/floor_bunker_pattern1.jpg
		depthWrite
		rgbGen identity
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc GL_DST_COLOR GL_ZERO
		depthFunc equal
	}
}
textures/gefangenschaft/wall_plaster_pattern6
{
	qer_keyword stone
	qer_keyword wall
	surfaceparm stone
	{
		map textures/gefangenschaft/wall_plaster_pattern6.jpg
		depthWrite
		rgbGen identity
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc GL_DST_COLOR GL_ZERO
		depthFunc equal
	}
}
those are the last 4 entries, the keyworkds jsut make it more searchable(i only include them cause sometimes I like to see them in the same tex window with other textures of a similar type, usualy I wont be searching ot find my own custom texture.)

beware of using overly simple .shader names!
When I am king, you will be first against the wall~
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

:shock: :shock: :shock: so you make texture packs by grouping multiple shaders together under a common name... awesome. i've wanted to learn this for a while now, jsut never remember to ask etc...

danke! :D :D
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

i dont make textures and i knew that :roll: .i got a tutorial on q3 shaders if u want it ;). making shaders is too complicated for me
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

i think i'll actually try to make something before i crack open the full q3 thingie, thanks anyway...
Post Reply