Adding shaders problem


(FrostyChilli) #1

Hello!

I have a problem and I can’t find a solution.

I’m trying to give 4 textures some shaders. They are textures from the game. And they are under temperate_sd catalogue. master_grass, dense_grass and so on.

I created a new folder : etmain/textures/mygrass
Copied these 4 textures with PakScape to that folder…Renamed them grass1, grass2 and so on. Yes, they are still TGA. I just renamed them.

My map is called town. So I created a town.shader file.
Added in these lines for 3 textures:

textures/mygrass/grass_1
{
qer_editorimage textures/temperate_sd/grass_dense1
implicitMap textures/temperate_sd/grass_dense1lm
surfaceparm grasssteps
surfaceparm landmine
}

textures/mygrass/grass_2
{
qer_editorimage textures/temperate_sd/master_grass_dirt3
implicit textures/temperate_sd/master_grass_dirt3
surfaceparm grasssteps
surfaceparm landmine
}

textures/mygrass/grass_3
{
qer_editorimage textures/temperate_sd/grass_path1
implicit textures/temperate_sd/grass_path1lm
surfaceparm grasssteps
surfaceparm landmine
}

I put town.shader to etmain/scripts folder.

Now I don’t understand if i’m doing anything wrong here…I open my etmain/scripts/shaderlist.txt and to the very end I simply add: town

No spaces, no _ between other shader names.

So when I open Radiant and test if they are textures or shaders, it says they are textures. If I compile and try ingame, I can see textures but as expected, shader file does not work. I don’t think the problem is that there already exists a “town” texture folder because “town.shader” originally doesn’t exist.
How can I add shaders to shaderlist.txt?

Please help me out on this one!
Thanks!

Cheers, Frosty!


(ailmanki) #2

shaderlist.txt is used by gtkradiant and q3map2, not by the engine itself. So if your shader is correct setup, it should work ingame.
Make sure you edit the shaderfile as txt file, and not as wordpad or something strange.
Check the log window of Gtkradiant and log output of q3map2 when it loads up. It should show where it gets shaderlist from, and which files are loaded.

You should not use such simple names as “town”, as chances are big that other maps will interfere. Use somekind of namespace - like frosty_town.

Here is the shader manual: http://q3map2.robotrenegade.com/docs/shader_manual/contents.html

If the textures you want to use are already included with ET, then there is no need to duplicate the files.
Actually your shader is already almost correct setup. There are no files with the name grass_dense1lm and grass_path1lm.

edit: regardless if the file extension is jpg, you should always add .tga. But not to the shadername itself.

textures/frosty_grass/grass_1 //Is the shadername you reference in the editor
{
qer_editorimage textures/temperate_sd/grass_dense1.tga //is the name of the tga the editor will display
implicitMap textures/temperate_sd/grass_dense1.tga //this is actually the tga shown by the engine
surfaceparm grasssteps
surfaceparm landmine
}

textures/frosty_grass/grass_2
{
qer_editorimage textures/temperate_sd/master_grass_dirt3.tga
implicit textures/temperate_sd/master_grass_dirt3.tga
surfaceparm grasssteps
surfaceparm landmine
}

textures/frosty_grass/grass_3
{
qer_editorimage textures/temperate_sd/grass_path1.tga
implicit textures/temperate_sd/grass_path1.tga
surfaceparm grasssteps
surfaceparm landmine
}


(FrostyChilli) #3

I found the problem.
Shaderfile should look like this:

// this file lists all the separate shader files

_unsorted
alpha
alpha_sd
assault
assault_rock
awf_props
............

However mine looked like this:

alphaalpha_sdassault

Everything was clumped up…
So at the end I had a shader called fatetest_bla.
And when I added town at the end it connected the two.

assault
assault_rock
fatetest_bla[B]town[/B]

instead of

fatetest_bla
town

And that was the only problem…Thank you for the help because I had forgotten to add .TGA like you mentioned.

Oh and btw you said there is no need to create this texture seperately…So you’re saying that all I need is a shaderfile and not the textures?
Because if I change the original shader file : temperate_sd.shader then it changes shaders only for me(and yes, I did it before and it works) but when I make it into .pk3 then other players still don’t have their temperate_sd.shader changed. Am I correct or no?

Thank you!
Cheers, Frosty!


(ailmanki) #4

Yes all you need is a shader. But as said, I could not find grass_dense1lm and grass_path1lm - so if you have them, you will have to include them.

If you overwrite existing shaders in temperate_sd.shader you will screw up other maps, which use that shader.
If you add shaders to that file, chances are big that some other mapper had the same bad idea, and your or hes map gets screwed up.
So lastly you would have to include your modified shader in the pk3, and then yes everyone will get it. Though its still depending on the order of the pk3’s being loaded. So if your name is before pak0.pk3 in alphabet, ammodepot.pk3 - your shaders would get overwritten (virtually).

Generally you should create your own shaderfile. And use a namespace.


(FrostyChilli) #5

Funny thing is that in original temperate_sd.shader file it has those names…grass_dense1lm and grass_path1lm.

But thank you for your help!

Cheers, Frosty! :slight_smile:


(Mateos) #6

That’s because for a single file you can have plenty of shaders :slight_smile: You don’t need to copy/paste the texture files this way.


(FrostyChilli) #7

So all I need is to add mymapname.shader with the kind of settings I want for a texture that already exists in the original installation?
In other words there is no need to copy that texture. Do I understand it correctly now?

Thanks!

Cheers, Frosty!


(stealth6) #8

Yes, you need this though (as ailmanki said):
implicitMap textures/temperate_sd/grass_dense1.tga

Which will tell it were it can find the texture it needs.


(FrostyChilli) #9

Okay, now I fully understand it.

Thank you guys so much!

Cheers, Frosty! :slight_smile:


(Mateos) #10

Yes, just try to not name it like any existing shader: you can even create textures/frostychilli/whateveryouwant shaders, even if the path does not exist physically; Just indicate in the shader the file, or through a subtable (between {}), or with Implicit Shaders:
http://wiki.splashdamage.com/index.php/Implicit_Shaders

Edit: Also it is recommended to have short paths length, if you’re going to use a lot of custom materials/shaders.