Well,
let's try to do some considerations about replacement shaders... Fromhell, please give us your opinion. Also, I'm not a real expert of shaders (I just did some by modifying existing OA shaders), so
please correct me wherever I say something wrong. Thanks.
![Smiley](https://openarena.ws/board/Smileys/old/smiley.gif)
As said, Q3A shader files are copyrighted, so we cannot copy them. But we have to do shaders with similar results. What can we do?
1) .shader
file name can vary without problem (one has just to update his own shaderlist.txt accoridngly)
2) shader name cannot vary, because existing maps do search for such names... if a map brush searches for "folder1\test1", it has to exist (either as a shader, or at least as a .tga or as a .jpg)
3) Surfaceparm(s) are important. They do alter how brushes actually work in the game.
3.1)
IIRC, some of them are considered during map compiling, while others are considered by the engine when loading the map (IIRC, if you set or comment out "nomarks" and then load the map in the game, marks on walls should be appear or not, where that shader has been used, without the need to recompile).
3.2) IIRC, in some cases even
the order of the surfaceparms do somehow change their effect... so shuffling their order may sometimes cause unwanted results, difficult to identify?
3.3) So, what can one do to take distance from the q3 one? Only move "surfaceparm"s lines before of after other lines, such as "qer_*", "q3map_*", "cull"?
4) "q3map_surfacelight" is considered at compile time: if you modify its value, existing maps will continue to be lit as before, unless they are recompiled. We can (and should, I can guess) modify something like "q3map_surfacelight 1000" into something like "q3map_surfacelight 900" or "1100", to take some distance from original shader. Also, maybe one may specify a different "q3map_lightimage"...
5) IIRC, "cull" is the same of "cull front", and "cull disable" is the same of "cull none", so one may do such kind of change without affecting the result.
6) "Stages" may offer some kind of more liberty, because sometimes there are different ways to obtain similar effects and because, as Fromhell said, we don't have to "clone" everything: if you are making a jumppad shader, it has not necessarily to show the same kind of glowing the original jumppad one, it may glow in a different way.
6.1) Also, there are three "blendfunc"s thich can be written either in their full form or in their simplified form (e.g. "blendfunc gl_one gl_one" can be written as "blendfunc add" and vice-versa), this may allow to somehow vary from the original a little more.
6.2) Maybe for doing the stages, one may start from some existing OA shader instead of from the original Q3 shader.
7) What about the
images loaded by the shaders (map/clampmap in stages)? One one hand, one may use different paths\filenames for them, to make the shader look quite different from the original one... but on the other hand, may think that
all Q3A texture image files should have replacement image files in OA, even if in baseq3 maps they were only used through shaders, because some
third-party map may rely on them (either directly, or through third party shaders).
I'll try to explain with a real example:
here you can find a "fix" I did for a missing shader (the "shoot me button" shader, base_button/shootme2
- I haven't yet posted it to the "SVN commits thread" to ask updating "clown2.shader" file with such changes because I hoped to have some feeback by someone first... noone replied yet... ![Sad](https://openarena.ws/board/Smileys/old/sad.gif)
). The original Q3 shader (the first you find in base_button.shader) loads base_support/metal3_3.tga and base_button/shootme_glow.tga. The first .tga does not yet exist in OA 0.8.8; while the second one does exist in pak4-textures.pk3
(yes, the "shoot me" red circle texture is there at least since 0.8.1, but the shader using it does not exist in 0.8.8...). So my shader uses gothic_button/timbuttonside.jpg in the place of base_support/metal3_3.tga, and it seems to me it works well enough, although I haven't received feeback from other users. At the moment, the shader code looks more different than the Q3 one due to this different path, but any other map or shader (baseq3 or third party) searching for base_support/metal3_3.tga would still be broken. So I would like to ask to Fromhell what should I do about this? Create a base_support/metal3_3 file by making some kind of small change to timbuttonside (or making a plain copy of it)? And then also update the shader or not?
PS: For the health of future mappers wanting to use those shaders, don't forget to set "qer_editorimage".