shadowDrop
shadowDrop(
spriteTex,uv,shadowOffset?,shadowColor?,shadowAlpha?):Node<"vec4">
Defined in: packages/nodes/src/lighting/shadows.ts:22
Create a drop shadow effect. Samples the sprite’s alpha at an offset position to create shadow.
Parameters
Section titled “Parameters”spriteTex
Section titled “spriteTex”Source sprite texture
Node <"vec2">
Current UV coordinates
shadowOffset?
Section titled “shadowOffset?”Vec2Input = ...
Shadow offset in UV space (default: [0.02, -0.02])
shadowColor?
Section titled “shadowColor?”Vec3Input = ...
Shadow color (default: [0, 0, 0])
shadowAlpha?
Section titled “shadowAlpha?”FloatInput = 0.5
Shadow opacity (default: 0.5)
Returns
Section titled “Returns”Node <"vec4">
Shadow color with alpha (vec4), composite with original
Example
Section titled “Example”// Create shadow behind spriteconst shadow = shadowDrop(texture, uv, [0.03, -0.03], [0, 0, 0], 0.4)// Mix: show shadow where sprite alpha is 0, original where alpha is 1