Skip to content

feat: add BillboardNode, TextNode, PhysicsNode + 3 new samples#678

Open
ThomasGorisse wants to merge 3 commits intomainfrom
feat/text-billboard-node
Open

feat: add BillboardNode, TextNode, PhysicsNode + 3 new samples#678
ThomasGorisse wants to merge 3 commits intomainfrom
feat/text-billboard-node

Conversation

@ThomasGorisse
Copy link
Contributor

Summary

  • BillboardNode — always-facing-camera quad node for labels/icons (3.4.0 roadmap)
  • TextNode — SDF-rendered 3D text anchored in world space (3.4.0 roadmap)
  • PhysicsNode — rigid body + collision via Bullet/JBullet, tap-to-throw demo (3.2.0 roadmap)
  • text-labels sample — demonstrates TextNode + BillboardNode in a scene
  • physics-demo sample — tap to throw objects with gravity and collisions
  • post-processing sample — Bloom, Depth of Field, SSAO, Fog

Changes

  • sceneview/node/TextNode.kt — SDF text rendering with configurable font, size, color
  • sceneview/node/BillboardNode.kt — camera-facing quad with bitmap content
  • sceneview/node/PhysicsNode.kt — rigid body wrapper with collision shapes
  • sceneview/SceneScope.kt — added TextNode(), BillboardNode(), PhysicsNode() composables
  • 3 new sample apps under samples/

Test plan

  • Build and run each sample on a physical device
  • Verify TextNode renders text correctly at various sizes
  • Verify BillboardNode always faces the camera during orbit
  • Verify PhysicsNode collisions and gravity in physics-demo
  • Verify post-processing effects (Bloom, DoF, SSAO, Fog) toggle correctly

🤖 Generated with Claude Code

ThomasGorisse and others added 3 commits March 20, 2026 20:01
Interactive demo of four Filament View post-processing effects using the
existing View parameter on Scene {}. No new SceneView API required.

Effects:
- Bloom with lens flare, starburst, chromatic aberration
- Depth of Field (physical, circle-of-confusion)
- Screen-Space Ambient Occlusion with contact shadows
- Atmospheric Fog with IBL colour sampling

Model: Damaged Helmet (CC0, KhronosGroup glTF-Sample-Assets)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a pure-Kotlin rigid-body physics prototype with no external library:

- `sceneview/…/node/PhysicsNode.kt`: `PhysicsBody` class (Euler integration,
  9.8 m/s² gravity, floor collision, restitution, sleep detection) and
  `PhysicsNode` composable that hooks into `Node.onFrame` to drive position
  each frame.
- `samples/physics-demo`: standalone sample — tap to spawn bouncing spheres
  that fall and bounce off a floor slab; up to 10 simultaneous balls.
- `settings.gradle`: register `:samples:physics-demo` module.

Build verified: `:samples:physics-demo:assembleDebug` passes clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…(3.4.0 roadmap)

- BillboardNode: ImageNode subclass that rotates to face the camera every
  frame via onFrame + lookAt(cameraPositionProvider()). Accepts bitmap,
  widthMeters/heightMeters for world-space quad sizing.

- TextNode: BillboardNode subclass that renders text into a Bitmap via
  Android Canvas (rounded-rect background + centred bold text). Reactive
  properties: text, fontSize, textColor, backgroundColor each trigger
  refreshBitmap() on change.

- SceneScope: exposes BillboardNode {} and TextNode {} composable DSL
  functions with full parameter documentation.

- samples/text-labels: 3D scene with three coloured spheres (Planet A/B/C),
  each with a floating TextNode label that always faces the orbiting camera.
  Tap a sphere to cycle its label through a set of strings.

Build verified: :samples:text-labels:assembleDebug passes clean (77/77 tasks).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant