Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Texture preview in the editor always uses filtering, even for very low-resolution textures #60150

Closed
h0lley opened this issue Apr 11, 2022 · 2 comments · Fixed by #67426
Closed

Comments

@h0lley
Copy link

h0lley commented Apr 11, 2022

Godot version

v4.0.alpha6.official [e4f0fc5]

System information

Ubuntu, Windows

Issue description

For projects that use mainly pixel art assets, all previews are displayed blurry now.

Godot 3.5 to the left, and 4 alpha to the right.

shrroms

Since the filter setting is now no longer stored with the imported resource, perhaps it could be solved via an editor setting.
Alternatively, perhaps it could use different filters based on texture resolution.

Steps to reproduce

  1. In the FileSystem panel, double-click any low res pixel art sprite to preview it the inspecor
  2. Notice it being blurry

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Apr 11, 2022

Related to #57550 and #52332.

My suggestion is to detect the image size and the rendered preview size, and use nearest-neighbor filtering if the scale factor is greater than or equal to 4.0. This is similar to what image editors such as GIMP do.

Alternatively, if drawing the image as large as possible isn't important, integer scaling can be forced and filtering can always be disabled. Either solution is good to me.

@Calinou Calinou added this to the 4.0 milestone Apr 11, 2022
@Calinou Calinou changed the title Texture preview filter regression Texture preview in the editor always uses filtering, even for very low-resolution textures Apr 11, 2022
@KoBeWi KoBeWi moved this to To Assess in 4.x Priority Issues Apr 11, 2022
@KoBeWi KoBeWi moved this from To Assess to Todo in 4.x Priority Issues Apr 11, 2022
@riazey
Copy link

riazey commented Jul 16, 2022

A few extra areas to tack on so it doesn't get missed in testing juuuust in case!

The blurriness affects shaders that are pulling color from a sampler2D which is small in size, like say a pixel color palette in a color replacement shader because it pulls the color from the blurred image~ (Including global shader params)

Using edit region on pixel art is a bit of a "guess which pixel is the edge" game~ xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants