Page 1 of 1

New with shaders..need help

Posted: Sun Mar 13, 2005 12:41 am
by Wo1f
So I've finally decided to do my own custom textures/shaders. I've got most of the textures done, and I need to do some really basic shader stuff..ie. lights.

I basically just copied one of the id shaders and replaced the texture names with mine, and it's simply not working. The texture shows up in-game, but it doesn't act like a light should (emitting light, no bullet marks ect..)

Here's what the shader looks like:

Code: Select all

textures/hippy/blue4stripes_1000
{
	qer_editorimage textures/hippy/blue4stripes.jpg
	surfaceparm nomarks
	q3map_surfacelight 1000
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/hippy/blue4stripes.jpg
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
	{
		map textures/hippy/blue4stripes.blend.jpg
		rgbGen wave sin 0.6 0.1 .1 .1
		blendFunc GL_ONE GL_ONE
	}
}
The texture is blue4stripes.jpg which is in baseq3/textures/hippy

(Sidenote: I have no idea what most of that stuff means..though I'm trying to leran.)

Thanks for any help

Posted: Sun Mar 13, 2005 1:06 am
by obsidian
Make sure you add your shader file name to the shaderlist.txt

For the texture stage (2nd stage in your shader), all textures should be listed as TGA, not JPG, regardless of whether or not the actual image file is a TGA or JPG.
Change: map textures/hippy/blue4stripes.jpg
To: map textures/hippy/blue4stripes.tga

Check out the Q3Map2 Shader Manual (see my signature). You can use it to figure out what each of those directives that you used in your shader actually does. If anything in the manual is unclear, let me know... feedback is always welcomed.

Posted: Sun Mar 13, 2005 2:31 am
by Wo1f
ah, ok I'll try that out. Thanks.

edit: Ok, well now the texture doesn't show up in-game but it emits light :confused:

When you say to add my shader file name to the shaderlist.txt ...do you mean for every single texture I have to add it in there? Because when I look at other peoples custom shaders they don't do that (or maybe it just doesn't show up in my list?)

Posted: Tue Mar 22, 2005 12:03 am
by roughrider
No, obsidian is talking about just putting the shader file name you created in the shaderlist.
For example, the shader file you just created was called hippy.shader, you just add hippy in the shaderlist.txt file. When adding to the shaderlist.txt file, you only need to put the name "hippy" and don't need the extension ".shader".

Also, the naming convention you have could be giving you problems.
{
map textures/hippy/blue4stripes.blend.jpg
rgbGen wave sin 0.6 0.1 .1 .1
blendFunc GL_ONE GL_ONE
}
}
The extra "." you have in there could be part of your problem. Rename the above to blue4stripes_blend.tga, see if that helps.