S H A D E R S |
If you want to hack and crack Q3 learn how to make shaders. Stuff you might need I am prepared to do some typing if you are prepared to do some reading. Shaders is a very complex subject for beginning Q3 mappers. So I will do my best to explain myself. If you want even more detailed information read the shaders manual (900k), it will explain everything you need to know about shaders. If you want to follow along with me you need to download the EditPad program, which also makes a good replacement for NotePad. From here on this page is almost an exact copy of Alvar Jansson's tutorial for quake3mods.net, alvar@home.se I used most of his exact words and all of his screenshots. I know I said that I would make my own, but I was kind of short on time so I just copied, pasted, and cleaned up this tutorial a bit. Why should I rewrite it when it is in it's most perfect form to start with? Again, Sorry Alvar, but the point of this is so that people can learn, after all I learned from quake3mods.net. Introduction to Shaders 1: What is a shader? 2: How do I use shaders? 3: How do I make my own? Creating an Actual shader Ok, we are now set up for our first shader, we will start out by adjusting the strength of a light emitting texture, this is by the way a good place t point out the fact that neither the Surf flags nor the Content flags in the Surface inspector have ANY effect in quake 3, they are ONLY for quake2 editing. The surface inspector is only good for sizing/moving textures in q3 editing. Let's get started! make a small room, make two lamp brushes and apply the base_light/baslt4_1_2k shader to the bottom face (and of course a non-light texture to the other faces).
(As you see you can run q3 in a window, at the
same time as q3radiant, I doubt this will work without a sturdy ammount of
ram (like 128 mb)) So, what if we want a little weaker light on one of the
lamps? well, then we have to make a shader of our own! Open the texture
window (textures in use) and shift click on the light texture. If editpad
is correctly installed, it will now open, browsing down to the beginning
of the shader. Now select the whole shader (as you probably have guessed,
the shader consists of the declaration, and all the indented text,
including the brackets). Copy the selected text, now open tut.shader (your
empty shader script which we created earlier) and paste the text, we
should now be here:
/*baslt4_1.tga baslt4_1.blend.tga */ In quake 3, the blend texture is drawn fullbright,
using the formula: Place it in your baseq3\textures\tut folder.
Now that you have a clue of what shader editing
is all about, we are going to do a thing that a lot of people has asked
about, changing the look of fog. Create a pit where the fog will reside,
and make a big brush that covers the pit, remember that only one side of
the brush should be visible, the fog may be bigger than the space that it
should fill, the brushes inside it will show up correctly. Shift-click the
shader, (that one didn't work for me, if it just steps to the end of the
sfx.shader, use the find function to search for fog_intel, or use the go
to line function and type in 5020). Copy the fog_intel shader and paste it
to your own tut.shader.
As you experiment with colors, a good thin to notice is that the shaders stand free of the bsp, if you want to experiment with different settings, well, except the q3map parameters (duh..), you don't have to re-bsp your map, just save the shader file, and restart your map (nom \map_restart won't work... use the \map command). But, you have seen that flashy hellfog with moving textures on it, well, let's take a look at it! Snatch the hellfog shader from the sfx.shader and paste it to our file, rename it tut/myhellfog make a cosy little hellfog pit so that we can study it a little closer. As you see, it emits light, because the surfacelight parameter. There is also two texture passes, they both apply the same texture, though one of them is flipped, this makes for a darker texture, as well as a liittle more complexity. The tga texture is white, so we are free to create a nice blue strange hellfog, by changing the color to ( 0 0.1 0.4 ). But... even if I re-bsp the emitted light is red!, now this is a little problem, that we could easily fix by making a 16*16 (or whatever) tga file filled with blue, and specify it as q3map_lightimage, but today I am lazy so I specify our good old baslt4_1.blueblend.tga which is blue by nature. so, add the line q3map_lightimage textures/tut/baslt4_1.blueblend.tga
|