Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsJedi Outcast and Jedi Academy Editing Forum → shaders
shaders
2009-02-05, 3:10 PM #1
So I have some new custom textures for my level, and they require the use of connecting two textures together to create an effect. For example, a light texture that uses a separate 'glow' texture for the dynamic glow. Which program do I use to connect textures and make them behave? I want to make the red diamond texture in this image have a green light. Now, this texture works like so: there is the base texture, that is the unlit black floor texture with the unlit diamond shaped lights on it. Then there is the separate red light texture, and then a mask texture to make the base texture have a shine to it. So, how do I copy this exact same procedure, except have the red lights be green? Note: I have the required three textures (the base, the green glow, and the mask) all in their own separate texture folder, I just don't know how to make them connect.
DO NOT WANT.
2009-02-05, 4:36 PM #2
You mean you need to write a shader? The only program for is just Notepad.
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2009-02-05, 5:09 PM #3
oh alright. uh, anywhere i can find a tutorial for writing shaders? I used to have a big list of really helpful advanced JA tutorials on a site called map-craft but I think it got taken down. :saddowns:
DO NOT WANT.
2009-02-05, 5:30 PM #4
The best way to learn shaders is trial-and-error. You should have downloaded a pack of example shaders for JA with GtKradiant, so it's best to just take a look.

I would have suggested the "shader manual" here: http://members.lycos.co.uk/quakeroats/q3map2/shader_manual/contents.html

but it's very outdated.
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2009-02-06, 9:26 AM #5
Actually, if you give me the texture name and location, I could try and find the shader for you.

Better yet, I bet you could use a lighted decal.
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2009-02-06, 10:26 AM #6
it's called 'floor3' in the vjun folder.
DO NOT WANT.
2009-02-06, 3:15 PM #7
Here's the shader file that controls that shader:

Code:
textures/vjun/floor3
{
    {
        map $lightmap
    }
    {
        map textures/vjun/floor3
        blendFunc GL_DST_COLOR GL_ZERO
    }
    {
        map textures/common/environ1
        blendFunc GL_DST_COLOR GL_SRC_COLOR
        tcGen environment
    }
    {
        map textures/vjun/floor3_mask
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
    }
    {
        map textures/vjun/floor3_glow
        blendFunc GL_ONE GL_ONE
        glow
        rgbGen identity
    }
}


It's broken up, because, as you guessed it, it's layered.

The textures/vjun/floor3 is essentially the product of the components that you select, in the editor, to get the shader to work. This is listed in GTKradiant as a working shader, and is what you selected to get the whole effect.

The textures/vjun/floor3_mask is the main body of the shader. It's the "metal portion" of the texture, minus the lights. It is a component of the shader, but you can choose it by itself (although you won't get the light effects). Note the "black portions".

The textures/vjun/floor3_glow is the lights of the texture. It's the red that you want to change. It is mapped so the red glow is seen through the "black portions" of the main metal texture. Notice the glow in the shader, that states that it will have the "Dynamic Glow" ingame.

The textures/common/environ1 is just the added shininess environment map. Basically it makes the metal part look shiny. Note it belongs in the "common" folder because other shaders use this (particularly metal ones).

Makes a bit more sense? The blendFunc handles aspects of transparencies and blending. I'm not sure what does what, so it's basically trial-and-error. :v:
SnailIracing:n(500tpostshpereline)pants
-----------------------------@%
2009-02-06, 3:26 PM #8
ok, so if i enter all that in notepad and edit it to how i want, what do i do then with the physical file? Do I save it, add a '.shader' extension, and put it in the shaders folder, like all those other .shader files? Or is that something else entirely?

I'm very new to this textures business. :eng101:
DO NOT WANT.

↑ Up to the top!