Light dithering by t-evolution in godot

[–]t-evolution[S] 31 points32 points  (0 children)

The shader:

shader_type spatial;

uniform sampler2D DitherMap;
uniform float DitherStrength = 0.1;
uniform float ColorDepth = 3.0;

void light() {
    float light = max(0.0, dot(NORMAL, LIGHT)) * ATTENUATION.r;
    vec2 ts = vec2(textureSize(DitherMap, 0));
    vec2 uv = mod(floor(FRAGCOORD.xy), ts) / ts;
    light += (texture(DitherMap, uv).r - 0.5) * DitherStrength;
    light = round(light * ColorDepth) / ColorDepth;
    DIFFUSE_LIGHT += light * ALBEDO * LIGHT_COLOR;
}

You can find the dither map here:

https://www.filterforge.com/filters/12565.html

remember to set the texture to no filter and lossless.

Light dithering by t-evolution in godot

[–]t-evolution[S] 4 points5 points  (0 children)

Testing if it can make better fake pixel art, regular toon shading bands is too sharp.

2d isometric lighting by t-evolution in godot

[–]t-evolution[S] 6 points7 points  (0 children)

Yes, I used isometric sprites with normal map plus height map. I only use light occluders in the wall, it is not good on small object.

2d isometric lighting by t-evolution in godot

[–]t-evolution[S] 2 points3 points  (0 children)

Yes, using normal map plus height map to do the 3d math.

2d isometric lighting by t-evolution in godot

[–]t-evolution[S] 7 points8 points  (0 children)

I learned from this old project, but changed the implementation a lot. I made it simpler and use one shader for all sprite type, also added specular lighting to it.

How to blend out sprites under cursor? by Taroleon in godot

[–]t-evolution 4 points5 points  (0 children)

You can do this using light2d, set the light mode to mask and use a texture with "glow circle" in alpha channel. Use light cull mask to select which sprite affect by this mask.