lfnetwork.com mark read register faq members calendar

Thread: Shaders for Idiots
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-30-2004, 11:53 AM   #1
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
Post Shaders for Idiots

Ok, I've just come back from doing a Google Search and LF search and I've only managed to come up with various versions of the Shader Manual.

Now, it's great and detailled and stuff, but I just don't seem to get it

Are there any beginners tutorials to shaders?

Apart from the Shader Manual (which says it's not a tutorial and wasn't intended to be), I found this

http://home.planet.nl/~monstrous/tutshader.html

But really wanna know how others learned shaders, because when I look at one, it's like another language to me

So any ideas or whatever would be great


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 06-30-2004, 03:40 PM   #2
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
Steal! Pinch! Copy! Plagarise!

Find a shader you like the look of, open it in notepad to se how it's done. Master that one, then move onto another one.

With shaders, there is no quick and easy way. I use ShaderED which is *highly* frowned upon for some reason, but that offers a graphical display of your shader, and if you click the "animate" button, will show the effects you've created with it.

For the new and advanced features that Q3map2 implements you are going to have to get your hands dirty with notepad, so you may as well try and learn it the hard way.
Codja X is offline   you may: quote & reply,
Old 06-30-2004, 04:01 PM   #3
mslaf
 
mslaf's Avatar
 
Join Date: Apr 2002
Location: Poland
Posts: 125
This one should be useful if you don't understand what all these options mean:

http://shaderlab.com/q3map2/shader_manual/

and this one if you really don't know what to do:

http://www.splashdamage.org/index.ph...0ed2b4884ad0ca


ms.-
mslaf is offline   you may: quote & reply,
Old 06-30-2004, 04:09 PM   #4
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
Quote:
Originally posted by mslaf
http://shaderlab.com/q3map2/shader_manual/

and this one if you really don't know what to do:

http://www.splashdamage.org/index.ph...0ed2b4884ad0ca
SNAP! Check out the reply for CG_carl's question - exactly the same links! It's amazing how much information is in these pages, providing you can translate it into plain, understandable English.
Codja X is offline   you may: quote & reply,
Old 06-30-2004, 05:15 PM   #5
lauser
 
lauser's Avatar
 
Join Date: Jan 2003
Location: CANADA
Posts: 428
I think Vogel wants something much more simple than these LINKS or the shader manual.

But like Codja said...clone some shaders to see what they do. Rename them and throw in your own textures, even if they are simple ones. That's what I did to learn shaders. Then later on I started to understand some of the dynamics involved.

ShaderED is really cool BTW.

Also, you will notice that the designers who came up with these shaders used key words to help us understand them.

Words like: scroll, glow, Blendfunc, nomarks,cull....etc.


My kung fu is also very weak

Last edited by lauser; 06-30-2004 at 05:28 PM.
lauser is offline   you may: quote & reply,
Old 06-30-2004, 05:51 PM   #6
wedge2211
Commander, Rogue Squadron
 
wedge2211's Avatar
 
Join Date: Jul 2002
Location: Ithaca, NY
Posts: 2,320
I live by finding shaders that do things similar to what I want to do and cannibalizing them.


wedge2211 is offline   you may: quote & reply,
Old 07-01-2004, 03:32 AM   #7
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
What Wedge said.

Lately I have noticed, be it for good or evil, that it actually is very important you know what each of the commands in your cannibalized shaders do. Sure, to a certain degree you can use them without knowing - I did that for a long time. But my last project taught me a hard lesson of the drawbacks of ignorance. The shaderlab's manual is a very nice tool in trying to understand the shader code (in addition to Leslie Judge).


Frozen by ICARUS
lassev is offline   you may: quote & reply,
Old 07-01-2004, 03:49 AM   #8
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
lol, caniballism it is then

I'll also try to make sense of the splash damage forum. And I'll take a look at ShaderEd and see where I get with that and the Shader Manual.

Thanks again people

[edit] Woah...ShaderEd is slightly...um...overwhelming *heads to google for ShaderEd tutorial as it doesn't have help file*


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.

Last edited by Jedi_Vogel; 07-01-2004 at 05:00 AM.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 08:14 AM   #9
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
If I remember correctly, the SDK should come with a shader MS word DOC file written by id Software that'll go through the basics with you.

It doesn't have any of the advanced features that have been recently introduced, but as the phrase goes - don't run before you can walk.

Try searching for shader*.doc on your PC
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 08:21 AM   #10
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
I have a document for Scripting, Skinning and EffectsEd but not ShaderEd :/ if you have a ShaderEd document and I PM you my e-mail address, could you send it please?


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 08:31 AM   #11
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
I'm in work at the moment, so I can't send anything your way.

However! I can do the next best thing:

http://www.qeradiant.com/manual/Q3AS...nual/index.htm

This is an online version of that same file. The chances are you've already looked through it, but it's well worth just reading it from the beginning and just using trial and error to learn how to use the various effects.

That is probably the phrase that applies to everybody editing this game: Trial and Error!
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 08:33 AM   #12
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
Yeah I have the Shader Manual and have for a while, but it says "This was never meant to be a tutorial" or something along those lines.

For me, it would be like trying to learn to speak Italian with just an Italian dictionary to hand, no teacher and no grammar book. lol

I'd like to figure out how to use ShaderEd, but it's a complicated interface. If Wade sees this he'll tell me to use Notepad, which would be the ideal IF I understood all the rest. :/


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 08:39 AM   #13
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
ShaderEd does look bewildering to start with, but it really isn't that difficult.

Lets try getting a shader up and running for you. I'll have to use my extremely patchy and unreliable memory for this though.

1st thing: What are you trying to acheive with this shader?

What we'll do is get the basic shader setup.

Open shadered, right click on the yellow folder thing and click "add file", give it a name and then double click on it.

Click on the "stages" tab (ignore any error messages about nolightmap etc).

On the top left you'll have some arrows - you can use these to swap between stages - more on that later.

In the middle on the left, you should have an "add map" or "add texture map" or something like this.

Click on that, find the tga or jpg you want through the browser and voila - a basic shader. Doesn't do anything but it's a base to start from. (please correct me with the proper names of the buttons).

Now, if for example you want some of this shader to be transparent, you should have created an alpha channel for it (i'm am NOT going to go into that). If this is the case, click on the blending options button (or blending browser or whatever it's called), click the background button. You'll be shown a load of different blending options. Click the desired one and there you go.

Your 1st shader!

I know this is crap tutorial, but it's the best I can come up with without looking at the program itself.

Last edited by Codja X; 07-01-2004 at 08:51 AM.
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 09:09 AM   #14
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
When I do the first stage, I get "error opening file" :/

it is a JPEG or PNG that I'm trying to open right? :/


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 09:15 AM   #15
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
JPEG, PNG or TGA - these should all work.

Sorry I forgot - you'll have to click the NEW or Add stage button 1st or all the options will be greyed out.
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 09:22 AM   #16
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
Ok I tried to add

textures/spares/yf_marble2.jpg

And I just get "error loading file" :/

Should I have saved the texture file first?


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 09:33 AM   #17
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
Does yf_marble2.jpg exist in the textures/spares directory?

Are you doing this in the stages tab?

If not, then save it there. Also, there should be a button next to where you specify the texture map - press this and a normal windows "Open" box should appear. Browse to the file and it should appear okay.
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 09:37 AM   #18
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
I didn't call this thread "Shaders for Idiots" for no reason

Yes that file exists in the location I specified

Where's the "stages tab"? lol

I have a "window" on the left with a folder called "Base"
I right click it and select "Add Files"
I double-click "yf_marble2.jpg" in the textures/spares directory

I get the error.

Though if the "stages" tab exists I might be better off... I'm not seeing any "tabs" :/


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 09:40 AM   #19
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
Ahhhh, I see now.

Right, what you need to do is "add folder" 1st, call it textures/spares.

Then, right click on the textures/spares folder and click "add file"

Double click on the marble file, and you'll see the main shader options pages.
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 10:08 AM   #20
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
Sorry about this... when I right click "Base" I don't get an "add folder" option. I get "Add Files" and "Add Files as Shader Type..." with several sub options. :/

Thank you for your patience.


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 10:22 AM   #21
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
Bugger.

Okay, try this.

In your shaders folder, create a new text file. Rename it yourmapname.shader, open that in shaderED and try the Add file thing. Once you've give then shader a name (it doesn't have to be the same as the name of the texture) double click on that and see what comes up.
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 10:32 AM   #22
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
Something must seriously be wrong here, because NOTHING what you're saying is working :/

I created yavinfort.shader
I added yavinfort to shaderlist.txt
I then followed your previous instructions and I STILL get the same error

Sorry about this Codja :/


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 10:40 AM   #23
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
No problem. As I said, my memory isn't what it used to be.

Okay, try this. Get an existing JA shader, rename it and open that in ShaderED. Remove all the shaders bar one, rename that shader to one of your preference and double click on that and see what happens.
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 10:43 AM   #24
CortoCG
 
CortoCG's Avatar
 
Join Date: Jun 2002
Location: Outer Heaven
Posts: 907
I might be of some help. Could you post a download for that precise file? And also tell me what should be the exact path of the file from /base on. Thanks.



Dark Forces Mod: Modeler, animator, coder.

For more detail about my work visit my website
CortoCG is offline   you may: quote & reply,
Old 07-01-2004, 10:50 AM   #25
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
OK we finally appear to be able edit stuff I have something to play with.

Ok, dumb question (though not as dumb as if I hadn't asked), when I apply that texture, is the shader automatically used, i.e. in game will I see the difference, or do I need to do something special to it?

Corto, as it was just an image, there was no need and I've just done what codja says and it looks like I can do stuff...I think

[edit] Only the subfolder reads textures/yavin and I can't rename it... should I post a screenie?


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 10:56 AM   #26
CortoCG
 
CortoCG's Avatar
 
Join Date: Jun 2002
Location: Outer Heaven
Posts: 907
Open the .shader file with notepad and edit the path at will. The only problem is, if the file is not in the new path your enter, then the shader will fail.

The game reads all the .shader files and loads them, checks which effects are applied to which textures. Just follow the naming conventions.



Dark Forces Mod: Modeler, animator, coder.

For more detail about my work visit my website
CortoCG is offline   you may: quote & reply,
Old 07-01-2004, 10:58 AM   #27
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
Also, in shaderEd, click on the sourcesafe menu, go to configure and make sure that the paths to your base and shader directories are correct.

As I mentioned earlier - it's all trial and error and for the most part, a pain in the arse.
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 11:01 AM   #28
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
Ok this is what I have now I've manually culled stuff

Code:
textures/yavinfort/yf_marble2
{
	qer_editorimage	textures/spares/yf_marble2
	q3map_nolightmap
	q3map_onlyvertexlighting
	cull	twosided
}
Anything abnormal there before I start seriously playing around with it?


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 11:04 AM   #29
CortoCG
 
CortoCG's Avatar
 
Join Date: Jun 2002
Location: Outer Heaven
Posts: 907
Actually none of us is using Sourcesafe, so no need to care about it, apart from the annoying message that pops up everytime you execute shadered2.
Raven must've use Sourcesafe so developers could check in and check out the shader files and keep it neat and updated, cuz Raven's shaders files are really big.



Dark Forces Mod: Modeler, animator, coder.

For more detail about my work visit my website
CortoCG is offline   you may: quote & reply,
Old 07-01-2004, 11:04 AM   #30
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
Quote:
Originally posted by Jedi_Vogel


Code:
textures/yavinfort/yf_marble2
{
	qer_editorimage	textures/spares/yf_marble2
	q3map_nolightmap
	q3map_onlyvertexlighting
	cull	twosided
}
You may want to get rid of the q3map_nolightmap and the q3map_onlyvertexlighting otherwise any brushes covered with this texture won't be lit properly i.e. the game will use vertex lighting on this shader and not the normal lightmap.

I recommended configuring the sourcesafe just to rule out any path based problems. I don't really know how much effect it has or not, but better safe than sorry
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 11:07 AM   #31
CortoCG
 
CortoCG's Avatar
 
Join Date: Jun 2002
Location: Outer Heaven
Posts: 907
Quote:
Originally posted by Jedi_Vogel
Ok this is what I have now I've manually culled stuff

Code:
textures/yavinfort/yf_marble2
{
	qer_editorimage	textures/spares/yf_marble2
	q3map_nolightmap
	q3map_onlyvertexlighting
	cull	twosided
}
Anything abnormal there before I start seriously playing around with it?
Yeah, something is really wrong. The path for the texture is not the same in both places. One is in /yavinfort and the other (the first shader stage) in /spares. Be extra carefull with that, or it will haunt you, hehe.



Dark Forces Mod: Modeler, animator, coder.

For more detail about my work visit my website
CortoCG is offline   you may: quote & reply,
Old 07-01-2004, 11:08 AM   #32
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
OK, now I'm set up MAYBE just MAYBE the Shader Manual can make sense and using ShaderEd I can come up with some stuff to help me learn it.

Thank you for your patience, no doubt I'll have questions for you in the near future...

Sometime after my move back to England :/

[edit] And I've updated the path and moved the image to the yavinfort folder


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 11:14 AM   #33
Codja X
Junior Member
 
Codja X's Avatar
 
Join Date: Mar 2004
Location: South Wales, UK
Posts: 445
Corto is right - what you should do when creating new assets is to make your shader name, textures directory and map name the same.

Rename then textures/spares directory to textures/yavinfort and make sure you update the shader to reflect this.

The shader should then look like:

textures/yavinfort/yf_marble2
{
qer_editorimage textures/yavinfort/yf_marble2
}


This is your bog standard shader and is a good base to continue from.

[Edit] Got there before me.

Phew, got there in the end. Just have a fiddle around with it now and have a look at other shaders - just generally experiment with them. If you want a nice scrolling shader, you'll have to use tcmod, but find a scrolling shader 1st, open that in shadered and see how it's done.

With practice and patience you'll eventually learn the ropes.
Codja X is offline   you may: quote & reply,
Old 07-01-2004, 11:23 AM   #34
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
Thanks Codja, much appreciated. I'll start future shaders by hand and then see what ShaderEd can do for me, while I learn to do it by hand...

It's still quite scary though lol

Gotta go find a shader which does what I'm looking for (there's a thread around here somewhere) and see HOW it's done but then tone it down.

Tchu▀


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Old 07-01-2004, 03:59 PM   #35
lauser
 
lauser's Avatar
 
Join Date: Jan 2003
Location: CANADA
Posts: 428
Quote:
Originally posted by Jedi_Vogel
[edit] Woah...ShaderEd is slightly...um...overwhelming *heads to google for ShaderEd tutorial as it doesn't have help file*
This is exactly why I started a ShaderED tutorial thread here. Because as I stated I did a great deal of searching to no avail. So now when people type in ShaderED2 into Google, this forum will pop up with some answers. Because there are MANY more games that use the same type of shaders we use for JK.

Now as far as specific things that the shader does, only a few will show up in shaderED. For instance the ground shaders and wall shaders will not show animations because they are not animated...

I will keep an eye out for that readme though.


My kung fu is also very weak
lauser is offline   you may: quote & reply,
Old 07-01-2004, 09:16 PM   #36
shukrallah
White Dragon
 
shukrallah's Avatar
 
Join Date: Nov 2002
Posts: 3,250
Im just learning to understand shaders, like skys, a little blending, and q3map2_material I think i get surfaceparm too...

How do you set up ShaderEd? I try to add a new texture.. but, it wont let me.
shukrallah is offline   you may: quote & reply,
Old 07-02-2004, 03:57 AM   #37
Jedi_Vogel
Forumite
 
Jedi_Vogel's Avatar
 
Join Date: Jan 2004
Location: Leeds, UK
Posts: 663
Try what I did, open an existing shader, save it as something different, delete what you don't want THEN you should be able to add it.

Alternatively, do it by hand


Jedi_Vogel (aka {KoH}Zandir{JK})
Website: www.resource-centre.net
Do or Do Not. There is no Try.
Jedi_Vogel is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Mapping > Shaders for Idiots

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:35 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.