I've been working on a little model of the earth. I have a shader which reads a texture to figure out what country is at a specific spot of the world, and recolour it based on that. However, in order for this to work, I have to disable filtering on the textures of the material (as I'm just using a map of each country with their ID as a colour, and filtering would break this).
However, it does make the terrain look pretty bad without the filtering (here's a picture of Italy to show what I mean): https://imgur.com/a/sAJdLSb
Is there a way to disable filtering on one texture in a material, but not others? Alternately, is there a way to pass a texture to a shader without putting it on the material first (and thereby making it not run through the filtering)? A third solution I've considered is filtering the texture in the shader but I have absolutely no idea how to do that.
How to enable texture filtering on one texture, but not others in a material
Re: How to enable texture filtering on one texture, but not others in a material
Nevermind, I've figured out a solution.
I simply rounded the texture coordinates when fetching the texture at a position in my shader, so that it always gets the centre of the pixel (and thus disables any filtering that may exist).
I simply rounded the texture coordinates when fetching the texture at a position in my shader, so that it always gets the centre of the pixel (and thus disables any filtering that may exist).