shaders (mainly for DG or antagonist)

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

shaders (mainly for DG or antagonist)

#1 Post 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)
Oliphant am I, and I never lie.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: shaders (mainly for DG or antagonist)

#2 Post 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.
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: shaders (mainly for DG or antagonist)

#3 Post 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)
Oliphant am I, and I never lie.

Antagonist
Higher
Posts: 71
Joined: Sun May 23, 2010 9:55 am

Re: shaders (mainly for DG or antagonist)

#4 Post 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.

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: shaders (mainly for DG or antagonist)

#5 Post 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.
Oliphant am I, and I never lie.

Antagonist
Higher
Posts: 71
Joined: Sun May 23, 2010 9:55 am

Re: shaders (mainly for DG or antagonist)

#6 Post 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.

Post Reply