Low-bit (pixel art) light texture on CanvasTexture sprite has unexpected smoothing/blurring

Godot Version

Godot v4.5.stable.mono

Question

I’m working with pixel arts, my sprites use CanvasTexture’s with diffuse textures and normal maps. The issue is, when using PointLight2D’s, I’m seeing smoothing/blurring of the lighting on some normal-mapped surfaces.

Note that the diffuse texture, the normal map and the texture used for PointLight2D are all hand-painted, low-bit/pixel-art, and doesn’t have this smoothing at all (see below). Project default filter is “Nearest”, same is set for the sprite node, inner CanvasTexture, and PointLight2D as well.

This image demonstrates the issue, see the smoothing on the top and top-right part of the bronze boiler sprite:

Scene setup:

  • A sprite node, with a CanvasTexture, with a diffuse texture and normal map texture assigned, all pixel arts:

Diffuse texture and normal map used (cropped to relevant part):

Lighting texture:

Not sure if this is a bug or I’m just misunderstanding the implementations behind CanvasTexture’s normal maps. Any help is appreciated!

It could be compression from the import settings of the normal map

4 Likes

Interesting, I didn’t think to check those settings. Picking “Lossy” and tweaking the “Lossy quality” produces some cool results, adding more random noises (?) to the lighting, however the smoothing on edge of light is still there.

Meanwhile, my current workaround is to increase the height of the light and decrease the energy accordingly - to keep the light amount consistent. This alters the overall look completely though but stacking different lights with fine-tuned textures works for me.
That being said, I might actually use the lossy setting, the lighting seems more “textured” now which is great for the atmosphere I’m going for.

Edit: Testing it more with more different light configurations, with how good it looks, imo I can conclude that lossy mode is almost the intended way to import pixel-art normal maps.

Lossy with quality set to 0.5, lights at the edge panels at the top and the right (normal-ed surfaces that barely receive light) looks great, almost hand-painted!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.