Ad

🍰 Lamina: Declarative Shader Layers for ThreeJS

Lamina is a declarative library to create materials using a system of layers. It simplifies material composition and effects stacking in ThreeJS, empowering developers to build complex visuals with ease.
Screenshot of pmndrs/lamina homepage

Lamina enables the creation of materials using a layered approach, making it easy to stack and blend effects. The project provides a declarative API for defining materials as a series of layers, each contributing to the final visual output. It leverages Three.js's custom shader materials (CSM) for rendering, providing flexibility and performance. This approach streamlines material creation, by abstracting complex fragment shader logic.

Lamina offers a declarative API for material composition, simplifying the creation of complex shader effects. It provides built-in layers such as color, depth, fresnel, and noise. The library features a debugger for visual tweaking of material parameters. Custom layers can be easily implemented, extending the core functionality.

  • Layered Material Composition: Allows stacking different visual effects.
  • Declarative API: Simplifies the creation of complex materials.
  • Built-in Layers: Provides common effects like color, depth, and noise.
  • Debugger: Easy-to-use visual debugging tool for material parameters.
  • Custom Layer Support: Enables developers to create their own effects.
  • ThreeJS Compatibility: Leverages ThreeJS custom shader materials for rendering.
  • Flexibility: Can be used with vanilla Three.js or React.

The project is currently archived. While it provides a valuable concept, the codebase contains technical debt and was deemed unreliable due to 'hacky processing'. Support is unavailable, and a rewrite is recommended. The core layers and functionality are well-defined, but the underlying implementation requires significant refactoring for maintainability and performance.

Lamina benefits developers working with Three.js who need a simple and declarative way to create advanced materials. It’s particularly valuable for those seeking to easily stack effects and experiment with visual styles. The project provides a simplified approach to complex shader material creation, offering a straightforward alternative to writing custom shaders directly.

Languages:
Summarize:
Share:
Stars
1,102
Forks
52
Issues
15
Created
4 years ago
Commit
1 year ago
License
MIT
Archived
Yes
Updated 16 days ago

Similar Repositories