Shader help -1 reply

Please wait...

sinchiss

Om nom nom

50 XP

12th May 2008

0 Uploads

171 Posts

0 Threads

#1 10 years ago

I've only recently started meddling with a few shaders, but there's one thing I don't understand which keeps popping up. The 'spec' files. What are they for? And more importantly, how do I make them? If there's a shader added to, for example a torso, there would be another jpg called torso-spec, and it would appear slightly brighter and at the same time more detailed. If anyone would tell me how to make them and what they're for, I'd really appreciate it.

Also, I've heard of a program which lets you view shaders, much the same as the way ModView lets you view models. If anyone could link me to it, or even give me the name of it, that would be great.




iswer

Mapper, Modeller, Musician

50 XP

18th April 2004

0 Uploads

1,601 Posts

0 Threads

#2 10 years ago

Normally, a specular map (_spec) is a black&white texture, that is linked together with, f.ex., a diffuse map (color texture) through a shader. The white in the texture makes that part glossy, and the the black parts does the opposite. You can draw this texture in pretty much any image editor.

Read about it here: Manual/Specular Shaders - BlenderWiki

I'm not quite sure, though, that specular maps work the same in Jk3. I think Jk3 uses some kind of fake spec, cause it doesn't look as good as it should. I'm not really into checking it neither, so what do I know..

You can open shader-files in, for example, ShaderEd2 and Q3Ase.

EDIT: Sorry, my bad. A specular does not have to be black & white, but that is most common.




SiLink

(JAWA) Leader

50 XP

13th February 2005

0 Uploads

1,663 Posts

0 Threads

#3 10 years ago

ShadereED2 is the program that lets you view shaders.. I think.

To download it and a few other editing programs for JK2/JK3, click the below link: http://files.massassi.net/editors/JK2EditingTools.zip




sinchiss

Om nom nom

50 XP

12th May 2008

0 Uploads

171 Posts

0 Threads

#4 10 years ago

Thanks for all the help! Thanks to the link iswer posted, I now know (basically) what a specular shader is. But I'm still pondering on how to make one. I've spent a lot of time searching for some sort of tutorial, but I can't seem to find anything about it. If anyone could give me a full description of how to make a spec, or link me to a tutorial, that would be great.




Isla Kamamee

Awkward? You bet!

50 XP

28th August 2006

0 Uploads

1,179 Posts

0 Threads

#5 10 years ago

dont know jack about spec shaders, but for viewing purposes, ive found that ShaderEd2 is crap...in all ways actually. It produced some shaders that gave errors ingame, the visualization is completely different than what it will be, and it crashes my computer frequently. I got rid of it. :p Use Q3Ase. MUCH better. None of the afformentioned problems. At least for me. Then again, all i really use it for anymore is seeing what itll look like without having to slap it into a map and test it =p Q3ASE Homepage ^link to the download




iswer

Mapper, Modeller, Musician

50 XP

18th April 2004

0 Uploads

1,601 Posts

0 Threads

#6 10 years ago

Isla Kamamee;4340415ive found that ShaderEd2 is crap...in all ways actually. It produced some shaders that gave errors ingame, the visualization is completely different than what it will be, and it crashes my computer frequently. Use Q3Ase. MUCH better. None of the afformentioned problems.[/quote]I guess that's a matter of taste, 'cause I like writing the base shader in ShaderEd2, and it does most often give a okay result, but you're right - it's not very good for viewing the shader - that's where Q3ase is way better, but when I save in Q3Ase, it screws the file up and I have to manually fix it. Once, it screwed up a whole shader-file and I had to fix it manually for, like, 15 minutes! Gosh! :p

[quote=sinchiss;4340305]But I'm still pondering on how to make one. I've spent a lot of time searching for some sort of tutorial, but I can't seem to find anything about it.

Alright, I'll explain it briefly for you. Normally you can figure out how to make them if you've learnt about, and got some experience with, shaders in general.

A specular shader could look like this:

folder/folder/shadername { { map folder/folder/texture rgbGen lightingDiffuse } { map folder/folder/texture_spec blendFunc GL_SRC_ALPHA GL_ONE detail alphaGen lightingSpecular } }

*The first line tells where the shader is "placed". The path use to be the same path as the texture, when talking about models. *The second path should be to your diffuse map (color map, or just "texture"). *The third path is to your specular map, and does not have to end with _spec, but does normally. Change the paths to fit with the folder -structure you've set up.

The other lines make the textures behave as they should. If you want to learn about them more precisely, you could read the shader manual: Q3A Shader Manual

As for example what the textures could look like, we can use the stormtrooper helmet:

Spoiler: Show
helmetbr8.jpgThis is the diffuse map, and looks just like any other texture. (second path in the shader)
Spoiler: Show
helmetspecgx7.pngThis is the specular map, the white parts is glossy, and the grey less glossy. It's quite bright, which makes it glossy overall. (third path in the shader)

You can follow this tutorial on how to make a diffuse texture, and a specular map of a wall (Skip the normal map -part. Jk3 cannot use them). FPSBANANA > CS:S - Counter-Strike: Source > Tutorials > Mapping > Texture Creation 101 FPSBANANA > CS:S - Counter-Strike: Source > Tutorials > Mapping > Texture Creation 102 - Normal and Specular Map's Do not follow their explanation of how to save, nor how to make the shader - save as baseline jpeg and use the shader I wrote above.

If you do not know how to set up a shader - just ask and i'll explain.

Good luck! ;)




Isla Kamamee

Awkward? You bet!

50 XP

28th August 2006

0 Uploads

1,179 Posts

0 Threads

#7 10 years ago

oh. thats why. if you make something in ShaderEd2 and then open it in Q3Ase, it screws up the results of saving it in Q3Ase for some reason. That was perhaps the first basic thing i learned about those two and compatability between them: nonexistent. :P




sinchiss

Om nom nom

50 XP

12th May 2008

0 Uploads

171 Posts

0 Threads

#8 10 years ago

Ok now I have a little puzzle for you all. How do I deactivate the shaders for the console? I've made a pic which covers half of the console, while the rest is grey (it looks better than it sounds, trust me). By default, when I go in game and bring up the console, it gives it a kind of glow effect at regular intervals so the picture sort of fades away. This is really annoying as I can hardly see the picture at all now. I've tried making another .shader file for the console_jediacademy.jpg with all the fields blanks, and named that pk3 with zzz's at the beginning. Now the console is completely see-through though.

Is there a way to get rid of those annoying glow shaders without messing up the console?




sinchiss

Om nom nom

50 XP

12th May 2008

0 Uploads

171 Posts

0 Threads

#9 10 years ago

Nevermind, I figured it out after just 18 tries :X

The original shader file is:

console { nopicmip nomipmaps { map gfx/interface/stars blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA alphaGen vertex tcMod scroll 0.01 0.02 tcMod scale 2 1 } { map gfx/interface/console_jediacademy blendFunc GL_ONE GL_ONE glow rgbGen wave sin 0.2 0.1 0 0.2 } }

Just remove the

blendFunc GL_ONE GL_ONE glow rgbGen wave sin 0.2 0.1 0 0.2

from console_jediacademy and you're all set ;)

Edit: Sorry for double posting by the way, the 30 min editing deadline had passed.