Little Shader Help

I’d like to start playing with creating shaders, specifically, font shaders.

The problem is, I have no shader or cg experience at all.

To get me started (and maybe some other interested folks), would one of the shader gods who read the posts in this forum please write up a GUIText material shader that does some simple realtime imaging to a gui font?

Say, a shader that puts a stroke border around the GUIText.

Or even better, a shader that does an inner/outter glow or even a gradient on the GUIText.

TIA!

Actually, I think both would be pretty hard. The thing is that you don’t have enough info: for each letter rendered you only have the vertex positions and UVs into the font texture. Though the outline probably could be done by jittering the UVs around and doing some sort of edge detection on the pixel samples.

…my point is only that shaders can’t magically “do everything”. They only work on a single vertex at the time, or a single pixel at the time. And both glow and outlines require some sort of “neighborhood” information, which might be doable or might be not.

otee should write an shader crash course (pdf and project files) for unity users to get them started easier.

Yes, the trouble is what to write in there… except for “try writing shaders for 5 years and it will eventually be clear” :roll: (an exaggeration here)

As Nicholas has said already there are things that are hard and things that are easier. A lot of people had a) no idea of 3d before or b) come from T&L-engines like sw3d or blitz3d. They know how to use a 3d tool but have no idea about shaders. For these people it would help a lot if there would be somekind of tutorial to get them started. There is simply so much information outside about shaders that as a newbie you just don’t know where to focus on or where not so that it’s likely to get lost.

Such a crash course doesn’t have to cover everything. Just some easy step into where you get the idea of some fundamental stuff and which helps them getting things (some) done on their own from a certain point on.

And this should be there before raytracing engines show up! ;O)

raytracing engines… drool… :wink:

Yeah, I want realtime ray-tracing of fonts too! :wink: