Page 1 of 1

Texture surface light issues

Posted: Fri Mar 05, 2010 6:01 pm
by themuffinman
Hey peeps I'm new to these forums and it's about time I joined :) I've searched the forums and can't find the answer to my question, so here goes...
I've got a number of years experience making maps for Quake 3 but I've always been pretty clueless when it comes to shaders since I didn't make many custom textures until recently. I can NEVER get textures emitting light, for instance. Now I'm trying to get a skybox to give off light and I'm failing miserably. Here's my code:



// skies

textures/e1u1/sky1
{
qer_editorimage textures/e1u1/sky1.tga

surfaceparm noimpact
surfaceparm nomarks
surfaceparm nolightmap
surfaceparm sky

q3map_lightimage textures/q2_env/unit1_up.tga
q3map_sun 1 .77 .77 80 315 70
q3map_surfacelight 1300

skyParms q2_env/unit1 - -
}



I've tried countless different variations, taken bits from id's scripts and still can't get anywhere. Not only does the above not light up the map after rebuilding the map, rocket's etc explode on the surface instead of disappearing as they should. I've gone as far as to completely copy one of the scrolling skies from the Q3A pak file, with identical scripting and still don't get results, such as my copy of the 'killsky' below:



textures/skies/mkillsky
{
qer_editorimage textures/skies/mkillsky_1.tga
surfaceparm noimpact
surfaceparm nomarks
surfaceparm nolightmap
// surfaceparm sky

q3map_sun 3 2 2 70 315 65
q3map_surfacelight 75
skyparms - 512 -

//cloudparms 512 full
//lightning

{
map textures/skies/mkillsky_1.tga
tcMod scroll 0.05 .1
tcMod scale 2 2
}
{
map textures/skies/mkillsky_2.tga
blendfunc GL_ONE GL_ONE
tcMod scroll 0.05 0.06
tcMod scale 3 2
}
}


I've used the original killsky in a test map and it worked perfectly, then I used the above one with the appropriatly-named copies of the textures and then all of a sudden it doesn't work.
I hope someone can help my situation as it's irritating the crap out of me! I use Q3Radiant 202 (since I hate GTKRadiant) and have tried with Q3Map 1 and 2. Any suggestions?

Re: Texture surface light issues

Posted: Fri Mar 05, 2010 7:32 pm
by obsidian
On initial inspection, it looks more or less correct, albeit a bit "dated" since Q3Map2 prefers to do sky lights a bit differently (nothing that will prevent older sky shaders from working, just better quality and efficiency - see the Q3Map2 Shader Manual appendix in my signature for more details).

The problem probably has something to do with files overwriting or if your brushes have the wrong shader applied to them. It's good practice to create custom shaders with a unique shader name to make sure they don't conflict with other shaders. Like this:

Code: Select all

//Use custom shader names
textures/mufdm1/sky1
{
	//points to original texture for editor, same below for
	//lightimage and skyParms
	qer_editorimage textures/e1u1/sky1.tga
	surfaceparm noimpact
	surfaceparm nomarks
	surfaceparm nolightmap
	surfaceparm sky
	q3map_lightimage textures/q2_env/unit1_up.tga
	q3map_sun 1 .77 .77 80 315 70
	//Better, faster illumination (Q3Map2 only)
	q3map_skyLight 100 3
	skyParms q2_env/unit1 256 - 
}

Also check to see if your custom shader is added to shaderlist.txt. In the above example, you'll have to add mufdm1 to the list. In the texture browser in Radiant, check to see if the shader in question has a white border around it. All shaders should have this, if not, the shader isn't properly associated with the texture.

You should probably test the shader on a "clean" install of just Q3 and your custom content, make sure you don't have any other custom maps installed. Just make a simple box map textured with the sky and a couple of brushes in the middle to test the illumination.

Hopefully that will give you some clues as to what's going on.

Re: Texture surface light issues

Posted: Fri Mar 05, 2010 8:25 pm
by themuffinman
Obsidian, you ARE the dude! Last time I messed around with shaderlist.txt I screwed up everything and nothing would compile (since I didn't type the right shader file names in). Got it 100% this time, and my sky is perfect. Just got to tweak the sun angle etc. That's a huge step forward for me. Thanks buddy!