Baltor Get started

Gallery / Godot shaders

Billboard modes: spherical or upright cylindrical

In your harnessGodot shaderMIT

Vertex billboarding for cards with two modes: spherical (faces the camera fully, for glows and particles) or cylindrical (turns only around the world Y axis, for trees and characters that must stay upright), keeping node position and scale.

Render of Billboard modes: spherical or upright cylindrical
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Shader type
spatial
Render modes
cull_disabled
Parameters
card_texture (sampler2D), tint (vec4 = 1, 1, 1, 1), mode (int = 1), alpha_cutoff (float = 0.5), shade_as_upright (bool = yes)
Use it on
Card textures with alpha, and quads whose origin sits at the base for cylindrical mode (the demo uses center_offset).
Result
Round green tree cards standing upright and turning to face the camera as it moves.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/billboard_axis_modes/

Limits. Cards rotate in the vertex stage, so frustum culling and shadows use the unrotated mesh bounds; give nodes a margin. Shadow maps render the card facing the light camera, not the main camera. Cylindrical mode degenerates when the camera is exactly above the card.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 54.7 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, opengl3 compatibility (Mesa llvmpipe, Xvfb)
Checks
contract static, engine run, engine log clean, shader in scene, capture written, render not uniform, shader changes pixels
Techniques
Spherical billboard from the inverse view rotation, Axis-locked cylindrical billboard, Alpha cut-out with bent normals
Tags
godot shader, spatial, billboard, impostor, vertex shader, sprites, foliage
Identity
library.supply.creative_originals.e222b056c84a294ddfe9c5a6.473881322cee1932
Version
473881322cee19322371415dbc5e2abf92b4d325b1a9d7ec48ba86bd44085291

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.