How to make loaded PNG sharp? (SOLVED)

image

On the left is the ground rendered normally - which looks nice and sharp. On the right, instead of tiling the ground I have loaded a pre-rendered PNG into a GUI node using a slightly modified version of this script.

As you can see, the ground on the right is very blurry. Is there a way to make it look the same as on the left?

1 Like

What is the material of the GUI file set to? That might be causing it to be blurry. A stand alone sample may help to figure out the actual problem.

2 Likes

blurry_png.zip (1.3 MB)

I whipped up a minimal project for it.

It was a while ago that I set this up so I can’t remember why specifically this has it’s own material. It was probably for render order reasons (to render under sprites) as the render predicate is the only thing differing from the normal gui material.

To clarify, game.project in this example doesn’t match my main project, in that one Default Texture Mag Filter and Default Texture Min Filter are set to nearest. Necessary for normal sprites to render sharply but obviously didn’t affect my GUI setup.

I also changed the material tag to regular gui in the example so I wouldn’t have to set up a custom render script.

Solved using this thread: Texture sampling in procedural GUI textures? (SOLVED)

Need to create a material with a sampler named texture_sampler and the Filter settings both set to Nearest.

Dark magic! :mage::dizzy:

4 Likes