Help with the shader

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ONION-777

I need to apply this shader: (2D wind sway - Godot Shaders) to sprite3d

:bust_in_silhouette: Reply From: Wakatta

You can use a Sprite3D too but MeshInstance is better

  1. Create MeshInstance
  2. Set Mesh to Quad mesh
  3. Set New ShaderMaterial
  4. Attach Shader

in the shader

  • change shader_type canvas_item; to shader_type spatial;
  • change render_mode blend_mix; to render_mode blend_mix, unshaded;
  • add uniform sampler2D albedo_texture : hint_albedo;
  • add the following function

.

void fragment() {
	vec4 result = texture(albedo_texture, UV);
	ALBEDO = result.rgb;
	ALPHA = result.a;
}
  • set albedo_texture