ent_shaders
The shaders of Ent Engine, written once for every renderer. An app does not use this package directly: a renderer
package such as ent_flutter or ent_opengl compiles these shaders into its own form
when the app is built, and the app names the shader variants it draws with.
shaders/: the GLSL of the fixed shaders (vertex stages, backgrounds, environment maps, shadows, post-processing) and of the materials.ent.shaderbundle.json: the list of the fixed shaders, each with its stage and file.package:ent_shaders/ent_shaders.dart: the variant scheme, which turns a material setup such aslambert map normal_mapinto a key, and a key into a shader source with its defines.
Nothing here compiles anything: each renderer package carries its own toolchain. Both of today's renderers compile
through ent_impeller, on Impeller's shader compiler. Shaders are never compiled at runtime.
Shader variants
The app lists its variants in a registry file and names it in its pubspec.yaml, under its renderer package:
hooks:
user_defines:
ent_flutter:
shaders: ent_shaders.json
{
"variants": [
"physical ao_map metalness_map roughness_map"
]
}
An app with two renderers, one per platform, adds which renderer draws where, such as
"renderers": {"ios": "ent_flutter", "android": "ent_opengl"}; readRenderers reads it.
A key is a material kind followed by its flags; docs/shader-variants.md lists them. A renderer
throws a StateError naming the key of a draw whose variant is missing.
License
MIT, © 2026 KAMORA Ltd.; see LICENSE.
The notices of the third-party code it builds on are in THIRD_PARTY_NOTICES.md.
Libraries
- ent_shaders
- The shaders of Ent Engine, for every renderer: the variant scheme that turns the material setups an app registers
into shader sources. The GLSL is in the package's
shaders/folder, andent.shaderbundle.jsonlists the fixed shaders; a renderer package's toolchain compiles both into its own form when the app is built.