Page 1 of 1

shaders (mainly for DG or antagonist)

Posted: Sun Aug 08, 2010 10:17 pm
by Shoob
hmm, DG or antagonist,

so I made a shader that should shade a circle and as it goes out from the center also smoothly go from the set color to the outside color...

however due to the engine making it so that the shader affects only 1 tile, there is not much use for this.

what would be nice is if the engine could make shaders "reach" over tiles (like particles can) so that I could see if my shader works.

if it does work I could see various applications for it, namely:
a) better fade for LOS, ie instead of dimming squares and somewhat blocky, have it dim from the center out smoothly
b) lights (not just the player but spells and terrain could use this, making them more realistic)

Re: shaders (mainly for DG or antagonist)

Posted: Tue Aug 10, 2010 7:49 am
by darkgod
As I told you shaders apply to textures.
You could have an entity with an additional_display which is bigger than itself and apply a shader on it I guess. Like the trees currently can "bleed" over neighboring tiles.

Re: shaders (mainly for DG or antagonist)

Posted: Tue Aug 10, 2010 7:54 am
by Shoob
hmm, ok, I will try that :) (but yeah, I need to work a bit more on mine, I can get it to shade a circle, but not really fade yet)

Re: shaders (mainly for DG or antagonist)

Posted: Tue Aug 10, 2010 11:54 am
by Antagonist
Actually, I havn't tried it but should be simple.

Remember that you don't just get fragment shaders, you get vertex shaders too.

Just have the vertex shader pull the vertexes outward so the quad renders larger than the tile.

Other alternative is a fullscreen shader effect like DG's red hp warning glow thing.

Re: shaders (mainly for DG or antagonist)

Posted: Tue Aug 10, 2010 4:17 pm
by Shoob
simple, maybe, but I have never programmed in frag before ;) (this was my first attempt, and when I looked there are really NO good guides to frag programming online that I could find, if you have a link to any, that would be appreciated :))

Basically that means I am stuck using what other people have coded to write my own code, even though I don't really know what I am doing.

Re: shaders (mainly for DG or antagonist)

Posted: Tue Aug 10, 2010 11:30 pm
by Antagonist
Well, by frag I mean fragment shader. vert is vertex shader. The LANGUAGE tho is GLSL. PLENTY of guides about that.

If you're on windows, check out RenderMonkey. Its a half-decent GLSL IDE that I use. Not perfect, and not updated in 2-3 years but still does most of what you need it to do.