A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(render): the motion pass follows skinned meshes by the palette their bones were last drawn with
yhh1600b20a3725
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0b5a0ddb8..b2132d621 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -22,7 +22,7 @@ published separately; it ships inside the editor.- **Auto Exposure and Depth of Field.** Auto Exposure and Depth of Field post-process effects are available. `autoExposure` measures the average log luminance of the picture (leaving out pixels darker than 2^-8, so a black backdrop does not open the exposure to its limit), turns it into the exposure that puts it at middle grey, and moves toward that over time from where the last frame left it — brighter faster than darker, per second, within `minEV` and `maxEV`, with a `bias` in stops. To keep the settled value between frames a post-process shader can now declare a `u_feedback` texture: the engine keeps that pass's last output, at the pass's own size, and binds it there, without shifting the picture the way `u_history` does. `depthOfField` blurs by distance from `focusDistance`, with a sharp slab of `focusRange`, a blur radius that grows with how far a surface is from focus up to `maxBlur`, and a gather that counts a neighbour only where its own blur reaches back, so a sharp object does not bleed into a blurred background. Verified in the editor on both backends: a dim scene brightens (mean 6.9 to 16.5) and a bright one darkens (30.7 to 20.4), a drop in light is first dark and then recovered over real time (5.2 then 15.8), and focusing close takes the squared edge energy down to 21% of the sharp frame.- **Height Fog and Light Shafts.** Height Fog and Light Shafts post-process effects add atmosphere. `heightFog` is exponential height fog with a closed-form integral — no marching — so a valley fills and a hilltop clears, the horizon turns hazy while the zenith stays clear, and looking toward the sun the haze takes the sun's colour; sky pixels run through the same formula with a very long ray, and `skyFog` sets how much haze the sky keeps. `lightShafts` marches each pixel toward the sun's place on screen and counts how much of the way is open sky, leaving rays through whatever stands in front of the sun. The sun's direction is set on the effects (azimuth and elevation), not read from a light. Neither is a shadowed volume: fog is lit evenly. Both run on WebGL2 and WebGPU; with an output transform of None, a floor fully taken by the fog reads exactly the authored colour on both.- **Screen Space Reflections.** A Screen Space Reflections post-process effect mirrors props in floors. Add `ssr` to a `PostProcessVolume`: with no G-buffer, the surface normal is rebuilt from the depth buffer, the reflected ray is marched through the world and projected back to the screen at every step, and a step landing just behind the visible surface is a hit, refined by bisection. The reflection is blended over the pixel by a Schlick Fresnel term — faint face-on, strong at a grazing angle — and blurred by how far the ray travelled, which stands in for roughness. `intensity`, `maxDistance`, `thickness` and `floorBias` are the settings; `floorBias` at 1 lets only up-facing surfaces reflect, since the chain does not know a material's roughness. What is off screen or in the sky is not reflected; the pixel is left as it was. It reads the same depth buffer as ambient occlusion, runs on WebGL2 and WebGPU alike, and its per-pixel start offset is meant to be averaged away by `taa`. Verified in the editor on a lit scene with both backends: the props appear in the floor they stand on and nothing else on screen changes.-- **Temporal Anti-Aliasing.** A Temporal Anti-Aliasing post-process effect smooths edges across frames. Add `taa` to a `PostProcessVolume` and the engine shifts the scene's picture by a different sub-pixel amount each frame (eight positions, repeating), keeps the effect's last output as its history, and blends the two — reaching what multisampling cannot: shader aliasing and thin geometry. Where a pixel was last frame comes from the depth buffer and the previous camera, so a moving camera keeps its history; the history is clipped to the colours around it, so what no longer matches is dropped rather than smeared, and each camera keeps a history of its own. One `blend` setting says how much of each frame is new. Measured in the editor on a lit scene with multisampling off, in-between edge pixels went from 2% of edge pixels to 43% on WebGL2 and 44% on WebGPU, still frames held still, and a picture taken mid-slide of the camera matched the plain one to within a fraction of a level. Objects that move by themselves are not tracked — they are handled by the clip, so fast movers can look slightly soft. Temporal Anti-Aliasing now follows meshes that move by themselves, from a motion pass that draws only what moved, so a thin fast object keeps its contrast. Moving meshes are drawn a second time into a target of their own that records how far each pixel travelled (an RGBA32F target, only on devices with float render targets), and the effect follows that where it is the surface the scene shows; `Object Motion` at 0 trusts the camera alone. Skinned meshes are not followed yet.+- **Temporal Anti-Aliasing.** A Temporal Anti-Aliasing post-process effect smooths edges across frames. Add `taa` to a `PostProcessVolume` and the engine shifts the scene's picture by a different sub-pixel amount each frame (eight positions, repeating), keeps the effect's last output as its history, and blends the two — reaching what multisampling cannot: shader aliasing and thin geometry. Where a pixel was last frame comes from the depth buffer and the previous camera, so a moving camera keeps its history; the history is clipped to the colours around it, so what no longer matches is dropped rather than smeared, and each camera keeps a history of its own. One `blend` setting says how much of each frame is new. Measured in the editor on a lit scene with multisampling off, in-between edge pixels went from 2% of edge pixels to 43% on WebGL2 and 44% on WebGPU, still frames held still, and a picture taken mid-slide of the camera matched the plain one to within a fraction of a level. Objects that move by themselves are not tracked — they are handled by the clip, so fast movers can look slightly soft. Temporal Anti-Aliasing now follows meshes that move by themselves, from a motion pass that draws only what moved, so a thin fast object keeps its contrast. Moving meshes are drawn a second time into a target of their own that records how far each pixel travelled (an RGBA32F target, only on devices with float render targets), and the effect follows that where it is the surface the scene shows; `Object Motion` at 0 trusts the camera alone. Skinned meshes are followed by their bones, from the palette they were last drawn with.- **Smaller meshes on disk.** Newly imported meshes are about 9% smaller on disk. A mesh whose indices all fit in 16 bits is now written with 16-bit indices (`.esmesh` version 4), half the index bytes, and read back as 32-bit so nothing downstream changes: the renderer, the lightmap and decal bakers and static batching see the same indices as before. A mesh that needs 32 bits is written exactly as before, on the version every earlier reader knows, and files written before this change still load. Measured on the Bistro meshes (1143 files, 116 MB), re-encoding saves 10.4 MB; existing `.esmesh` files are not rewritten until the model is re-imported.- **Levels of detail generated at import.** Imported models can generate cheaper levels of detail automatically. Set **Generate LODs** to 1–3 levels in a model's import settings (or pass `--lods <n>` to `import-model`) and each mesh is collapsed into copies with about 50%, 20% and 7% of its triangles, written as `<mesh>_lod<n>.esmesh`, with a `LODGroup` on the entity that swaps them in as it shrinks on screen. The collapse bounds how far the surface may move and will not pull apart a UV seam or a hard edge; vertex colours and the lightmap UV come along unchanged. Skinned and morphing meshes, and meshes under a minimum triangle count, keep one level. Measured on the Bistro exterior (1143 meshes, 2.83M triangles), the 621 meshes large enough to get levels hold 1.35M, 0.44M and 0.10M triangles at levels 1, 2 and 3; the levels are extra files, so they make a large scene cheaper to draw rather than smaller to ship.- **Steadier highlights on curved and bevelled surfaces.** Lit models no longer sparkle on rails, bevels and rounded trim. Where a surface's normal turns faster than a pixel can resolve, the highlight is the sum of many normals the pixel cannot tell apart, and shading it with one made it flicker as the camera moved. The Model shader now widens a highlight by how fast the vertex normal turns across the pixel — a steady, slightly rougher highlight in place of a flickering sharp one — on WebGL2 and WebGPU alike. Measured on a street scene shifted by sub-pixel steps, frame-to-frame shimmer on rails and lamp trim fell by about 5–8%; a surface that is flat or smooth is not touched.diff --git a/desktop b/desktopindex 9c0b54685..1b9187b1b 160000--- a/desktop+++ b/desktop@@ -1 +1 @@-Subproject commit 9c0b54685410de9175fac2a6f26b1de3482ce3cd+Subproject commit 1b9187b1b90ee1e20fb22bf0c2492f5876b94c34diff --git a/docs/astro/src/content/docs/graphics/post-processing.mdx b/docs/astro/src/content/docs/graphics/post-processing.mdxindex 08a2decfa..b72a05574 100644--- a/docs/astro/src/content/docs/graphics/post-processing.mdx+++ b/docs/astro/src/content/docs/graphics/post-processing.mdx@@ -168,10 +168,10 @@ surface the scene shows. This is why a thin, fast mover keeps its contrast instefading into the floor behind it. It costs one extra draw of only what moved (nothing,for a frame where nothing did) and an RGBA32F target the size of the scene, so it needsfloat render targets, and is skipped on a device without them. `objectMotion` at 0-turns it off, which leaves the camera's answer alone. What it does not follow yet is a-skinned mesh, whose bones are not remembered from last frame, a blended surface, and-motion a material's vertex hook adds — those fall back to the camera's answer, clipped-into the colours around the pixel. TAA needs scene depth like SSAO does, so on WebGPU+turns it off, which leaves the camera's answer alone. A skinned mesh is followed by its+bones: the frame remembers the palette each one was drawn with last time. What it does not+follow is a blended surface and motion a material's vertex hook adds — those fall back to+the camera's answer, clipped into the colours around the pixel. TAA needs scene depth like SSAO does, so on WebGPUit cannot run with multisampling on a scene that has no depth resolve.The uniform names above are the friendly labels; **in code they are `u_`-prefixed**diff --git a/docs/astro/src/content/docs/zh-cn/graphics/post-processing.mdx b/docs/astro/src/content/docs/zh-cn/graphics/post-processing.mdxindex 211a9095e..2cf1a3b55 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/post-processing.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/post-processing.mdx@@ -125,8 +125,8 @@ Estella 通过 ping-pong 帧缓冲运行全屏后处理。加一个 `PostProcess**移动的网格再画一遍**到它自己的目标里,写下每个像素自上一帧走了多远;在那里就是场景所显示的表面时,效果改用这个位移。所以又细又快的移动物体会保住对比度,而不是淡进身后的地面。它只多画一遍真正动了的东西(一帧里没有物体动就什么都不画),外加一个和场景同尺寸的 RGBA32F 目标,因此需要浮点渲染目标,-没有的设备会跳过。`objectMotion` 设为 0 就关掉它,只剩相机的答案。目前还不跟随的有:蒙皮网格-(上一帧的骨骼没有保存)、混合表面,以及材质顶点钩子加上的运动——它们退回相机的答案,并被夹进像素周围+没有的设备会跳过。`objectMotion` 设为 0 就关掉它,只剩相机的答案。蒙皮网格按骨骼跟随:这一帧会记住每个+骨骼上一次画时的姿态。不跟随的有混合表面,以及材质顶点钩子加上的运动——它们退回相机的答案,并被夹进像素周围的颜色里。TAA 和 SSAO 一样要读场景深度,因此在 WebGPU 上,没有深度解析的多重采样场景里无法运行。上面是友好标签;**在代码里它们带 `u_` 前缀**(`u_intensity`、`u_exposure`……)。多数效果diff --git a/src/esengine/data/shaders/mesh.esshader b/src/esengine/data/shaders/mesh.esshaderindex 0860a3f7b..7aa97013f 100644--- a/src/esengine/data/shaders/mesh.esshader+++ b/src/esengine/data/shaders/mesh.esshader@@ -153,6 +153,18 @@ out highp vec4 v_velPrev;@@ES_VERTEX_HOOK@@#endif+#if defined(ES_VELOCITY) && defined(SKINNED)+// Last frame's pose of one bone, from the records behind this draw's own: three rows a bone, from texel 8.+highp mat4 esPrevBone(uint joint) {+ int at = 8 + int(joint) * 3;+ highp vec4 r0 = esInstanceTexel(at);+ highp vec4 r1 = esInstanceTexel(at + 1);+ highp vec4 r2 = esInstanceTexel(at + 2);+ return mat4(vec4(r0.x, r1.x, r2.x, 0.0), vec4(r0.y, r1.y, r2.y, 0.0),+ vec4(r0.z, r1.z, r2.z, 0.0), vec4(r0.w, r1.w, r2.w, 1.0));+}+#endif+void main() {vec3 local = a_position;#ifdef MESH_NORMALS@@ -200,7 +212,14 @@ void main() {{// This record is the motion pass's own: the tint texel carries the shift LAST frame was drawn with, and// the four texels after the model are last frame's view-projection times last frame's model, as rows.+#ifdef SKINNED+ // Last frame's bones put the vertex where it WAS; the record's rows are then last frame's camera alone.+ highp mat4 prevSkin = a_weights.x * esPrevBone(a_joints.x) + a_weights.y * esPrevBone(a_joints.y)+ + a_weights.z * esPrevBone(a_joints.z) + a_weights.w * esPrevBone(a_joints.w);+ highp vec4 L = prevSkin * vec4(local, 1.0);+#elsehighp vec4 L = vec4(local, 1.0);+#endifhighp vec4 before = esInstanceTint();v_velCur = gl_Position;highp vec4 prev = vec4(dot(esInstanceTexel(4), L), dot(esInstanceTexel(5), L),@@ -378,6 +397,20 @@ struct VSOut {@@ES_VERTEX_HOOK@@#endif+#ifdef ES_VELOCITY+#ifdef SKINNED+// Last frame's pose of one bone, from the records behind this draw's own: three rows a bone, from texel 8.+fn esPrevBone(joint : u32) -> mat4x4f {+ let at = 8 + i32(joint) * 3;+ let r0 = esInstanceTexel(at);+ let r1 = esInstanceTexel(at + 1);+ let r2 = esInstanceTexel(at + 2);+ return mat4x4f(vec4f(r0.x, r1.x, r2.x, 0.0), vec4f(r0.y, r1.y, r2.y, 0.0),+ vec4f(r0.z, r1.z, r2.z, 0.0), vec4f(r0.w, r1.w, r2.w, 1.0));+}+#endif+#endif+@vertex fn vs_main(v : VSIn, @builtin(instance_index) inst : u32) -> VSOut {g_instanceId = i32(inst);var local = v.a_position;@@ -438,7 +471,14 @@ struct VSOut {#ifdef ES_VELOCITY{// See the GLSL twin: the tint texel is last frame's shift, texels 4..7 last frame's matrix as rows.+#ifdef SKINNED+ // See the GLSL twin: last frame's bones place the vertex, the record's rows are the camera alone.+ let prevSkin = v.a_weights.x * esPrevBone(v.a_joints.x) + v.a_weights.y * esPrevBone(v.a_joints.y)+ + v.a_weights.z * esPrevBone(v.a_joints.z) + v.a_weights.w * esPrevBone(v.a_joints.w);+ let L = prevSkin * vec4f(local, 1.0);+#elselet L = vec4f(local, 1.0);+#endiflet before = esInstanceTint();out.v_velCur = out.pos;let prev = vec4f(dot(esInstanceTexel(4), L), dot(esInstanceTexel(5), L),diff --git a/src/esengine/renderer/plugins/MeshPlugin.cpp b/src/esengine/renderer/plugins/MeshPlugin.cppindex 2c2ec54c0..cf9ff458f 100644--- a/src/esengine/renderer/plugins/MeshPlugin.cpp+++ b/src/esengine/renderer/plugins/MeshPlugin.cpp@@ -516,13 +516,23 @@ RenderPrewarmResult MeshPlugin::prewarm(RenderFrameContext& ctx, ecs::Registry&anyResident);}-void MeshPlugin::trackPose(const RenderFrameContext& ctx, Entity entity, const glm::mat4& model) {+void MeshPlugin::trackPose(const RenderFrameContext& ctx, Entity entity, const glm::mat4& model,+ const std::vector<glm::mat4>* bones) {Pose& pose = poses_[poseKey(ctx, entity)];// Last frame's, when the view drew this mesh last frame; otherwise it has no past worth following, and// standing where it stands says "did not move".- if (pose.frame != 0 && pose.frame + 1 == ctx.motion_frame) pose.previous = pose.current;- else if (pose.frame != ctx.motion_frame) pose.previous = model;+ const bool continued = pose.frame != 0 && pose.frame + 1 == ctx.motion_frame;+ if (continued) {+ pose.previous = pose.current;+ pose.bonesPrevious = pose.bonesCurrent;+ } else if (pose.frame != ctx.motion_frame) {+ pose.previous = model;+ if (bones) pose.bonesPrevious = *bones;+ else pose.bonesPrevious.clear();+ }pose.current = model;+ if (bones) pose.bonesCurrent = *bones;+ else pose.bonesCurrent.clear();pose.frame = ctx.motion_frame;}@@ -690,13 +700,15 @@ void MeshPlugin::collect(RenderCollectContext& collect_ctx) {// means the camera's own motion says it all and the temporal pass already has that.const auto pose = poses_.find(poseKey(ctx, entity));if (pose == poses_.end() || pose->second.frame != ctx.motion_frame- || pose->second.previous == pose->second.current) {+ || (pose->second.previous == pose->second.current+ && pose->second.bonesPrevious == pose->second.bonesCurrent)) {continue;}const MeshProgramFacts facts =meshFactsFromEntity(ctx, registry, entity, mesh, resident, warned_bones_);- if (facts.skinned) continue;- keys = { meshVariant(facts.hasNormals, false, false, false, false, false, false, false, false, true), 0 };+ // A palette of a different size than last frame's has no joint-for-joint past to follow.+ if (facts.skinned && pose->second.bonesPrevious.size() != pose->second.bonesCurrent.size()) continue;+ keys = { meshVariant(facts.hasNormals, false, false, facts.skinned, false, false, false, false, false, true), 0 };} else {keys = meshDrawFor(ctx, registry, entity, mesh, resident, shadowDepth, warned_bones_, heated);}@@ -789,13 +801,16 @@ void MeshPlugin::collect(RenderCollectContext& collect_ctx) {// the record is read through that layout, so the fact that built// it must pack it. (It already excludes a skinned mesh.)const bool lightmapped = resident->hasLightmapUV && !motion;+ // A skinned motion draw carries last frame's palette in the records right behind its own: three+ // texels a bone from texel 8 on, which the shader reaches by index like any other texel.+ const u32 paletteRecords = motion && skinned ? (3 * poseSize + MESH_INSTANCE_TEXELS - 1) / MESH_INSTANCE_TEXELS : 0;u32 instOffset = buffers.allocVertices(LayoutId::MeshInstance,- MESH_INSTANCE_STRIDE);+ MESH_INSTANCE_STRIDE * (1 + paletteRecords));auto* dst = buffers.vertexData(LayoutId::MeshInstance) + instOffset;// The record is one fixed shape, so every texel this variant// does not write still has to say something. Zero is the answer// each of them reads as absent.- std::memset(dst, 0, MESH_INSTANCE_STRIDE);+ std::memset(dst, 0, MESH_INSTANCE_STRIDE * (1 + paletteRecords));// The shapes, whether or not bones move it: the two deform the// same vertices, and a morph target is what the mesh is BEFORE a// pose is applied to it.@@ -847,15 +862,30 @@ void MeshPlugin::collect(RenderCollectContext& collect_ctx) {const Pose& pose = poses_.find(poseKey(ctx, entity))->second;const glm::vec4 jitter{ctx.motion_prev_jitter, 0.0f, 0.0f};std::memcpy(dst + MESH_INSTANCE_TEXEL_TINT * 16, &jitter, 16);- const glm::mat4 before = ctx.motion_prev_view_projection * pose.previous;+ // A rigid mesh's last place is its last model, so the matrix is the two together; a skinned+ // one is placed by its bones, which the shader applies first, so only the camera goes here.+ const glm::mat4 before = skinned ? ctx.motion_prev_view_projection+ : ctx.motion_prev_view_projection * pose.previous;for (u32 row = 0; row < 4; ++row) {const glm::vec4 r{before[0][row], before[1][row], before[2][row], before[3][row]};std::memcpy(dst + (MESH_INSTANCE_TEXEL_NORMAL + row) * 16, &r, 16);}+ if (skinned) {+ for (u32 bone = 0; bone < poseSize; ++bone) {+ const glm::mat4& m = pose.bonesPrevious[bone];+ for (u32 row = 0; row < 3; ++row) {+ const glm::vec4 r{m[0][row], m[1][row], m[2][row], m[3][row]};+ std::memcpy(dst + (MESH_INSTANCE_TEXELS + bone * 3 + row) * 16, &r, 16);+ }+ }+ }} else if (ctx.track_motion && !shadowDepth) {- trackPose(ctx, entity, glm::translate(glm::mat4(1.0f), position)- * glm::mat4_cast(rotation)- * glm::scale(glm::mat4(1.0f), scale));+ trackPose(ctx, entity,+ skinned ? glm::mat4(1.0f)+ : glm::translate(glm::mat4(1.0f), position)+ * glm::mat4_cast(rotation)+ * glm::scale(glm::mat4(1.0f), scale),+ skinned ? &pose_scratch_ : nullptr);}// A draw reading its own atlas does not ask for IRRADIANCE, and asksdiff --git a/src/esengine/renderer/plugins/MeshPlugin.hpp b/src/esengine/renderer/plugins/MeshPlugin.hppindex 7ce5817cd..684d5b686 100644--- a/src/esengine/renderer/plugins/MeshPlugin.hpp+++ b/src/esengine/renderer/plugins/MeshPlugin.hpp@@ -61,10 +61,15 @@ private:struct Pose {glm::mat4 previous{1.0f};glm::mat4 current{1.0f};+ /// A skinned mesh's bones are world-space and the entity's own transform says nothing about it, so what+ /// moved is the palette: the one it was drawn with last time and the one it is drawn with now.+ std::vector<glm::mat4> bonesPrevious;+ std::vector<glm::mat4> bonesCurrent;u64 frame = 0;};std::unordered_map<u64, Pose> poses_;- void trackPose(const RenderFrameContext& ctx, Entity entity, const glm::mat4& model);+ void trackPose(const RenderFrameContext& ctx, Entity entity, const glm::mat4& model,+ const std::vector<glm::mat4>* bones = nullptr);static u64 poseKey(const RenderFrameContext& ctx, Entity entity) {return ctx.motion_key * 0x9E3779B97F4A7C15ull ^ static_cast<u64>(entity.id());}diff --git a/src/esengine/renderer/rhi/ShaderEmbeds.generated.hpp b/src/esengine/renderer/rhi/ShaderEmbeds.generated.hppindex 3c826901e..fedadc6c1 100644--- a/src/esengine/renderer/rhi/ShaderEmbeds.generated.hpp+++ b/src/esengine/renderer/rhi/ShaderEmbeds.generated.hpp@@ -523,6 +523,18 @@ out highp vec4 v_velPrev;@@ES_VERTEX_HOOK@@#endif+#if defined(ES_VELOCITY) && defined(SKINNED)++highp mat4 esPrevBone(uint joint) {+ int at = 8 + int(joint) * 3;+ highp vec4 r0 = esInstanceTexel(at);+ highp vec4 r1 = esInstanceTexel(at + 1);+ highp vec4 r2 = esInstanceTexel(at + 2);+ return mat4(vec4(r0.x, r1.x, r2.x, 0.0), vec4(r0.y, r1.y, r2.y, 0.0),+ vec4(r0.z, r1.z, r2.z, 0.0), vec4(r0.w, r1.w, r2.w, 1.0));+}+#endif+void main() {vec3 local = a_position;#ifdef MESH_NORMALS@@ -570,7 +582,14 @@ void main() {{+#ifdef SKINNED++ highp mat4 prevSkin = a_weights.x * esPrevBone(a_joints.x) + a_weights.y * esPrevBone(a_joints.y)+ + a_weights.z * esPrevBone(a_joints.z) + a_weights.w * esPrevBone(a_joints.w);+ highp vec4 L = prevSkin * vec4(local, 1.0);+#elsehighp vec4 L = vec4(local, 1.0);+#endifhighp vec4 before = esInstanceTint();v_velCur = gl_Position;highp vec4 prev = vec4(dot(esInstanceTexel(4), L), dot(esInstanceTexel(5), L),@@ -748,6 +767,20 @@ struct VSOut {@@ES_VERTEX_HOOK@@#endif+#ifdef ES_VELOCITY+#ifdef SKINNED++fn esPrevBone(joint : u32) -> mat4x4f {+ let at = 8 + i32(joint) * 3;+ let r0 = esInstanceTexel(at);+ let r1 = esInstanceTexel(at + 1);+ let r2 = esInstanceTexel(at + 2);+ return mat4x4f(vec4f(r0.x, r1.x, r2.x, 0.0), vec4f(r0.y, r1.y, r2.y, 0.0),+ vec4f(r0.z, r1.z, r2.z, 0.0), vec4f(r0.w, r1.w, r2.w, 1.0));+}+#endif+#endif+@vertex fn vs_main(v : VSIn, @builtin(instance_index) inst : u32) -> VSOut {g_instanceId = i32(inst);var local = v.a_position;@@ -808,7 +841,14 @@ struct VSOut {#ifdef ES_VELOCITY{+#ifdef SKINNED++ let prevSkin = v.a_weights.x * esPrevBone(v.a_joints.x) + v.a_weights.y * esPrevBone(v.a_joints.y)+ + v.a_weights.z * esPrevBone(v.a_joints.z) + v.a_weights.w * esPrevBone(v.a_joints.w);+ let L = prevSkin * vec4f(local, 1.0);+#elselet L = vec4f(local, 1.0);+#endiflet before = esInstanceTint();out.v_velCur = out.pos;let prev = vec4f(dot(esInstanceTexel(4), L), dot(esInstanceTexel(5), L),diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex 31c1f4f61..a09df8625 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -2489,6 +2489,8 @@ export const NOTED = {{"note":"Reflections now know how rough and how metal each surface is, from a G-buffer the frame draws on request."},"feat(render): Temporal Anti-Aliasing follows meshes that move by themselves, from a motion pass that draws only what moved":{"note":"Temporal Anti-Aliasing now follows meshes that move by themselves, from a motion pass that draws only what moved, so a thin fast object keeps its contrast."},+ "feat(render): the motion pass follows skinned meshes by the palette their bones were last drawn with":+ {"note":"Skinned meshes are followed by their bones, from the palette they were last drawn with."},"feat(render): reflections no longer guess a surface, plain meshes record themselves, and what the ray never finds is the sky":{"note":"Screen-space reflections leave a surface that recorded nothing alone, plain meshes now record a rough dielectric, and a puddle reflects the sky and what lies off screen."},};