Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Filter' texture flag defaults to 'on' when using new textures and rebuilding #155

Open
Bropocalypse opened this issue May 30, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Bropocalypse
Copy link

I'm currently using pixellated graphics in my project and I've noticed that rebuilding a map in Godot causes the newly added textures' filters to default their 'Filter' flag to 'On' even though it was deliberately turned 'Off' when imported into Godot(I know because I set them manually). This behavior does not occur on subsequent rebuilds after re-setting the flag back to 'Off'(it only happens to textures newly added to the texture collection in TrenchBroom), but it's a little annoying.

Steps to reproduce:

  1. Import a texture into Godot(in my case I use .PNG files), placing it into TrenchBroom's designated textures folder.
  2. Set the texture's 'Filter' flag to 'Off'.
  3. Refresh the texture collections in Trenchbroom and use the new texture in the current map. Save the file.
  4. In Godot, press 'Quick Build' or 'Full Build' to rebuild the map.
  5. Check the texture's flags(you may need to click on a different one and then back again to refresh the Import tab's display).
  6. the flag will be defaulted to 'On'. You can turn it off and re-import it and it will behave normally.

Godot v3.4.4.stable.official [419e713a2]
Qodot 1.7.1
TrenchBroom v2021.1 (release Linux)

@disco0
Copy link

disco0 commented Jun 5, 2022

Was in similar situation for a modding project involving external user textures, ended up setting the relevant flags on textures (Texture.FLAG_REPEAT | Texture.FLAG_ANISOTROPIC_FILTER) when they're created qodot_texture_loader.gd:

func load_texture(texture_name: String) -> Texture:
	if(texture_name == TEXTURE_EMPTY):
		return null

	# Load image as texture if it's external
	if texture_name in external_texture_dict:
		var dict_value = external_texture_dict[texture_name]
		var img = Image.new()
		var err = img.load(external_texture_dict[texture_name])
		if err == 0:
			var tex = ImageTexture.new()
			tex.create_from_image(img)
			tex.flags = Texture.FLAG_REPEAT | Texture.FLAG_ANISOTROPIC_FILTER
			return tex as Texture
		else:
			return null
# ...

Its in a added external texture dictionary lookup, but it still should apply to any other texture creation

@DeerTears DeerTears added the bug Something isn't working label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants