Skip to content

Commit

Permalink
Merge pull request #40 from Calinou/small-textures-disable-filtering
Browse files Browse the repository at this point in the history
Disable filtering for small textures in the material preview
  • Loading branch information
RodZill4 committed Oct 20, 2019
2 parents d376aa2 + c00a77e commit 93dd1ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/material_maker/engine/gen_material.gd
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func render_textures(renderer : MMGenRenderer):
result.release()
# To work, this must be set after calling `copy_to_texture()`
texture.flags |= ImageTexture.FLAG_ANISOTROPIC_FILTER

# Disable filtering for small textures, as they're considered to be used
# for a pixel art style
if texture.get_size().x <= 128:
texture.flags ^= ImageTexture.FLAG_FILTER
elif t.has("ports"):
var context : MMGenContext = MMGenContext.new(renderer)
var code = []
Expand All @@ -114,6 +119,11 @@ func render_textures(renderer : MMGenRenderer):
# To work, this must be set after calling `copy_to_texture()`
texture.flags |= ImageTexture.FLAG_ANISOTROPIC_FILTER

# Disable filtering for small textures, as they're considered to be used
# for a pixel art style
if texture.get_size().x <= 128:
texture.flags ^= ImageTexture.FLAG_FILTER

generated_textures[t.texture] = texture

func update_materials(material_list):
Expand Down

0 comments on commit 93dd1ca

Please sign in to comment.