瀏覽代碼

Prevent linear filtering on RGBA32F images when the system doesn't support it.

--HG--
branch : minor
Alex Szpakowski 9 年之前
父節點
當前提交
d50cf0ac4a
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/modules/graphics/opengl/Image.cpp

+ 8 - 0
src/modules/graphics/opengl/Image.cpp

@@ -501,6 +501,14 @@ void Image::setFilter(const Texture::Filter &f)
 
 	filter = f;
 
+	if (!data.empty() && !hasTextureFilteringSupport(data[0]->getFormat()))
+	{
+		filter.mag = filter.min = FILTER_NEAREST;
+
+		if (filter.mipmap == FILTER_LINEAR)
+			filter.mipmap = FILTER_NEAREST;
+	}
+
 	// We don't want filtering or (attempted) mipmaps on the default texture.
 	if (usingDefaultTexture)
 	{