Bug report: Texture Interpolation not respected - linear makes blurry image in pixelart.
heksik opened this issue · 3 comments
Describe the bug
In Pixelart there are small textures like 64x64. Blender by default make them blurry so in node editor interpolation has to be changed from default linear to Closest - OK.
In VRM editor when user imports VRM default value in texture interpolation is "linear" - OK.
After change interpolation to "closest" and export, output texture is blurry ignoring interpolation settings.
To Reproduce
- Create any object and use low resolution 64x64 for texture painting in blender.
- Change image interpolation in node editor from default linear to closest to have pixel perfect view
- Export VRM and it's blurry in Unity.
Probably image/png included in VRM file generated by blender is not respecting this attribute.
Expected behavior
Texture in VRM file should looks the same like in Blender.
Workaround:
Increase texture size to look the same in default linear image interpolation.
Screenshots
Desktop (please complete the following information)
- Blender 4.1
- Addon 2.20.49
Additional context
Probably something like to add somewhere:
if node.type == 'TEX_IMAGE':
node.interpolation = 'Closest'
Shader.py
Suggests it's somehow implemented in the code but not working.
# blender is ('Linear', 'Closest', 'Cubic', 'Smart')
# glTF is Linear, Closest
filter_type = GL_NEAREST if from_node.interpolation == "Closest" else GL_LINEAR
The bug was fixed with the latest version v2.20.51 just released. Thank you for your report.