Skip to content

Add textured ribbon mode to Trail renderable #1383

@obiot

Description

@obiot

Summary

The Trail renderable (#1368) currently draws solid-color quads with gradient interpolation. A textured ribbon mode would allow mapping a texture (or sprite sheet frame) along the trail, enabling effects like:

  • Sword slash arcs with a blade texture
  • Magic spell trails with animated glow textures
  • Smoke/fire trails with particle-like textures
  • Rope/chain rendering

Requirements

  • texture option in Trail constructor — accepts an image or TextureAtlas region
  • UV mapping along the ribbon: U stretches along the trail length (0=head, 1=tail), V spans the width
  • Compatible with the existing gradient/opacity/blendMode options (tint the texture with the gradient)
  • Works on both WebGL (textured quads via drawImage or batcher) and Canvas (drawImage with transform per segment)

References

  • Godot Line2D texture_mode — stretch/tile/fit modes
  • Unity TrailRenderer material — texture mapped along trail
  • Current Trail implementation: src/renderable/trail.js

Notes

This was identified during the Trail implementation (#1368) but deferred to keep the initial PR focused on the core ribbon rendering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions