Shader assets are normal project assets:
- shader assets are real project assets
- materials can reference shader assets
- the editor validates shader assets in the Inspector
- runtime and editor previews use the same shader asset path
Surface3D Shader Shape
Custom Surface3D shader assets use:
Domain = Surface3DSurface Mode = Unlit- one vertex source file
- one fragment source file
This workflow is ideal for:
- stylized unlit materials
- banding
- gradients
- contouring
- texture-driven looks
- simple material-specific surface effects
Create The Shader Asset
- In the Assets panel, create a new
Shaderasset. - Select it in the Inspector.
- Keep
Domainset toSurface3D. - Keep
Surface Modeset toUnlit. - Assign:
Vertex SourceFragment Source
When you create a shader asset through the editor, Lenga also creates starter
.vert and .frag files beside it so the asset is immediately usable.
Assign The Shader To A Material
- Create or select a
Materialasset. - In the material Inspector, set
Shader Asset. - Assign that material to a built-in 3D renderer such as:
CubeRendererSphereRendererCylinderRendererPlaneRendererMeshRendererModelRenderer
The material still keeps its built-in Shader field as a fallback path. If the
custom shader asset is invalid or unsupported, Lenga falls back to the built-in
material mode instead of leaving the renderer in a broken state.
Validation And Errors
The editor validates:
- shader asset structure
- supported domain
- supported surface mode
- missing vertex source
- missing fragment source
- compile failures
That validation shows up directly in the Inspector, which makes it much easier to iterate without guessing whether the problem is in the asset, the source file, or the material reference.
Sample To Inspect
The RollerWorld sample includes a working example:
Assets/Shaders/PickupBands.shader.jsonAssets/Shaders/PickupBands.vertAssets/Shaders/PickupBands.fragAssets/Materials/Pickup.material.json
The pickup objects in the sample scenes use that material, so it is a practical
reference for the supported Surface3D shader shape.
Limits In This Milestone
This is a strong first foundation, but it is intentionally not everything yet.
Not in scope yet:
- visual shader graph authoring
- custom lit forward shaders
- sky shader assets
- post-process shader assets
- UI shader assets
- 2D shader assets
Those are planned follow-up layers. The goal here is a correct, maintainable, real shader-asset workflow that the rest of Lenga can build on.