【问题标题】:Pythin kivy how to turn off texture antialiasingPython kivy如何关闭纹理抗锯齿
【发布时间】:2021-05-23 20:24:41
【问题描述】:

我有一个平均大小为 120 x 80 的纹理,每帧都会发生变化。它是由一个数字数组创建的,使用

    def draw(self, t):
        self.buf = t
        self.texture_array = array('B', self.buf)
        self.size = Window.size
        self.padding_x = Window.size[0] * 0.25
        self.padding_y = Window.size[1] * 0.25
        self.pix_size_x = Window.size[0] * 0.75
        self.pix_size_y = Window.size[1] * 0.75
        self.tex.blit_buffer(self.texture_array, colorfmt='rgb', bufferfmt='ubyte')
        with self.canvas:
            Rectangle(texture = self.tex, pos = (self.padding_x, self.padding_y), size = (self.pix_size_x, self.pix_size_y))

它应该看起来像像素艺术,但纹理平滑破坏了整个画面。是否有可能以某种方式禁用抗锯齿或以其他方式呈现数组?

【问题讨论】:

    标签: python kivy rendering textures antialiasing


    【解决方案1】:

    纹理具有mag_filtermin_filter 属性,请将它们都设置为"nearest"

    【讨论】:

      猜你喜欢
      • 2020-12-12
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      • 2014-02-18
      • 2010-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多