Why did Sprite3D turn white after I applied Shader to it?

Godot Version

4.3

Question

I am following https://www.youtube.com/watch?v=nyFzPaWAzeQ and I have successfully got a swaying grass like in the part between 5:19 to 21:58. That part is for Sprite2D so I would like to try this on Sprite3D.

But when I tried doing that, it is quite different. Sprite2D has Material in CanvasItem, but Sprite3D has Material Override in GeometryInstance3D instead. So I tried creating a new Shader and put it in there, then the whole Sprite3D turned white. So what’s going on here? What would be the correct way to translate the tutorial above to be in 3D here?

It would help if you posted the shader code you’re trying to apply to the Sprite3D.

The likely reason is that you’re using a canvas_item type shader on an element that requires a spatial type shader, and instead of COLOR, it uses ALBEDO and ALPHA.

1 Like

@FencerDevLog

It would help if you posted the shader code you’re trying to apply to the Sprite3D.

I only applied the Shader into the Sprite3D’s GeometryInstance3D. I haven’t done anything else after that step, so there is no shader code, I believe.

The likely reason is that you’re using a canvas_item type shader on an element that requires a spatial type shader, and instead of COLOR, it uses ALBEDO and ALPHA.

Let me try that.

The likely reason is that you’re using a canvas_item type shader on an element that requires a spatial type shader, and instead of COLOR, it uses ALBEDO and ALPHA.

I don’t think I have the know how on this part yet. How to apply Shader for Sprite3D validly?

@FencerDevLog What you mentioned about Spatial Shader is true. I created a new Shader as code , not the VisualShader one I was using, and I tried the code from Outline and Glow Shader Sprite 3D - Godot Shaders . After that, I put this new Shader into Material Override of GeometryInstance3D, and add the texture I want in the “Sprite Texture” of the Shader Parameters and I see I could proceed from there.

I couldn’t find the part for Spatial Shader in the VisualShader, but from here, I believe direct Shader coding should give me the most flexibility.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.