Page 1 of 1

custom texture

Posted: Sun Aug 01, 2004 7:39 pm
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,

Posted: Sun Aug 01, 2004 7:42 pm
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:

Posted: Sun Aug 01, 2004 8:48 pm
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...)

Posted: Sun Aug 01, 2004 9:24 pm
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.

Posted: Sun Aug 01, 2004 11:10 pm
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....

Posted: Sun Aug 01, 2004 11:29 pm
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!

Posted: Mon Aug 02, 2004 5:48 pm
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

Posted: Mon Aug 02, 2004 10:12 pm
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

Posted: Mon Aug 02, 2004 10:14 pm
by lizardkid
i think i'll actually try to make something before i crack open the full q3 thingie, thanks anyway...