I’m trying to create some procedural textures for a minimap system, and noticing that the upscaled 10x10 checkerboard texture shown in the screenshot is being rendered with linear filtering. As is visible, rendering is set to nearest in game.project which is reflected in the game sprites but not in the procedural texture. GUI textures such as the item and status icons render with ‘nearest’ sampling as well.
Is there a way to set the sampling of textures created with gui.new_texture()?
I’m assuming it’s using the built in material. I don’t know how to fix this the way it should be done, maybe there should be a way to override the built in defaults more easily.
A short term solution may be to edit your builtin, default files directly, but it would impact any project so not a good idea if you are working on many.
For example replace the gui.material file with one which uses the same material you use for your other GUI.
You can change the material of a gui scene by selecting the root of the gui scene and in the properties window change the material (the same place where you set the gui script file).
I set minimap.gui’s material to the one you provided, and I still get the same result. Since the other gui textures render with nearest with both the built in material and the provided one, I’m starting to suspect that the texture created with gui.new_texture isn’t using the material settings provided. When I get a chance, I’ll make a little altered copy of the fragment shader with some color modifications and see if those are reflected in the procedural texture.
Thanks everyone, it finally filters properly - @pkeod’s gui.material worked when I changed the sampler name to “texture” as @sven suggested as that’s the sampler name used in the built-in fragment shader.