Repository navigation
flutter_scene 0.23.0
·
434 commits
to master
since this release
- Build hooks no longer crash on a target OS
package:code_assetscannot name, which is how a third-party embedder announces tvOS or visionOS. - tvOS, visionOS, and watchOS select the iOS Metal shader variant, so an app on an Apple embedded platform finds its shader bundles and materials instead of looking for a target nothing builds.
- Added
package:flutter_scene/kit.dart, high-level gameplay, camera boom, character controller, day/night cycle, water surface, audio, pooling, and debug visualization components. - BREAKING: model-space front faces wind Counter-Clockwise (CCW) now, across primitives, procedural builders, materials, and
.fsceneversion 5, matching glTF and the rest of the ecosystem. Version 4 documents swap index pairs on read and version 4 containers migrate at realization, so assets need no action, but hand-authored index buffers and customGeometrysubclasses wind the other way and need their triangles swapped. - World-space global illumination via
Scene.globalIllumination, a grid of octahedral irradiance probes fed by scattering the visible surfaces' shaded radiance, so bounce light persists for geometry the camera is not looking at and colored bleed reads correctly. Off by default. - Probe visibility via
GlobalIlluminationSettings.visibility, per-direction depth moments and a Chebyshev bound so the field does not leak through walls. - Emissive surfaces light the probe field, scaled by
GlobalIlluminationSettings.emissiveGiBoostso a small bright emitter can light a room without brightening the direct image. - Offline and progressive irradiance field baking via
Scene.bakeIrradianceFieldandIrradianceFieldBakeStepper. IrradianceVolumeComponentplaces the irradiance volume on a node, for authored placement instead of fitting the scene or following the camera.Scene.invalidateGlobalIlluminationdiscards the accumulated field so it refills from scratch after a hard camera cut.- The lit shaders read the environment's diffuse coefficients with
texelFetchfrom a texture the probe atlas extends, so global illumination costs no additional fragment sampler. - Add the
flutter_scene-kitagent skill, covering the gameplay, camera rig, character controller, day/night, water, audio, pooling, and debug components inkit.dart. - Update
flutter_scene-idiomsskill (v4) with the reflection probes and lens flares the engine gained, and the traps that came with them. - Update
flutter_scene-performanceskill (v2) with SMAA's cost next to FXAA and the per-frame reflection-probe recapture trap. - Update
flutter_scene-proceduralskill (v2) with natural formation recipes (rock fractures, incised trails, pebble scatter, Gerstner waves, tree branching, and procedural island topographies). - Update
flutter_scene-looksskill (v4) with micro-surface and anti-waxiness tuning guidance. - Update
flutter_scene-verification-loopskill (v2) with empirical verification disciplines and blind-pairwise review rules. - Temporal anti-aliasing via
AntiAliasingMode.taaandScene.temporalAntiAliasing, reprojecting history with camera subpixel jittering, motion vectors for unskinned and skinned geometry, and variance-guided history clamping. - Geometric specular anti-aliasing adapts specular roughness based on screen-space normal derivatives to suppress high-frequency specular shimmer on subpixel geometry and grazing angles;
Material.specularAaThresholdconfigures the threshold. DirectionalShadowFilter.bilinearPcfcontinuous 2x2 bilinear percentage-closer filtering.CameraProjection.getProjectionMatrixadds an optional namedjitterparameter for temporal subpixel sampling.- Direct lighting modulates specular and clearcoat terms with
sun_visibility. - Added
ExternalTexture, aTextureSourcefed by a platform texture id (video, camera preview) with optionalcolorFilter, captured through the compositor on frames that sample it. - Generated scene registries are cached per asset bundle.
.fscenebpayload chunks compress with gzip, cutting file sizes by ~73% in exchange for higher load-time decompression CPU.- Static render items skip per-frame property re-assignment when their transform and bounds are unchanged.
- Instanced mesh static shadow updates track component visibility changes correctly.
- Widget-surface pointer forwarding dispatches events in the framework's global space (with the host's transform in the hit path), so widgets that convert
globalPositionthrough render objects (Slider, text selection) work when the scene view is not at the window origin. - The standard PBR shader ships a no-shadow variant, selected automatically for draws with no shadow atlas bound, roughly halving the compiled fragment program for shadow-less scenes on mobile GPUs; it also skips its five per-texture UV-transform evaluations when every transform is identity.
PhysicallyBasedMaterialkeeps a scalarior,specular, andspecularColoron the standard shader by folding them into its dielectric reflectance (theKHR_materials_ior/KHR_materials_specularformula the physical shader uses), so only specular textures and the layered features select the heavier physical variant.- The model scale is no longer interpolated per fragment (
v_model_scaleleft the vertex output interface, cutting varying bandwidth on tiler GPUs); lit materials read it fromFragInfo.model_scalethrough the unchangedGetModelScale()accessor, now carrying the node's scale rather than per-instance or per-joint scale, and a rawShaderMaterialpair that needs it passes its own varying computed from the model transform. - glTF import validates
extensionsRequiredand surfaces warnings through anonWarningcallback on every entry point. - Sparse glTF accessors apply, including the zero-filled base for an absent
bufferView. KHR_draco_mesh_compressiondecodes in pure Dart on every platform.EXT_meshopt_compressiondecodes in pure Dart;KHR_mesh_quantizationis recognized alongside it.- Standard KTX2 textures (
KHR_texture_basisu) load on both import paths, transcoded in pure Dart. - The runtime importer accepts multi-buffer
.gltfdocuments and percent-decodes resource URIs. MeshPrimitive.visibleandMeshPrimitive.castsShadowtoggle one primitive's color and shadow passes independently.MaterialParametersgains typed getters,hasParameter,isParameterAssigned, and parameter enumeration.- Light channels,
channelMaskon lights andNode.lightChannelMaskrestrict what a light illuminates;DirectionalLight.shadowCasterChannelMaskfilters shadow casters independently. DirectionalLight.firstCascadeFarBoundpins the first cascade split;cascadeOverlapcross-fades cascade hand-offs.ShadowCatcherMaterial, an invisible ground showing only received shadows and ambient occlusion, live by default with a baked mode.- Morph targets import on both paths, animate via
weightschannels, and blend on the CPU or a GPU morph texture;Node.morphWeightsdrives them. EnvironmentMap.fromKtx2Bytesloads a pre-baked radiance cubemap with SH-9 diffuse, skipping the load-time prefilter.EXT_lights_image_basedimports as anImageBasedLightComponenton the model root.- SH-9 diffuse helpers,
parseDiffuseShSidecar/encodeDiffuseShSidecar,evaluateDiffuseSphericalHarmonics, anddescribeDiffuseSphericalHarmonicsfor verifying imported coefficients. PhysicallyBasedMaterial.lightmapTextureadds a baked lightmap that replaces the SH diffuse ambient..fmatinstance_attributesdeclare typed per-instance data, set viaInstancedMesh.setInstanceAttribute.- A raw
ShaderMaterialdeclares the same per-instance data throughShaderInstanceAttribute, so a custom vertex shader reads theinstance_<name>inputs a.fmatwould have generated. PlanarReflectorComponentrenders a mirrored scene capture that.fmatmaterials sample via theplanar_reflectionengine input.ShaderMaterial.sceneInputsdeclares the engine's per-frame scene textures, so a raw shader can refract and measure its own thickness like a.fmatmaterial. Include<scene_inputs.glsl>for the samplers and their accessors;buildTargetShaderBundleJsonputs flutter_scene'sshaders/on the include path so it resolves with no setup.- Parallax-corrected reflection probes via
ReflectionProbeComponent, capturing the scene into a local environment whose reflections track the probe's box. Scene.captureEnvironmentrenders the scene's lighting at a point into a newEnvironmentMap.- SMAA anti-aliasing via
AntiAliasingMode.smaa, cleaner edges than FXAA with far less texture blurring. - Lens flares via
BloomSettings.lensFlare, ghost chains and a halo with chromatic dispersion off the bloom pyramid. - Bloom now spreads a consistent fraction of the screen across device pixel ratios, so bloom and lens flares no longer tighten on high-DPI displays; its passes also stop relying on reloaded attachments, matching every backend.
- Clearcoat now responds to rect area lights.
- Screen-space indirect light reprojects its radiance history, so the bounce stays put under camera motion.