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
docs(performance): the measured static batching example states its shapes, materials and pixel difference as measured
yhh443d84bc0511
diff --git a/docs/astro/src/content/docs/performance/static-batching.mdx b/docs/astro/src/content/docs/performance/static-batching.mdxindex 3ab7be2cd..b15b8ba70 100644--- a/docs/astro/src/content/docs/performance/static-batching.mdx+++ b/docs/astro/src/content/docs/performance/static-batching.mdx@@ -59,7 +59,7 @@ Use instancing for many copies of one mesh, and static batching for many differe## A measured example-The `dusk-fort` example (39 meshes, 20 distinct shapes), every mesh marked, in the editor's Play on WebGL2:+The `dusk-fort` example (39 meshes, 17 distinct shapes, 5 materials), every mesh marked, in the editor's Play on WebGL2:| | Not marked | Marked ||---|---|---|@@ -72,6 +72,6 @@ batches stand for 32 draws before instancing and hold 2.05 MB of copied verticesalready did most of the saving here, so the merge's share is the last five draws: a scene made ofmany different pieces gains more than one made of a few repeated ones.-The two frames differ by one level of 255 on 1.1% of the pixels, along geometry edges, from+The two frames differ on 1.1% of the pixels, by one level of 255 on 96% of those and at most five, all along geometry edges, fromthe merged vertices being transformed on the CPU in 32-bit floats; run to run the same scene differs on0.003%.diff --git a/docs/astro/src/content/docs/zh-cn/performance/static-batching.mdx b/docs/astro/src/content/docs/zh-cn/performance/static-batching.mdxindex b9e89d1d7..e4c7f705e 100644--- a/docs/astro/src/content/docs/zh-cn/performance/static-batching.mdx+++ b/docs/astro/src/content/docs/zh-cn/performance/static-batching.mdx@@ -56,7 +56,7 @@ world.insert(wall, StaticBatch, {});## 一个实测例子-`dusk-fort` 示例(39 个网格、20 种形状),全部标记,在编辑器 Play、WebGL2 下:+`dusk-fort` 示例(39 个网格、17 种形状、5 种材质),全部标记,在编辑器 Play、WebGL2 下:| | 不标记 | 标记 ||---|---|---|@@ -68,5 +68,5 @@ world.insert(wall, StaticBatch, {});复制的顶点占 2.05 MB。这个场景里实例化已经省了大部分,合并多省的是最后 5 次:由许多不同部件拼成的场景,比由少数几种重复部件拼成的收益更大。-两帧在 1.1% 的像素上差一级(共 255 级),都在几何边缘,来自合并后的顶点在 CPU 上以 32 位浮点+两帧在 1.1% 的像素上有差别,其中 96% 只差 1 级(共 255 级),最多差 5 级,都在几何边缘,来自合并后的顶点在 CPU 上以 32 位浮点变换;同一场景两次运行之间只差 0.003%。