Skip to content

Godot 4.1.1: Questioning today's usefulness of Sprite2D property "region_filter_clip_enabled" #87847

Closed
@MeanRaccoon

Description

@MeanRaccoon

Tested versions

Reproducible in (please see screenshots)
image
image

System information

Godot v4.1.1.stable.mono - Windows 10.0.19045 - Vulkan (Compatibility) - Intel(R) HD Graphics 630 (Intel Corporation; 27.20.100.8280) - Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz (4 Threads)

Issue description

I've been testing and studying in detail Sprite2D node, its capabilities, methods and properties. I am questioning the usefulness of the boolean property region_filter_clip_enabled because I've been unable so far to make it work how I imagined it should work, despite all my testings. I understand also this subject has to do with the concept of "pixel bleeding". According to the docs:

If true, the outermost pixels get blurred out. region_enabled must be true.

By "outermost pixels", I believe we're talking about the pixels at the border of the selected rectangular region, though the thickness of this border is not specified (1 pixel, 2 pixels witdh...?).

I've been discussing the issue in Godot's communities, and I've been taught that spritesheets with tighly grouped sprites could lead to pixel bleeding. With this set up, I could start testing out the functionality of the aforementioned property. When set to true, I expected this property (at least to a certain degree) to mitigate the pixel bleeding that arises when the CanvasItem texture_filter is set to any of its linear variations (linear, linear mipmap, linear mipmap anisotropic), but I see no difference at all, which leads to suspect if this property is working properly, or if its been deprecated long ago and now is rubble.

Meanwhile, when texture_filter is set to any of its "nearest" variations, no bleeding occurs regardless of the value of region_filter_clip_enabled (the preferred case for pixel art).

Steps to reproduce

All these screenshots were made in Godot 4.1.1. To test this out, I used this classic Sokoban spritsheet from Kenney's assets, where the boxes sprites have no spacing at all between them:

image

Carefully select the region for this blue box:

image

Try out many combinations of region_filter_clip_enabled and texture_filter properties. (Not all texture_filter are shown in this screenshot because the visual result repeats itsel,f as explained in the issue description above):

image

Minimal reproduction project (MRP)

Sprite2D region_filter_clip_enabled test.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions