Description
Changelog
Reviews (0)

Lay down a layer of geometry on top of all upright surfaces in your scene.

This addon can be used to generate a blanket of snow 🏔️, mounds of dirt, or piles of autumn leaves 🍂.

Eliminate the tedious work of reauthoring all of your 3D models - uniform effects should happen automatically!

Features

  • Customizable & smoothly animated height/depth
  • Customizable upward angle
  • Easy scene-wide control via main node
  • Individual mesh targeting/overrides
  • Easy exclusion by group

How it Works

Everything runs on the GPU through compute shaders. No GDExtension needed.

Meshes are checked for upward faces. The placement of the Blanket node controls which meshes are eligible - only siblings - place directly under scene root to cover the whole scene.

Upward faces are identified, extruded and bevelled through a handful of compute dispatches, no mesh data copied back to the CPU. This happens as a one-time bake at initialization.

The resultant generated geometry is inserted as an additional surface on the same mesh. Then textured via a ShaderMaterial.

Depth can then be animated at runtime cheaply without a rebake.

Your meshes are safe - never modified.

Under the Hood

This addon demonstrates advanced GLSL use in Godot. Lots to be excited about.

  • Beautiful compute shaders
    • All of your meshes processed in parallel
    • Same work would not be feasible on the CPU
  • Logical split between "bake" and "update" stages
    • No unnecessary work done at runtime
  • Indirect dispatching of each compute pass
    • No GPU-CPU roundtrip
    • Use case: Pass a determines that there's x number of verts, writes dispatch size for Pass b, which then only concerns itself with verts x
  • Smart workgroup layouts where possible
    • Work distributed logically across xyz compute axes for better code readability
    • Workgroup sizes tailored to maximize wavefront occupancy (GPU utilization)
  • Specialization constants
    • Some params don't change, hence can be baked into the pipeline for efficiency
  • Direct GPU access of mesh vertex/index/attribute buffers
  • The little known shader versions in Godot
    • Facilitates switching between half-precision and full-precision mesh buffers without code clutter
    • Small meshes with index buffers under 65k indices get 16-bit addressing in Godot
  • GLSL extensions

Requirements

  • Godot 4.8 - needs mesh buffer RIDs
  • Forward+ or Mobile renderer - Compatibility has no compute support
  • Desktop recommended; mobile GPU compute may or may not work
  • Meshes should be ArrayMesh with valid normals

Usage

Download via Godot Asset Store or download the zip and manually copy the addons/blanket/ folder to your project. Enable addon via Project -> Project Settings -> Addons. If you see errors, restart editor to ensure the BlanketShaders global is loaded.

Add a Blanket node as a sibling of whatever you want covered. If you want everything in your scene covered, place directly under scene root like you would WorldEnvironment.

To skip a mesh, assign it the blanket_exclude group. In case of imported models (.glb, .fbx, etc.), any parent with this group works too.

For per-mesh control, add a BlanketInstance directly under a MeshInstance3D. Hand-placed instances are left alone - not overriden.

Support

Is this addon valuable to you? It took some real sweat and tears to make.

ko-fi

Acknowledgements

Changelog for version v1.0.0

No changelog provided for this version.

Reviews

Blanket has no reviews yet.

Login to write a review.

Consider supporting the creators!

If you enjoyed this asset consider supporting its creator. Follow the link below.