flutter3d_build_hooks 1.0.0-rc.2
flutter3d_build_hooks: ^1.0.0-rc.2 copied to clipboard
What a package's build hook needs to compile its flutter3d materials into shader bundles, with no converters, servers or Flutter behind it.
1.0.0-rc.2 #
Since the 2026-10-14 upload, a plugin's material compiles in its
namespace. compileMaterial(namespace:) names the stages
<namespace>__<Name> so a plugin's lighting model finds them, and
materialMemberName is the one naming scheme for generated material
code. Nothing that went up on 2026-10-14 broke.
-
A material lit by the standard model compiles with its debug twin.
compileMaterialwrites<name>Debugbeside the material's stage, the same source withF3D_DEBUG_VIEWS, so the stage it draws every frame carries no debug view and a frame with one on still shows it. -
New:
materialMemberName, the one naming scheme for generated material code. A uniform's accessor is named as the source declares it, withValueafter a name Dart, the accessor or a typed uniform block already has;flutter3d_build's typed uniform blocks name their fields with it too.name,members,layout,stageand the rest of Dart's reserved words join the names that takeValue. -
compileMaterial(namespace:)compiles a plugin's material in its namespace. The bare name the source writes (material Hair) is the stage<namespace>__Hair(materialStageIn), every stage and the source the bundle carries renamed to match, so the plugin's lighting model finds it; a name in another plugin's namespace is refused. -
A material over the binding budget does not build, on any backend. Each stage is counted from its GLSL before the sections are written, where only the WebGPU section counted, and only with glslang and naga installed.
-
Breaking: a generated material accessor is over a
MaterialParameters, the shapeRenderMaterial.parametershas, and itsdefaults()answers one. Avec3orvec4uniform whose name says it is a colour says in its doc that the vector is the linear buffer the shader reads. -
A material build asks the backends' own compilers.
MaterialCompilers.registry(andMaterialCompilers.locate(registry:)) holds aMaterialCompilerRegistry;compileMaterialhands each compiler the stages as GLSL, the engine's headers and the WebGPU stages it wrote, and puts its section in the bundle. A compiler whose section the build writes with a tool of its own (isSectionWrittenByBuild, Impeller's) and that refuses leaves the build's section; any other refusal fails the build. Without glslang and naga WebGPU's compiler is not asked, and the bundle goes without its section, as it does with no registry. -
Stages that disagree fail the build as a
MaterialBuildExceptionnaming the source, where aStageAgreementExceptionfrom a section writer used to escape as itself. -
A material's own blocks and textures are numbered after the engine's in its WebGPU section, in its slot table's order.
-
Depends on
flutter3d_foundationinstead of the plugin API, for the exception familyMaterialBuildExceptionis of. -
New: the material compiler a build hook needs, on its own.
compileMaterial,MaterialCompilers,MaterialBuildExceptionandgenerateMaterialAccessorsmoved here fromflutter3d_build, which still exports them under the same names. A package that compiles its own materials in its build hook, asflutter3d_effectsdoes, depends on this and no longer resolvesflutter3d_build's converters, MCP servers anddart_mcpinto every game that depends on it.