shaders help

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
xdcx
Posts: 2
Joined: Wed Jul 13, 2011 7:22 pm

shaders help

Post 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
User avatar
Theftbot
Posts: 483
Joined: Thu Oct 08, 2009 4:03 am

Re: shaders help

Post 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
}

}
xdcx
Posts: 2
Joined: Wed Jul 13, 2011 7:22 pm

Re: shaders help

Post 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
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: shaders help

Post 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.
[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]
UglyFoot
Posts: 139
Joined: Fri Jul 22, 2011 12:35 pm

Re: shaders help

Post by UglyFoot »

I'm trying to figure out why a lightmap stage must be added but I don't get it, could you explain?
User avatar
DaEngineer
Posts: 213
Joined: Fri May 28, 2010 2:30 pm
Location: Germany
Contact:

Re: shaders help

Post 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.
Website: https://victorkarp.com
LvLWorld: https://lvlworld.com/author/DaEngineer
YouTube: https://youtube.com/@victorkarp
UglyFoot
Posts: 139
Joined: Fri Jul 22, 2011 12:35 pm

Re: shaders help

Post by UglyFoot »

So the overbright is caused because the lightmap isn't applied?
User avatar
DaEngineer
Posts: 213
Joined: Fri May 28, 2010 2:30 pm
Location: Germany
Contact:

Re: shaders help

Post 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.
Website: https://victorkarp.com
LvLWorld: https://lvlworld.com/author/DaEngineer
YouTube: https://youtube.com/@victorkarp
UglyFoot
Posts: 139
Joined: Fri Jul 22, 2011 12:35 pm

Re: shaders help

Post by UglyFoot »

Ok, thank you for clarify. Do you know a link which explain this kind of this things?
User avatar
DaEngineer
Posts: 213
Joined: Fri May 28, 2010 2:30 pm
Location: Germany
Contact:

Re: shaders help

Post by DaEngineer »

*stealing a link from Obsidian's signature* The q3map2 Shader Manual is what you are looking for.
Website: https://victorkarp.com
LvLWorld: https://lvlworld.com/author/DaEngineer
YouTube: https://youtube.com/@victorkarp
Post Reply