Shader Library - Why we need one now

Posted By: SingleCell

Shader Library - Why we need one now - 12/11/03 11:48

Shaders... Seems to be like sex when i was at school, everyone talking about it, no one doing it.

Ive tried to make some simple shader effects and have got nowhere fast, the documentation is hidiously complex (as is the subject matter) and best left to those programmers who understand it. Me, im an artist who dabbles in programming, so all i want is something i can use in my application without fuss, and i need to know what cards it will run with. And im guessing that im not alone here.

Looking at most of the shader sites on the net, there is a common theme - that is, that shaders are for coders. You can tell this by descriptions such as "Modulates the fresnel term using a rotational matrix of a Dot-3 product calculated from the inverse vertex matrix. requires PS_7" Cool... but what does it look like? And will it work on a GF2 class card? (Dont get me wrong, im not bagging coders here, its just they see the world differently - mine understands this stuff and looks at me like im a complete idiot when i ask her what it all means...)

But, from an artistic point of view, what i, and im guessing others, want is "This shader makes surface look like they are shiny, with a gold tint and small bumps. Uses 2 passes and works with GF3 class cards or better."

So, when im browsing through the huge library of effects that im sure will manifest itself any day now, i can pick based on what it does and what cards it will run on. I mean who cares if its dot3 or per pixel bump mapping - does it make the thing look lumpy?

I dont know how we can work this, but we probably also need a "request an effect" topic - for instance, right now, i want a simple script that will give me "shiny" effects on a model based on the alpha of the models skin - that will run on everything from a TNT2 class upwards. Just a standard, simple effect that is used in a lot of games today.

This shader stuff is exciting, but i want to be "doing it" not talking about it. (or trying to read the manuals).

Thoughts?

Tone

Posted By: msKEN

Re: Shader Library - Why we need one now - 12/11/03 14:45

Below is the alphamap shadder you are looking for that was made by Drew and Vent. You must make the second skin01 in MED a 32 bit alphamap. I personally have not been able to get it to work. I don't know if the problem is with my alphamap (white is the shader, black 0,0,0 is no shader) or if the new patch changed some features or something or what, but I'm dying to be able to use alpha maps on my car models. It would work nicely/perfectly for chrome and windows. Things that aren't supposed to be shinney just shouldn't be (IE grills, tires, and liceanse plates, underbody and etc. ! lol.

Code:
 bmap bmp_envcube2 = <skycube1+6.tga>;

// generate a matrix that transforms camera space back to world space
function mtl_env_view()
{
mat_set(mtl.matrix,matViewInv);
// reset the translation part of the matrix
mtl.matrix41 = 0;
mtl.matrix42 = 0;
mtl.matrix43 = 0;
}

function mtl_env_init()
{
bmap_to_cubemap(mtl.skin1);
mtl.event = mtl_env_view;
mtl.enable_view = on;
}

material mtl_envcube2 // environment cube
{
skin1 = bmp_envcube2;
event = mtl_env_init;

effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique cubic_environment
{
pass p0
{
Texture[0]=<entSkin1>;
Texture[1]=<mtlSkin1>;

zWriteEnable=true;
AlphaBlendEnable=true;

ColorArg1[0]=Texture;
ColorOp[0]=Modulate2x;
ColorArg2[0]=Diffuse;

ColorArg1[1]=Texture;
ColorOp[1]=BlendCurrentAlpha;

AddressU[1]=Clamp;
AddressV[1]=Clamp;
TexCoordIndex[1]=CameraSpaceReflectionVector;
TextureTransformFlags[1]=Count3;
TextureTransform[1]=<matMtl>;
}
}
";

}

action a
{
my.material = mtl_envcube2;
}



If someone could check that out that knows what they are doing, and can tell us if thats working correctlt in v6.20 then that would be great, cause at the moment, I'm blaming my alphamap.
Posted By: Nadester

Re: Shader Library - Why we need one now - 12/11/03 22:56

That works like this: Make a model, assign that to it. Export the skin. Edit it, and make the skin's alpha channel what you want (the lighter the area, the more reflective). Save the image as .tga. Then import it into med as the model's skin. And save the model. It *should work.
Posted By: Beorn

Re: Shader Library - Why we need one now - 12/11/03 23:39

Hmmm, MSKen,
Im not sure about this but i think you got it slightly wrong. I got Vent/jelly/conitecs script working very nice with my geforce2mobile. But i only have one skin on my model but this skin is a 32 Bit tga. And that alpha controls the shinyness.

And also, i dont think this is a shader, itīs an effect. Shaders wont work with such old hogs as geforce 2 so i guess they should be impossible on TNTs also.
But effects may, since there is no "graphics assembler" involved.



Posted By: Zerodin

Re: Shader Library - Why we need one now - 12/12/03 00:01

Hey it WORKS, and it looks NICE on my Geforce FX 5200
Posted By: msKEN

Re: Shader Library - Why we need one now - 12/12/03 04:46

Quote:

Hey it WORKS, and it looks NICE on my Geforce FX 5200




Sweet, I must be making my alphamaps incorrectly.
Posted By: Zerodin

Re: Shader Library - Why we need one now - 12/12/03 06:07

I haven't mastered alphas right either the hole model is shiney, but I actually am getting to see A6 shader effects at work on my computer! YAY!
Posted By: msKEN

Re: Shader Library - Why we need one now - 12/13/03 15:52

Quote:

And also, i dont think this is a shader, itīs an effect. Shaders wont work with such old hogs as geforce 2 so i guess they should be impossible on TNTs also.




Thanks for the correction, I guess I don't know my terminology as well as I should.
Posted By: Beorn

Re: Shader Library - Why we need one now - 12/14/03 11:15

Hey, neither do i;) It caused me some serious headache to find out wich was which. Jut thought it might be handy to know while trying to get into this stuff.
Posted By: SingleCell

Re: Shader Library - Why we need one now - 12/15/03 06:22

msKen:

Thanks, but that effect is not exactly what im looking for, but thanks for posting it anyway. (Sorry, i should have elucidated a bit more - The effect im after is where the "reflection" or "shine" looks as though its "attached" to the view - Hmm... trying to explain ithis is not easy - If anyone has played Judge Dredd recently its used for almost every shiny surface in the game. (See this is exactly what i was talking about, i see stuff from an artisti perspective - i dont see it as "environment mapping" or such like..)

I see there is now a shader Index topic, which i guess is what i was asking for, so we shall see what falls in to it.


Tone
Posted By: Matt_Aufderheide

Re: Shader Library - Why we need one now - 12/15/03 10:33

Well even an artist needs to learn the basic technical terminology to speak intelligently about these things.. there are plenty of resources on the web about surface effects
Posted By: SingleCell

Re: Shader Library - Why we need one now - 12/15/03 16:47

Actually i disagree with the first part of that statement. An artist who uses oil paint does not usually fully understand the chemical or molecular makeup of the paint, and someone who sculpts from stone may not fully appreciate the geological makeup of the stone, but both can still create a work of art using thire chosen medium.

Likewise; I have been a professional game developer for over 10 years, but still dont fully understand the inner workings of shaders, surface effects, or 101 other different bits of graphics technology that i use to create my work, I leave the deep understanding to guys like yourself who have the skills and interest in that area. My technical expertise, like many other artists, tends to be very broad, but not too deep. Likewise, I have worked with programmers who are also highly specialised, either in graphics, or AI or Networking, and who have only a "working" knowledge of things outside thire field of expertise or interest.

What i was trying to get across initialy was that there are generally two types of people using shaders: Techies and Arties - Both who have different ways of talking about things. What i believe we ALL need is a repository of effects that fits both camps. So, i'll take my artists hat off, and put on my designers hat, and come up with a sample of what i mean - in-between reading up about shaders on the net


Tone

BTW - I'm not trying to start an argument with anyone, just postin my opinion.

Posted By: Matt_Aufderheide

Re: Shader Library - Why we need one now - 12/15/03 19:36

Im an artist myself. I have delved into shaders becasue i find it interesting and you cant expect everyone else to do the work you want the way you want it done..As a game developer i find it neccessary to understand in part the problems programmers face. The various surface effects that have been developed fall into definite catagories and methods of implementation.. for instance environment mapping. An artist needs to know what it means.. what kind effect can be generated using it.. and can plan art by understanding the technology. You dont need to learn assembly code, but whats stopping you from doing it...
Posted By: SingleCell

Re: Shader Library - Why we need one now - 12/16/03 06:29

Hey Matt. Like i said, im not bagging anyone, and im not saying that i cant or wont learn this stuff and im definatly not asking anyone to do the work i need doing - thats what i pay my programmers for.

Actually I can tell my realtime procedural caustics from my cubic environment mapping, but read through these forums, and you'll discover a lot of people who havnt quite got the terminology right yet, and are being confused. I often come across descriptions on shader sites that mean nothing unless i spend a few hours research only to find out that it creates "a tin like sheen with flecks of gold and an orange halo."

Trust me, I totaly agree with you when you say that as artists we need to "in part" understand what programmers are faced with, and vice versa. I was never attempting to dispute that, mearly make it easier to find effects that fit a certain artistic look / technical implimentation / range of supported hardware.

For instance, say someone develops a great per pixel bump maping effect, that only works with GF4 cards and above, someone else may want to modify that effect so that it falls back to dot3 bumpmapping on lower spec cards - therefore you can have a "bump mapping" effect that will use the best effect possible on given hardware. Thats the kind of thing i want to see implimented and available on this forum.

I guess what im trying to get is some form of consistent way to have effects submitted. For example some thing along the lines of:

Tech description "This effect works by..."
Artistic desription "This effect looks like..."
Fallback Technique "If perpixel bumps are not supported, will fall back to dot 3..." Art Requirements "Model skins must be 24 bit no alpha with a precalculated normal map as skin 2"
Cards Supported "Tested with TNT2, GeForce 2,3,4 and FX, should work with all radeons, and S3 Virge (ok maybe not...)

Just something simple like the text file that used to accompany user made Quake maps... nothing to in depth, but describes the effect, what it needs to work, and what it will run on. When i have a little free time later this week i'll rustle something up and post it here.

And to answer your question "What stops me from doing it" Nothing, im just too busy learning the ins and outs of Creatives EAX3 SDK and refreshing my knowledge of Direct sound at the moment - but its on my list after that.

But i do enjoy your debate - its very well articulated - makes a nice change from some. :-)

Regards

Tone

© 2024 lite-C Forums