New with shaders..need help

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Wo1f
Posts: 19
Joined: Thu Feb 24, 2005 4:59 am

New with shaders..need help

Post 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
"Just because you're paranoid doesn't mean they're not after you..."
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Wo1f
Posts: 19
Joined: Thu Feb 24, 2005 4:59 am

Post 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?)
"Just because you're paranoid doesn't mean they're not after you..."
User avatar
roughrider
Posts: 354
Joined: Mon Jul 22, 2002 7:00 am

Post 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.
Post Reply