-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[3.x] Can't use DDS files w/ TextureArrays or Anisotropic Filtering #50900
Comments
The DDS loader code is here: https://github.com/godotengine/godot/blob/caf7cbd8715ce549aabf6d9412388558c11fdb51/modules/dds/texture_loader_dds.cpp #37847 would resolve the issue with anisotropic filtering. For I'm not sure how to solve the texture array issue though, since you wouldn't want to change the import status for every DDS file in the project. |
I discovered
|
I just realized that it doesn't save the anisotropic setting for DDS files in 3.5.2, and found this thread. Is there a way I can resolve this without migrating to 4.x? @TokisanGames would you be willing to share that GDscript import code? |
To anyone stumbling across this thread in seach of an answer, here's a script that will force anisotropic filtering on all textures attached to any MeshInstances. You will have to run extends Node
func set_flags(texture):
if texture == null: return
if texture.flags & Texture.FLAG_ANISOTROPIC_FILTER == Texture.FLAG_ANISOTROPIC_FILTER: return
texture.flags += Texture.FLAG_ANISOTROPIC_FILTER
func set_all_texture_flags(material):
if material == null: return
for tex in range(material.TEXTURE_MAX):
set_flags(material.get_texture(tex))
func set_all_material_flags(mesh):
for mat in mesh.get_surface_material_count():
set_all_texture_flags(mesh.get_surface_material(mat))
func find_by_class(node: Node, cls_name: String, result: Array):
if node.is_class(cls_name) :
result.append(node)
for child in node.get_children():
find_by_class(child, cls_name, result)
func set_all_flags(node: Node):
var meshes: Array = []
find_by_class(node, "MeshInstance", meshes)
for mesh in meshes:
set_all_material_flags(mesh) |
Godot version
3.2.1 - 3.4.beta.custom_build.0b4080ba4
System information
Win 10/64 NVIDIA GeForce GTX 1060/PCIe/SSE2
Issue description
DDS files can't have anisotropic filtering enabled automatically because there is no import file. I've worked around the latter by recursing through all materials in the tree and enabling anisotropic filtering at runtime.
DDS files can't be used for TextureArrays, because there is no import file.
3. Can't enable Anisotropic Filtering on TextureArrays (DDS or PNG) because the option wasn't implemented.Addressed in #51402Steps to reproduce
Click a DDS file, then look at the blank Import tab. Or click a PNG TextureArray and see no Anisotropic filtering option.
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: