Page 1 of 1

shaders help

Posted: Wed Jul 13, 2011 7:28 pm
by xdcx
hey i've been making a map for a while now.

I've figured out how to get nopicmip on textures with the help of q3ase, etc

Now I've ran into a problem, I want to nopicmip a texture but when I do the
brush using the texture/shader I created makes the brush overbright, which I don't want.

heres an example of one of my shaders:

Code: Select all

textures/xdc/xdc
{
	qer_editorimage textures/xdc/xdc.tga
	nopicmip
	{
		map textures/xdc/xdc.tga
	}
}
What would I have to add to it to make it not overbright when I run the map?
I want it to look like any other brush affected by the lights in the map, etc not be overbright, etc

Re: shaders help

Posted: Wed Jul 13, 2011 7:47 pm
by Theftbot
you need a lightmap stage:

textures/xdc/xdc
{
qer_editorimage textures/xdc/xdc.tga
nopicmip
{
map textures/xdc/xdc.tga
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}

}

Re: shaders help

Posted: Wed Jul 13, 2011 11:17 pm
by xdcx
thanks for you help, & the quick reply

but i still have a problem:

the floor texture is in the script 'xdc/base_floor' and it has flat lighting (the walls, floors, teleporters dont use shaders)
http://imageshack.us/photo/my-images/68 ... xture.jpg/

Now all the 'green outline' textures are the same exact color, but are now in different shades
http://imageshack.us/photo/my-images/32/picmip0.jpg/ <------ PICMIP 0
http://imageshack.us/photo/my-images/339/picmip4.jpg/ <------ PICMIP 4

Apparently something is wrong in the script since one of the larger textures won't nopicmip

http://imageshack.us/photo/my-images/96 ... dlook.jpg/
this is before I used the shaders, see how it has normal lighting, etc

I attached the whole .shader file to this post

thanks for your help, once i get this ill be able to release my map

Re: shaders help

Posted: Thu Jul 14, 2011 4:36 am
by obsidian
I *think* (not sure if nopicmip works with :q3map) this will work and greatly simplify things. It implicitly generates the rest of the shader in-game as it would with a basic texture and Q3Map2 just reads the compile time bits:

Code: Select all

textures/xdc/xdc:q3map
{
	nopicmip
}

For your new problem, try removing the shader file, recompile, and see what happens. If it's fixed, try copying small chunks of the shader at a time back in. Repeat until the problem reappears, the last bit you copied in should have something wrong with it, check for typos or syntax errors.

Re: shaders help

Posted: Fri Jul 22, 2011 2:37 pm
by UglyFoot
I'm trying to figure out why a lightmap stage must be added but I don't get it, could you explain?

Re: shaders help

Posted: Fri Jul 22, 2011 2:58 pm
by DaEngineer
Think of a lightmap as a mask on top of your textures. When you compile light, the light information is stored in the lightmap. Your textures stay the same all the time. The lightmap is then projected on top of your textures to create the illusion of light and shadow. Without a lightmap, all textures have the same brightness level.

Re: shaders help

Posted: Fri Jul 22, 2011 3:11 pm
by UglyFoot
So the overbright is caused because the lightmap isn't applied?

Re: shaders help

Posted: Fri Jul 22, 2011 3:16 pm
by DaEngineer
Overbright and fullbright are different things. Without a lightmap you have fullbright textures with no lighting information at all. Textures with overbright have a fake bloom look. But I guess that's not what you meant. So yes, without a lightmap you have very bright textures.

Re: shaders help

Posted: Fri Jul 22, 2011 3:35 pm
by UglyFoot
Ok, thank you for clarify. Do you know a link which explain this kind of this things?

Re: shaders help

Posted: Fri Jul 22, 2011 3:46 pm
by DaEngineer
*stealing a link from Obsidian's signature* The q3map2 Shader Manual is what you are looking for.