Closed Puppyguarb closed 9 months ago
I had a look at this issue and it is related to Sprite3D.texture_filter
.
*NEAREST*
filters work fine*LINEAR*
filters have the problem, that the color bleeds over to the other sideSetting the Texture size to (4x4) shows the problem even better for Linear Mipmap:
To me it is not entirely clear, what the desired functionality should be. In the case of this Gradient I would assume, that the desired behavior is, that the Sprite3D should have the darkest black on the left and the brightest white on the right.
One way to solve this would require to stretch the Texture in the case of *LINEAR*
and keep it the same in the case of *NEAREST*
, but I assume that this stretching would interfere with other uses of *LINEAR*
?!
A different way to solve this, would be to disable the linear interpolation at the four edges, but I am not sure, if this is feasible because of the additional computational cost.
What would be a fitting solution for this problem?
Disabling texture repeat (FLAG_REPEAT ) should fix that.
Hey, I am new in this , can you provide me some easy entry level work.
@vipulvatsa5 look for issues tagged "good first issue" like this one. And if you're fishing for assigning you issues, Godot does NOT practice assigning issues, just start a PR
This is expected, as texture repeat is enabled by default (it makes sense on most materials). In the few cases where it's not desired, disable texture repeat in the material or shader.
I'm not sure where this should be documented specifically, as this isn't something you'll run into often (since this doesn't occur with QuadMeshes that have transparent edges).
(it makes sense on most materials)
But does it make sense on the default material used for Sprite3D when a texture is applied? I'm not too sure.
Godot version
4.0.rc2 EDIT: I have tested, and it appears on 4.0.rc3 as well.
System information
Windows 10, NVIDIA GeForce GTX 1650 SUPER
Issue description
Sprite 3Ds with a gradient texture assigned to them have a line on the edge that should not be present.
This still occurs even if using a Quad mesh with a gradient texture.
Steps to reproduce
If you want to do this with a Quad instead:
Minimal reproduction project
Included in the project below is a Camera3D set to view a Sprite3D with a GradientTexture2D assigned to it, and a Quad with an unshaded material with a GradientTexture2D assigned to it.
GradientArtifactsProject.zip