Advanced Sprite Billboarding with Godot C#, GDScript and GDShader [Godot Tutorial]
Polysthetic
How to billboard a 3D sprite or plane mesh along an arbitrary axis using C# or GDScript scripts, or with GDShader. Godot has built-in full billboarding and billboarding along the global-Y, but if you want an object to point in the direction its travelling and rotate to face the camera, you'll have to do it this way.
ā±ļø Timestamps: 0:00 Intro 0:32 Setting up the sprite 1:42 C# Implementation 4:55 Godot's in-built billboarding 5:57 Demonstration under moving node 6:43 Accounting for scale 7:20 GDScript implementation 8:49 Why we might need shaders 9:13 Setting up plane mesh and material shader 10:15 Cleaning up the shader 10:58 Writing the shader 12:55 Demonstration of shader 13:40 Conclusion
š» Addendum: If you're using the shader and find that your mesh is invisible you can: A. Double check the order of the cross product, as reversing the order would mean you're pointing the back face to the camera; or B. Add "cull_disabled" to the render_mode list to disable back-face culling.
š¶ Music tracks from:
- Le Metroid - Black Hole
- Provided by Lofi Girl
- https://www.youtube.com/watch?v=eNSKKq34qKM
You can also visit me at: WEBSITE š https://polysthetic.com THREADLESS š¶ļø https://polysthetic.threadless.com DRIBBBLE š https://dribbble.com/polysthetic YOUTUBE š„ https://youtube.com/c/polysthetic AUDIOMACK š¼ https://audiomack.com/polysthetic INSTAGRAM šø https://www.instagram.com/polysthetic/ MASTODON 𦣠https://mastodon.online/@polysthetic TWITTER š¦ https://twitter.com/polysthetic ... https://www.youtube.com/watch?v=4gYzRabYE_I
83223531 Bytes