1

I'm currently making a game with Python's Ursina module, and everything runs well, except: the grass texture (size: 8192x8192px) looks pixelated at big distance (everything inside the red marker). How can I make it look smoother?

In the screenshot below, I'm standing on a hill and looking down to the grass. Pixelated grass texture from big distance (hill)

1 Answers1

3

I think mip-mapping will help. This is the aliasing effect when the sampling frequency is lower than needed. When a large patch of texture projects only to one (or less than one) pixel, things like this could happen. Mip-mapping, to put it simply, can help you select a suitable texture resolution when the texture is viewed from different distance. For example, when viewed far away, we can use a smoother version (low resolution, prefiltered) texture, and otherwise we use a sharp version of texture (high resolution).

For specific implementations with Ursina, I am not familiar with this lib, but I took a look at the source code (ursina/texture.py) of this lib:

class Texture():
    default_filtering = None      # options: None / 'bilinear' / 'mipmap'
    """..."""
    def __init__(self, value):
        self.filtering = Texture.default_filtering      # None/'bilinear'/'mipmap' default: 'None'

I think this means that Ursina supports mip-mapping? You can just turn this on (use mipmap) and have a try.

Enigmatisms
  • 797
  • 2
  • 12