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
refactor(engine): the only light and the only mesh renderer stop calling themselves 2D
esengine899c9442d68f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 6942e4361..6c898f1af 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,6 +16,30 @@ published separately; it ships inside the editor.### Changed+- **The engine's light and mesh components are no longer named after a plane.**+ `Light2D` is now `Light` and `Mesh2D` is now `MeshRenderer`. They were never a+ second, flat pair of components — they are the *only* light and the only mesh+ renderer the engine has, and PBR, IBL, cascaded shadow maps, imported glTF+ models and GPU skinning all go through them. `Light2DType` is `LightType`, and+ the resource, plugin and geometry types follow (`MeshRendererAPI`,+ `MeshRenderers`, `MeshRendererPlugin`, `MeshRendererGeometry`). The mesh+ component is not `Mesh`, because `Mesh`/`MeshData` already name the `.esmesh`+ asset — `MeshRenderer` says which of the two it is, and matches the+ `ShapeRenderer` / `TrailRenderer` the engine already had.++ **Scenes and prefabs migrate themselves.** A component's name is the key its+ data is stored under, so a rename is a change to every file holding one: the+ loader now upgrades the old names on the way in, for scenes and prefabs alike,+ and the scene format version is 2. An engine older than the rename REFUSES a+ version-2 scene rather than reading `Light` as a component it has never heard+ of and loading a level with no lights in it.++ **Breaking for code.** A script that imports `Light2D` or `Mesh2D` from+ `esengine` must import the new name. What the shader dialects inject is+ untouched: a `.esshader` still declares `#pragma domain Lit2D` and still reads+ a `Light2D` from the light block, because that is the GPU-side lighting model,+ not the component.+- **Particles are simulated and drawn in three dimensions.** A particle's positionand velocity, an emitter's `gravity` and `shapeSize`, and a force field's`direction` are all three-axis now, and the field's zone is a ball rather than adiff --git a/desktop b/desktopindex b663c08eb..e4bf68a41 160000--- a/desktop+++ b/desktop@@ -1 +1 @@-Subproject commit b663c08eb570c1ce98d1047103ea606fb13cc6e1+Subproject commit e4bf68a4180536ae29c86238e3d5fb1524e4aec1diff --git a/docs/astro/src/content/docs/assets/models.mdx b/docs/astro/src/content/docs/assets/models.mdxindex 15b62f68c..f488172a8 100644--- a/docs/astro/src/content/docs/assets/models.mdx+++ b/docs/astro/src/content/docs/assets/models.mdx@@ -19,8 +19,8 @@ That import is the subject of this page. For the component that draws the result## Built-in primitivesSeven shapes need no import and no file. **Create → Cube** (or Sphere, Capsule, Cylinder,-Cone, Plane, Quad) makes an entity whose `Mesh2D.mesh` holds a `builtin:` ref, and the-same seven appear at the top of the picker on any `Mesh2D.mesh` field.+Cone, Plane, Quad) makes an entity whose `MeshRenderer.mesh` holds a `builtin:` ref, and the+same seven appear at the top of the picker on any `MeshRenderer.mesh` field.| Ref | Shape ||---|---|@@ -43,7 +43,7 @@ they stay two-sided and are still there when seen from behind.<Aside type="caution" title="A lit mesh needs a light">Primitives are created `lit`, like imported geometry carrying normals. Lighting is-multiplicative and starts at zero, so a scene with no `Light2D` in it draws them black —+multiplicative and starts at zero, so a scene with no `Light` in it draws them black —**Create → Sun** adds the directional key light a shaded scene wants. Clearing `lit` givesthe flat, unshaded look instead.</Aside>@@ -74,12 +74,12 @@ For `robot.gltf` with two primitives and one image:|---|---|| `robot_0_0.esmesh`, `robot_1_0.esmesh` | One per primitive — geometry, named `<stem>_<mesh>_<primitive>` (just `<stem>` for a single one). || `robot_0.png` | Images the file carries inline. An image already on disk is referenced, never copied. |-| `robot_m0.esmaterial` | Only when the source's material says something a `Mesh2D` cannot — see [Materials](#materials). |+| `robot_m0.esmaterial` | Only when the source's material says something a `MeshRenderer` cannot — see [Materials](#materials). || `robot_Walk.estimeline` | One per animation in the source, named `<stem>_<animation>` — see [Animations](#animations). |-| `robot.esprefab` | How the pieces go together: the node hierarchy, each `Mesh2D` with its mesh, texture, tint and flags. |+| `robot.esprefab` | How the pieces go together: the node hierarchy, each `MeshRenderer` with its mesh, texture, tint and flags. |Drag the **prefab** into a scene. The individual `.esmesh` files are assets too — a-`Mesh2D.mesh` field takes one directly — but the prefab is the model as authored.+`MeshRenderer.mesh` field takes one directly — but the prefab is the model as authored.<Aside type="caution" title="Products are rewritten">Re-importing replaces every product. Edits made to a generated `.esprefab` are lost;@@ -113,7 +113,7 @@ Asset uuids survive, so scenes and prefabs that reference the products keep workA glTF material is split by what can carry it.-**On the `Mesh2D` component** — base colour, because that is what the engine's mesh path+**On the `MeshRenderer` component** — base colour, because that is what the engine's mesh pathalready is (`texture(uv) × vertexColor × tint`):| glTF | Component field |diff --git a/docs/astro/src/content/docs/core-concepts/components.mdx b/docs/astro/src/content/docs/core-concepts/components.mdxindex e3bd901bc..bd1c80f19 100644--- a/docs/astro/src/content/docs/core-concepts/components.mdx+++ b/docs/astro/src/content/docs/core-concepts/components.mdx@@ -85,7 +85,7 @@ switching it off would stop the wrong thing.## Built-in componentsThe engine registers 77 components you query alongside your own — `Transform`,-`Sprite`, `ShapeRenderer`, `Camera`, `Light2D`, `ParticleEmitter`,+`Sprite`, `ShapeRenderer`, `Camera`, `Light`, `ParticleEmitter`,`SpineAnimation`, `TilemapLayer`, the UI set, the physics colliders, and more.Each subsystem guide teaches the ones it owns; the[component reference](/docs/reference/components/core/) lists every one of themdiff --git a/docs/astro/src/content/docs/editor/viewport.mdx b/docs/astro/src/content/docs/editor/viewport.mdxindex b826354f5..ecc4d28fb 100644--- a/docs/astro/src/content/docs/editor/viewport.mdx+++ b/docs/astro/src/content/docs/editor/viewport.mdx@@ -46,7 +46,7 @@ rotation angle, and scale increment.**Show Flags** — a viewport dropdown toggles the Grid, Gizmos, Physics, and the perfoverlay, plus World/Local axis orientation and Pivot-vs-Center. Entities that don't-render — Cameras, `Light2D`, colliders, joints, particle emitters — are drawn as+render — Cameras, `Light`, colliders, joints, particle emitters — are drawn asgizmos in edit mode (icon, view rect, light reach/cone, collider outline, jointanchor links) so you can see and place them; many carry drag handles that writetheir fields directly (light radius, collider size, emitter shape, joint anchors).diff --git a/docs/astro/src/content/docs/extending/editor-plugins.mdx b/docs/astro/src/content/docs/extending/editor-plugins.mdxindex ae78e0734..728006003 100644--- a/docs/astro/src/content/docs/extending/editor-plugins.mdx+++ b/docs/astro/src/content/docs/extending/editor-plugins.mdx@@ -524,7 +524,7 @@ is unavailable. Gate on it the way gameplay code gates on `Ads.available`: atarget without the module should degrade, not crash.To draw what such a runtime produces, hand its triangles to-[Mesh2D](/docs/graphics/drawing/) — positions, UVs, colors and indices go through the+[MeshRenderer](/docs/graphics/drawing/) — positions, UVs, colors and indices go through thesame path the engine's own Spine integration uses, so it renders on every backendthe engine supports.diff --git a/docs/astro/src/content/docs/graphics/drawing.mdx b/docs/astro/src/content/docs/graphics/drawing.mdxindex be29df980..7a10fa3ad 100644--- a/docs/astro/src/content/docs/graphics/drawing.mdx+++ b/docs/astro/src/content/docs/graphics/drawing.mdx@@ -1,6 +1,6 @@---title: Custom Drawing-description: Draw beyond components — immediate-mode primitives with Draw, vector paths with Graphics, custom triangle meshes with Mesh2D and the Geometry API, and offscreen render textures.+description: Draw beyond components — immediate-mode primitives with Draw, vector paths with Graphics, custom triangle meshes with MeshRenderer and the Geometry API, and offscreen render textures.---import { Aside } from '@astrojs/starlight/components';@@ -15,7 +15,7 @@ shapes, custom geometry — the engine exposes its drawing layer directly.|---|---|---|| `Draw` | **Immediate**, global — commands batch and clear every frame. | Debug overlays, gizmos, anything redrawn from scratch each frame. || `Graphics` | **Retained** path recorder — build once, replay through `Draw` with `flush()`. | Vector shapes with paths/béziers/arcs you don't want to re-tessellate per frame. |-| `ShapeRenderer` / `Mesh2D` | **Components** — entities with sorting layers, materials, editor gizmos. | Shapes/meshes that are part of the scene (see [Sprites](/docs/graphics/sprites/)). |+| `ShapeRenderer` / `MeshRenderer` | **Components** — entities with sorting layers, materials, editor gizmos. | Shapes/meshes that are part of the scene (see [Sprites](/docs/graphics/sprites/)). |Rule of thumb: if the visual belongs to the *scene* (sorted, saved, inspectable),make it a component; if it belongs to a *frame* (debug, HUD-ish overlays,@@ -88,9 +88,9 @@ Path methods: `moveTo` / `lineTo`, `curveTo` (quadratic) / `cubicCurveTo`,fill **rects and circles** (path outlines stay strokes). The path is retained —build it once, `flush()` it every frame.-## Custom meshes: `Mesh2D`+## Custom meshes: `MeshRenderer`-`Mesh2D` is a component that renders an arbitrary indexed triangle list —+`MeshRenderer` is a component that renders an arbitrary indexed triangle list —procedural terrain slices, radial health arcs, water surfaces. Author thegeometry on the component (positions as x,y pairs; optional per-vertex UVs andcolors):@@ -98,7 +98,7 @@ colors):```typescriptcmds.spawn().insert(Transform, { position: { x: 0, y: 0, z: 0 } })- .insert(Mesh2D, {+ .insert(MeshRenderer, {geometry: {positions: [0, 0, 100, 0, 50, 80],colors: [1,0,0,1, 0,1,0,1, 0,0,1,1],@@ -109,14 +109,14 @@ cmds.spawn()The mesh shares the standard renderable surface: `texture`, `color`, `layer`,`lit`, `parallax`, and `material`. Geometry set in a scene (or at spawn) uploads-automatically; to **mutate it at runtime**, go through the `Meshes2D` resource —+automatically; to **mutate it at runtime**, go through the `MeshRenderers` resource —`setGeometry(entity, geometry)` re-uploads (indices are validated engine-side),`getGeometry` / `clearGeometry` round it out. Direct writes to the `geometry`field alone are not change-detected.## Custom geometry: the `Geometry` API-Where `Mesh2D` is the *component* path, `Geometry` is the *immediate* one: it+Where `MeshRenderer` is the *component* path, `Geometry` is the *immediate* one: ituploads an indexed vertex buffer and hands back a **handle** you draw yourself —paired with a [material](/docs/graphics/materials/) via`Draw.drawMeshWithMaterial(geometry, material, transform?)` (or a raw shader viadiff --git a/docs/astro/src/content/docs/graphics/lighting.mdx b/docs/astro/src/content/docs/graphics/lighting.mdxindex 635b75a32..4bc25d56f 100644--- a/docs/astro/src/content/docs/graphics/lighting.mdx+++ b/docs/astro/src/content/docs/graphics/lighting.mdx@@ -1,27 +1,27 @@---title: 2D Lighting & Shadows-description: Light a 2D scene with directional, point, spot, and ambient Light2D sources — color and intensity, normal-mapped surfaces, and soft shadows cast by ShadowCaster2D — all through the Lit-2D material domain.+description: Light a 2D scene with directional, point, spot, and ambient Light sources — color and intensity, normal-mapped surfaces, and soft shadows cast by ShadowCaster2D — all through the Lit-2D material domain.---import { Aside } from '@astrojs/starlight/components';-Estella lights 2D scenes with **`Light2D`** sources and **`ShadowCaster2D`** occluders.-A light is just an entity with a `Light2D` component; a renderer receives light only+Estella lights 2D scenes with **`Light`** sources and **`ShadowCaster2D`** occluders.+A light is just an entity with a `Light` component; a renderer receives light onlywhen it's drawn with a **Lit-2D material**. This keeps lighting opt-in and cheap — mostsprites stay unlit, and the ones you want lit get a lit material.<Aside type="note">- Lighting is built into the renderer (no plugin to add). `Light2D` and+ Lighting is built into the renderer (no plugin to add). `Light` and`ShadowCaster2D` are built-in components — attach them from code or in the editor'sDetails panel like any other.</Aside>## Adding a light-Give an entity a `Light2D` component and pick a type:+Give an entity a `Light` component and pick a type:```typescript-import { defineSystem, Commands, Transform, Light2D, Light2DType, lightAimRotation } from 'esengine';+import { defineSystem, Commands, Transform, Light, LightType, lightAimRotation } from 'esengine';const addSun = defineSystem([Commands()], (cmds) => {cmds.spawn()@@ -30,19 +30,19 @@ const addSun = defineSystem([Commands()], (cmds) => {position: { x: 0, y: 0, z: 0 },rotation: lightAimRotation({ x: -1, y: -1, z: -1 }),})- .insert(Light2D, {- type: Light2DType.Directional,+ .insert(Light, {+ type: LightType.Directional,color: { r: 1, g: 0.95, b: 0.8, a: 1 },intensity: 1.2,});});```-`Light2D` fields (with defaults):+`Light` fields (with defaults):| Field | Default | Description ||---|---|---|-| `type` | `Point` | `Light2DType`: `Point`, `Directional`, `Ambient`, or `Spot`. |+| `type` | `Point` | `LightType`: `Point`, `Directional`, `Ambient`, or `Spot`. || `color` | `{1,1,1,1}` | Light color, RGBA 0..1. || `intensity` | `1` | Brightness multiplier. || `radius` | `200` | Falloff reach in world units (Point / Spot). |@@ -63,16 +63,16 @@ const addSun = defineSystem([Commands()], (cmds) => {```typescript// A warm point light-.insert(Light2D, { type: Light2DType.Point, radius: 320, intensity: 1.5,+.insert(Light, { type: LightType.Point, radius: 320, intensity: 1.5,color: { r: 1, g: 0.7, b: 0.3, a: 1 } });// A flashlight cone, aimed down the screen by the entity it sits on.insert(Transform, { rotation: lightAimRotation({ x: 0, y: -1, z: 0 }) })-.insert(Light2D, { type: Light2DType.Spot,+.insert(Light, { type: LightType.Spot,innerAngle: 18, outerAngle: 34, radius: 500, intensity: 2 });// A dim ambient fill so nothing is fully black-.insert(Light2D, { type: Light2DType.Ambient, intensity: 0.25 });+.insert(Light, { type: LightType.Ambient, intensity: 0.25 });```## Making a renderer receive light@@ -137,7 +137,7 @@ You can also build a lit material visually — set the **Material Graph**'s doma<Aside type="tip">Every renderer that takes a `material` — `Sprite`, `SpineAnimation`,- `ParticleEmitter`, `Mesh2D`, and `UIVisual` — can be lit the same way: give it a+ `ParticleEmitter`, `MeshRenderer`, and `UIVisual` — can be lit the same way: give it aLit-2D material. (`Sprite` also has the one-flag `lit` toggle for the common case.)</Aside>@@ -179,7 +179,7 @@ orthographic camera returns a constant and a perspective one varies per pixel.A metal has no diffuse term at all — it only reflects. What it reflects is thescene's **ambient** light, treated as an environment arriving equally from every-direction, so an `Ambient` `Light2D` is what keeps a metal from being black+direction, so an `Ambient` `Light` is what keeps a metal from being blackeverywhere no light happens to point. Raise its color to give metals something toshow.@@ -204,8 +204,8 @@ its fill light from the direction it faces, and a metal reflects the panoramarather than one flat colour.```typescript-cmds.spawn().insert(Light2D, {- type: Light2DType.Ambient,+cmds.spawn().insert(Light, {+ type: LightType.Ambient,environment: 'assets/sky.esenv',intensity: 1,});@@ -232,14 +232,14 @@ mesh standing above another darkens it.```typescriptcmds.spawn().insert(Transform, { rotation: lightAimRotation({ x: 0.5, y: 0, z: -1 }) }) // where the rays lean- .insert(Light2D, {- type: Light2DType.Directional,+ .insert(Light, {+ type: LightType.Directional,meshShadows: true,});```- One light per frame casts a map — the first that asks for one.-- Only `Mesh2D` geometry the GPU holds casts and receives. Sprites are lit by the same+- Only `MeshRenderer` geometry the GPU holds casts and receives. Sprites are lit by the samelight but shadow through `ShadowCaster2D`, which is the 2D answer.- Coverage follows the camera. `shadowExtent` fixes it to a radius instead, tradingsharpness for reach.@@ -304,9 +304,9 @@ const app = createWebApp(module, { colorSpace: 'linear' });-*A `Light2D` previewed in the editor — its reach pool and the shadows the pillars cast (turn on **Preview FX** to light the scene in edit mode).*+*A `Light` previewed in the editor — its reach pool and the shadows the pillars cast (turn on **Preview FX** to light the scene in edit mode).*-- **Add a light** via **Create… → Light**, or add a `Light2D` component to an existing+- **Add a light** via **Create… → Light**, or add a `Light` component to an existingentity in the Details panel.- Lights are drawn as **gizmos** in edit mode — an icon plus the reach circle and thedirection / cone — so you can aim and size them by eye. See [The Editor](/docs/editor/overview/).diff --git a/docs/astro/src/content/docs/graphics/materials.mdx b/docs/astro/src/content/docs/graphics/materials.mdxindex ed0417240..9f0f57a73 100644--- a/docs/astro/src/content/docs/graphics/materials.mdx+++ b/docs/astro/src/content/docs/graphics/materials.mdx@@ -6,7 +6,7 @@ description: The complete guide to custom materials — authoring GLSL with reflimport { Aside } from '@astrojs/starlight/components';A material is a **shader plus parameters**. Renderers that support materials —-`Sprite`, `SpineAnimation`, `ParticleEmitter`, `Mesh2D`, and `UIVisual` — expose a+`Sprite`, `SpineAnimation`, `ParticleEmitter`, `MeshRenderer`, and `UIVisual` — expose a`material` handle field; set it to draw with your own shader instead of the default.## How it works@@ -314,7 +314,7 @@ reference lives in [Custom Drawing](/docs/graphics/drawing/).<Aside type="note">For raw shaders without reflected params, use `Material.createShader(vertexSrc,fragmentSrc)` instead of `compileShader`. `ShapeRenderer` and `TilemapLayer` have no- `material` field — only `Sprite`, `SpineAnimation`, `ParticleEmitter`, `Mesh2D`, and+ `material` field — only `Sprite`, `SpineAnimation`, `ParticleEmitter`, `MeshRenderer`, and`UIVisual` do.</Aside>diff --git a/docs/astro/src/content/docs/graphics/post-processing.mdx b/docs/astro/src/content/docs/graphics/post-processing.mdxindex 1d1c23118..be5a4cb82 100644--- a/docs/astro/src/content/docs/graphics/post-processing.mdx+++ b/docs/astro/src/content/docs/graphics/post-processing.mdx@@ -40,7 +40,7 @@ When the project renders in the **linear color space** (see[Lighting](/docs/graphics/lighting/)), the effect chain runs in **half-float HDR**wherever float render targets are available — always on WebGPU, and on WebGL2 withthe near-universal `EXT_color_buffer_float`. Light accumulation past `1.0` (a-`Light2D` with `intensity` above 1) then *survives* into the chain instead of+`Light` with `intensity` above 1) then *survives* into the chain instead ofclamping at the 8-bit store:- **`bloom` with `threshold` above 1** blooms only over-range energy — brightdiff --git a/docs/astro/src/content/docs/graphics/sprites.mdx b/docs/astro/src/content/docs/graphics/sprites.mdxindex 6a92f86d9..8753b3ff8 100644--- a/docs/astro/src/content/docs/graphics/sprites.mdx+++ b/docs/astro/src/content/docs/graphics/sprites.mdx@@ -249,7 +249,7 @@ background.Assign `sprite.material` to draw the sprite with your own shader — a tint, adissolve, a distortion — see [Materials & Shaders](/docs/graphics/materials/).-To make a sprite respond to `Light2D` lights, the simplest path is to set+To make a sprite respond to `Light` lights, the simplest path is to set`sprite.lit = true` — no custom material needed (it's lit with a flat normal). Fornormal maps or a fully custom look, use a **Lit-2D material** instead. Either way,see [2D Lighting & Shadows](/docs/graphics/lighting/).diff --git a/docs/astro/src/content/docs/graphics/video.mdx b/docs/astro/src/content/docs/graphics/video.mdxindex 736bd1427..82ab5de07 100644--- a/docs/astro/src/content/docs/graphics/video.mdx+++ b/docs/astro/src/content/docs/graphics/video.mdx@@ -14,7 +14,7 @@ the **identical** texture pump on every device — phone, PC, and headless alike## How it worksAdd a `Video` component to an entity that also has a renderable — a `Sprite`,-`UIVisual`, or `Mesh2D` — and the video system decodes `source` into a texture and+`UIVisual`, or `MeshRenderer` — and the video system decodes `source` into a texture andwrites that texture handle onto the renderable every frame. The frame texture is**pathless** (never evicted) and stable, so a handle written once stays live forthe life of the stream.@@ -26,7 +26,7 @@ no plugin to add.<Aside type="note">Muted clips autoplay everywhere. Unmuted autoplay is blocked until a usergesture (browser policy), so start sound-on playback from a tap or key. A- `Video` needs a `Sprite` / `UIVisual` / `Mesh2D` sibling to show on — on its own+ `Video` needs a `Sprite` / `UIVisual` / `MeshRenderer` sibling to show on — on its ownit decodes but has nothing to draw to.</Aside>@@ -58,8 +58,8 @@ const spawnScreen = defineSystem([Commands()], (cmds) => {| `enabled` | boolean | `true` | Disable to stop and release the stream without removing the component. |The same component drives whichever renderable it finds, in order **`Sprite` →-`UIVisual` → `Mesh2D`**: put a `Video` on a `UIVisual` for a video panel in your-HUD, or on a `Mesh2D` to map a clip onto custom geometry.+`UIVisual` → `MeshRenderer`**: put a `Video` on a `UIVisual` for a video panel in your+HUD, or on a `MeshRenderer` to map a clip onto custom geometry.## One stream, many surfaces@@ -99,7 +99,7 @@ import { defineSystem, Res, VideoPlayer } from 'esengine';const playIntro = defineSystem([Res(VideoPlayer)], (video) => {const stream = video.play('assets/intro.mp4', { loop: false, muted: true });stream.onEnded = () => { /* advance past the intro */ };- // assign stream.textureHandle onto a Sprite/Mesh2D once stream.isReady+ // assign stream.textureHandle onto a Sprite/MeshRenderer once stream.isReady});```@@ -153,7 +153,7 @@ same component, the same handle sharing — only the decoder differs:- **Share one stream** across many surfaces via the texture handle +`uvOffset` / `uvScale`, rather than many `Video` components decoding the same clip.- **Give the Video a renderable** — a `Sprite` (world), `UIVisual` (HUD), or- `Mesh2D` (custom geometry) — to actually show a frame.+ `MeshRenderer` (custom geometry) — to actually show a frame.- **Mind `fitSize`** — it snaps the Sprite to the clip's native pixels on the firstframe; turn it off when you set an explicit size (e.g. a fixed screen).- **Target WeChat early** — the cook handles the MPEG-1 transcode for you, but keepdiff --git a/docs/astro/src/content/docs/publishing/hot-update.mdx b/docs/astro/src/content/docs/publishing/hot-update.mdxindex e4f20426a..c7f307c42 100644--- a/docs/astro/src/content/docs/publishing/hot-update.mdx+++ b/docs/astro/src/content/docs/publishing/hot-update.mdx@@ -209,7 +209,7 @@ the download and swap.When a scene references an asset by `@uuid` and that asset lives in a remotegroup, `applyUpdate` does **everything** — it downloads the new bytes, swaps themanifest, and the built-in rebinder replaces the old texture in every live-`Sprite` and `Mesh2D` on screen. The picture changes on its own; the scene author+`Sprite` and `MeshRenderer` on screen. The picture changes on its own; the scene authorwrites nothing. (The `hot-update-demo` example's game code is literally empty.)For anything the built-in rebinder doesn't cover — a texture you bound manually, adiff --git a/docs/astro/src/content/docs/zh-cn/assets/models.mdx b/docs/astro/src/content/docs/zh-cn/assets/models.mdxindex aa07a19aa..227f4bb77 100644--- a/docs/astro/src/content/docs/zh-cn/assets/models.mdx+++ b/docs/astro/src/content/docs/zh-cn/assets/models.mdx@@ -16,8 +16,8 @@ import { Aside } from '@astrojs/starlight/components';## 内置图元有七个形状不需要导入、也不需要文件。**Create → Cube**(以及 Sphere、Capsule、Cylinder、-Cone、Plane、Quad)建出的实体,其 `Mesh2D.mesh` 里放的是一个 `builtin:` 引用;同样这七个-也排在任何 `Mesh2D.mesh` 字段选择器的最前面。+Cone、Plane、Quad)建出的实体,其 `MeshRenderer.mesh` 里放的是一个 `builtin:` 引用;同样这七个+也排在任何 `MeshRenderer.mesh` 字段选择器的最前面。| 引用 | 形状 ||---|---|@@ -38,7 +38,7 @@ Transform 给,和导入的模型一样。<Aside type="caution" title="被照亮的 mesh 需要一盏灯">图元建出来时是 `lit` 的,和带法线的导入几何一样。光照是乘性的、从零起算,所以场景里没有-`Light2D` 时它们画出来是黑的 —— **Create → Sun** 会加上一盏有阴影场景想要的平行主光。+`Light` 时它们画出来是黑的 —— **Create → Sun** 会加上一盏有阴影场景想要的平行主光。把 `lit` 关掉则得到不受光的平涂外观。</Aside>@@ -65,11 +65,11 @@ Transform 给,和导入的模型一样。|---|---|| `robot_0_0.esmesh`、`robot_1_0.esmesh` | 每个 primitive 一个几何文件,命名 `<stem>_<mesh>_<primitive>`(只有一个时就是 `<stem>`)。 || `robot_0.png` | 文件内嵌的图片。已经在磁盘上的图片只被引用,不会复制。 |-| `robot_m0.esmaterial` | **仅当**源材质说了 `Mesh2D` 装不下的东西时才写 —— 见[材质](#材质)。 |+| `robot_m0.esmaterial` | **仅当**源材质说了 `MeshRenderer` 装不下的东西时才写 —— 见[材质](#材质)。 || `robot_Walk.estimeline` | 源里每个动画一个,命名 `<stem>_<动画名>` —— 见[动画](#动画)。 |-| `robot.esprefab` | 各部分怎么组装:节点层级,每个 `Mesh2D` 带上自己的 mesh、贴图、tint 和开关。 |+| `robot.esprefab` | 各部分怎么组装:节点层级,每个 `MeshRenderer` 带上自己的 mesh、贴图、tint 和开关。 |-把 **prefab** 拖进场景。单个 `.esmesh` 也是资源(`Mesh2D.mesh` 字段可以直接引用),+把 **prefab** 拖进场景。单个 `.esmesh` 也是资源(`MeshRenderer.mesh` 字段可以直接引用),但 prefab 才是作者组装好的那个模型。<Aside type="caution" title="产物会被重写">@@ -102,7 +102,7 @@ Transform 给,和导入的模型一样。一个 glTF 材质按「谁装得下」拆开。-**落在 `Mesh2D` 组件上** —— base color,因为引擎的 mesh 通路本来就是+**落在 `MeshRenderer` 组件上** —— base color,因为引擎的 mesh 通路本来就是`texture(uv) × 顶点色 × tint`:| glTF | 组件字段 |diff --git a/docs/astro/src/content/docs/zh-cn/core-concepts/components.mdx b/docs/astro/src/content/docs/zh-cn/core-concepts/components.mdxindex 5bb90fcf3..c814a725a 100644--- a/docs/astro/src/content/docs/zh-cn/core-concepts/components.mdx+++ b/docs/astro/src/content/docs/zh-cn/core-concepts/components.mdx@@ -77,7 +77,7 @@ const Turret = defineComponent('Turret', {## 内置组件引擎注册了 77 个组件,与你自己的组件一起查询——`Transform`、`Sprite`、-`ShapeRenderer`、`Camera`、`Light2D`、`ParticleEmitter`、`SpineAnimation`、+`ShapeRenderer`、`Camera`、`Light`、`ParticleEmitter`、`SpineAnimation`、`TilemapLayer`、UI 组件族、物理碰撞体等等。每个子系统指南讲它自己那一批;[组件参考](/docs/zh-cn/reference/components/core/)则逐个列出全部组件的字段、类型与创作默认值——数据来自编辑器 Details 面板读的同一份注册表。diff --git a/docs/astro/src/content/docs/zh-cn/editor/viewport.mdx b/docs/astro/src/content/docs/zh-cn/editor/viewport.mdxindex 54982665d..9c9629bdb 100644--- a/docs/astro/src/content/docs/zh-cn/editor/viewport.mdx+++ b/docs/astro/src/content/docs/zh-cn/editor/viewport.mdx@@ -38,7 +38,7 @@ description: "视口导航、变换 gizmo、对齐与分布、显示开关、Sce**吸附** — 从视口的吸附下拉里开关吸附,并设置网格步长、旋转角度和缩放增量。**显示标志(Show Flags)** — 视口下拉可开关网格、gizmo、物理和性能浮层,以及世界/本地轴朝向-和轴心/中心。不渲染的实体——相机、`Light2D`、碰撞体、关节、粒子发射器——在编辑模式下画成+和轴心/中心。不渲染的实体——相机、`Light`、碰撞体、关节、粒子发射器——在编辑模式下画成gizmo(图标、视野矩形、光照范围/锥、碰撞体轮廓、关节锚点连线),让你能看见并摆放它们;多数还带可拖拽的 handle,直接写回字段(灯光半径、碰撞体尺寸、发射器形状、关节锚点)。diff --git a/docs/astro/src/content/docs/zh-cn/extending/editor-plugins.mdx b/docs/astro/src/content/docs/zh-cn/extending/editor-plugins.mdxindex 6b1d2fcf6..35a290241 100644--- a/docs/astro/src/content/docs/zh-cn/extending/editor-plugins.mdx+++ b/docs/astro/src/content/docs/zh-cn/extending/editor-plugins.mdx@@ -456,7 +456,7 @@ const version = rive.cwrap('rive_version', 'string', [])() as string;的目标应当降级,而不是崩溃。要把这类运行时产出的东西画出来,把它的三角形交给-[Mesh2D](/docs/zh-cn/graphics/drawing/)——顶点位置、UV、颜色和索引走的正是引擎内置 Spine 集成+[MeshRenderer](/docs/zh-cn/graphics/drawing/)——顶点位置、UV、颜色和索引走的正是引擎内置 Spine 集成所用的同一条路,因此引擎支持的每个后端上它都能渲染。<Aside type="note">diff --git a/docs/astro/src/content/docs/zh-cn/graphics/drawing.mdx b/docs/astro/src/content/docs/zh-cn/graphics/drawing.mdxindex fe69450ca..c8d8cf347 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/drawing.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/drawing.mdx@@ -1,6 +1,6 @@---title: 自定义绘制-description: 超出组件的绘制——用 Draw 画即时模式图元、用 Graphics 画矢量路径、用 Mesh2D 与 Geometry API 画自定义三角网格,以及离屏渲染纹理。+description: 超出组件的绘制——用 Draw 画即时模式图元、用 Graphics 画矢量路径、用 MeshRenderer 与 Geometry API 画自定义三角网格,以及离屏渲染纹理。---import { Aside } from '@astrojs/starlight/components';@@ -15,7 +15,7 @@ import { Aside } from '@astrojs/starlight/components';|---|---|---|| `Draw` | **即时模式**,全局——命令自动合批、每帧清空。 | 调试覆盖层、gizmo、任何每帧从头重画的东西。 || `Graphics` | **保留式**路径记录器——构建一次,`flush()` 时经 `Draw` 回放。 | 带路径/贝塞尔/圆弧的矢量形状,不想每帧重新细分。 |-| `ShapeRenderer` / `Mesh2D` | **组件**——带排序层、材质、编辑器 gizmo 的实体。 | 属于场景的形状/网格(见[精灵](/docs/zh-cn/graphics/sprites/))。 |+| `ShapeRenderer` / `MeshRenderer` | **组件**——带排序层、材质、编辑器 gizmo 的实体。 | 属于场景的形状/网格(见[精灵](/docs/zh-cn/graphics/sprites/))。 |经验法则:视觉属于*场景*(参与排序、保存、可检视)就做成组件;属于*某一帧*(调试、类 HUD 覆盖、程序化效果)就在回调里画。@@ -83,15 +83,15 @@ registerDrawCallback('hud-shape', () => g.flush());`lineStyle(thickness, color)` 设描边;`beginFill(color)` / `endFill()` 的填充支持**矩形和圆**(路径轮廓保持描边)。路径是保留的——构建一次,每帧 `flush()`。-## 自定义网格:`Mesh2D`+## 自定义网格:`MeshRenderer`-`Mesh2D` 组件渲染任意的索引三角形列表——程序化地形切片、径向血条弧、水面。+`MeshRenderer` 组件渲染任意的索引三角形列表——程序化地形切片、径向血条弧、水面。在组件上编写几何(positions 是 x,y 对;逐顶点 UV 与颜色可选):```typescriptcmds.spawn().insert(Transform, { position: { x: 0, y: 0, z: 0 } })- .insert(Mesh2D, {+ .insert(MeshRenderer, {geometry: {positions: [0, 0, 100, 0, 50, 80],colors: [1,0,0,1, 0,1,0,1, 0,0,1,1],@@ -102,12 +102,12 @@ cmds.spawn()网格共享标准渲染面:`texture`、`color`、`layer`、`lit`、`parallax` 和`material`。场景里(或生成时)设置的几何自动上传;要在**运行时改几何**,走-`Meshes2D` 资源——`setGeometry(entity, geometry)` 重新上传(索引在引擎侧校验),+`MeshRenderers` 资源——`setGeometry(entity, geometry)` 重新上传(索引在引擎侧校验),另有 `getGeometry` / `clearGeometry`。只改 `geometry` 字段本身不会被变更检测。## 自定义几何:`Geometry` API-`Mesh2D` 是*组件*路径,`Geometry` 则是*即时*路径:它上传一个索引顶点缓冲,交回+`MeshRenderer` 是*组件*路径,`Geometry` 则是*即时*路径:它上传一个索引顶点缓冲,交回一个**句柄**由你自己绘制——配上[材质](/docs/zh-cn/graphics/materials/)用`Draw.drawMeshWithMaterial(geometry, material, transform?)`(或配原始着色器用`Draw.drawMesh(geometry, shader, transform)`)。diff --git a/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx b/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdxindex 2d0e5f901..893c27c6b 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx@@ -1,25 +1,25 @@---title: 2D 光照与阴影-description: 用方向光、点光、聚光和环境光 Light2D 光源照亮 2D 场景——颜色与强度、法线贴图表面、以及 ShadowCaster2D 投出的柔和阴影,全部经由 Lit-2D 材质域实现。+description: 用方向光、点光、聚光和环境光 Light 光源照亮 2D 场景——颜色与强度、法线贴图表面、以及 ShadowCaster2D 投出的柔和阴影,全部经由 Lit-2D 材质域实现。---import { Aside } from '@astrojs/starlight/components';-Estella 用 **`Light2D`** 光源和 **`ShadowCaster2D`** 遮挡体照亮 2D 场景。一个光源就是一个带-`Light2D` 组件的实体;而一个渲染器只有在用 **Lit-2D 材质**绘制时才会被照亮。这让光照是可选的、+Estella 用 **`Light`** 光源和 **`ShadowCaster2D`** 遮挡体照亮 2D 场景。一个光源就是一个带+`Light` 组件的实体;而一个渲染器只有在用 **Lit-2D 材质**绘制时才会被照亮。这让光照是可选的、且开销低——大多数精灵保持不受光,你想照亮的那些才配一个受光材质。<Aside type="note">- 光照内建于渲染器(无需加插件)。`Light2D` 和 `ShadowCaster2D` 是内建组件——像其他组件一样,+ 光照内建于渲染器(无需加插件)。`Light` 和 `ShadowCaster2D` 是内建组件——像其他组件一样,从代码或在编辑器 Details 面板里挂上它们。</Aside>## 添加光源-给一个实体加 `Light2D` 组件并选一个类型:+给一个实体加 `Light` 组件并选一个类型:```typescript-import { defineSystem, Commands, Transform, Light2D, Light2DType, lightAimRotation } from 'esengine';+import { defineSystem, Commands, Transform, Light, LightType, lightAimRotation } from 'esengine';const addSun = defineSystem([Commands()], (cmds) => {cmds.spawn()@@ -28,19 +28,19 @@ const addSun = defineSystem([Commands()], (cmds) => {position: { x: 0, y: 0, z: 0 },rotation: lightAimRotation({ x: -1, y: -1, z: -1 }),})- .insert(Light2D, {- type: Light2DType.Directional,+ .insert(Light, {+ type: LightType.Directional,color: { r: 1, g: 0.95, b: 0.8, a: 1 },intensity: 1.2,});});```-`Light2D` 字段(含默认值):+`Light` 字段(含默认值):| 字段 | 默认 | 说明 ||---|---|---|-| `type` | `Point` | `Light2DType`:`Point`、`Directional`、`Ambient` 或 `Spot`。 |+| `type` | `Point` | `LightType`:`Point`、`Directional`、`Ambient` 或 `Spot`。 || `color` | `{1,1,1,1}` | 光颜色,RGBA 0..1。 || `intensity` | `1` | 亮度倍数。 || `radius` | `200` | 衰减半径,世界单位(Point / Spot)。 |@@ -61,16 +61,16 @@ const addSun = defineSystem([Commands()], (cmds) => {```typescript// 一盏暖色点光-.insert(Light2D, { type: Light2DType.Point, radius: 320, intensity: 1.5,+.insert(Light, { type: LightType.Point, radius: 320, intensity: 1.5,color: { r: 1, g: 0.7, b: 0.3, a: 1 } });// 一束手电锥,由它所在的实体朝下瞄准.insert(Transform, { rotation: lightAimRotation({ x: 0, y: -1, z: 0 }) })-.insert(Light2D, { type: Light2DType.Spot,+.insert(Light, { type: LightType.Spot,innerAngle: 18, outerAngle: 34, radius: 500, intensity: 2 });// 一点微弱环境光,让画面不至于全黑-.insert(Light2D, { type: Light2DType.Ambient, intensity: 0.25 });+.insert(Light, { type: LightType.Ambient, intensity: 0.25 });```## 让渲染器接受光照@@ -133,7 +133,7 @@ const applyLit = defineSystem([Query(Mut(Sprite))], (q) => {[材质图](/docs/zh-cn/graphics/materials/)一节。<Aside type="tip">- 每个接受 `material` 的渲染器——`Sprite`、`SpineAnimation`、`ParticleEmitter`、`Mesh2D`+ 每个接受 `material` 的渲染器——`Sprite`、`SpineAnimation`、`ParticleEmitter`、`MeshRenderer`和 `UIVisual`——都能用同样方式受光:给它一个 Lit-2D 材质。(`Sprite` 常见场景还可用一键`lit` 开关。)</Aside>@@ -171,7 +171,7 @@ highp vec3 lit = applyLightingPBR(所以正交相机返回一个常量,透视相机逐像素变化。金属完全没有漫反射项 —— 它只反射。它反射的是场景的**环境光**(ambient),被当作从各个-方向等量到达的环境:所以一盏 `Ambient` 的 `Light2D` 正是让金属在没有灯照到的地方不至于+方向等量到达的环境:所以一盏 `Ambient` 的 `Light` 正是让金属在没有灯照到的地方不至于全黑的东西。把它的颜色调亮,金属才有东西可显。@@ -193,8 +193,8 @@ highp vec3 lit = applyLightingPBR(而金属反射的是这张全景图,不再是一个平坦的颜色。```typescript-cmds.spawn().insert(Light2D, {- type: Light2DType.Ambient,+cmds.spawn().insert(Light, {+ type: LightType.Ambient,environment: 'assets/sky.esenv',intensity: 1,});@@ -218,14 +218,14 @@ mesh 再画一遍,于是站得高的 mesh 会让下面的暗下来。```typescriptcmds.spawn().insert(Transform, { rotation: lightAimRotation({ x: 0.5, y: 0, z: -1 }) }) // 光线偏向哪边- .insert(Light2D, {- type: Light2DType.Directional,+ .insert(Light, {+ type: LightType.Directional,meshShadows: true,});```- 每帧只有一盏灯投出这张图 —— 第一盏要求它的。-- 只有 GPU 持有的 `Mesh2D` 几何参与投射与接收。精灵被同一盏灯照亮,但它们的阴影走+- 只有 GPU 持有的 `MeshRenderer` 几何参与投射与接收。精灵被同一盏灯照亮,但它们的阴影走`ShadowCaster2D`,那才是 2D 的答案。- 覆盖范围跟着相机走。`shadowExtent` 把它固定成一个半径,用锐度换范围。@@ -283,9 +283,9 @@ const app = createWebApp(module, { colorSpace: 'linear' });-*编辑器里预览的 `Light2D`——它的照射光池,以及柱子投出的阴影(开 **Preview FX** 可在编辑态点亮场景)。*+*编辑器里预览的 `Light`——它的照射光池,以及柱子投出的阴影(开 **Preview FX** 可在编辑态点亮场景)。*-- 通过 **创建… → 光** 添加光源,或在 Details 面板里给已有实体加一个 `Light2D` 组件。+- 通过 **创建… → 光** 添加光源,或在 Details 面板里给已有实体加一个 `Light` 组件。- 光源在编辑模式下画成 **gizmo**——图标加上其范围圈和朝向/锥——所以你能凭眼睛瞄准和调尺寸。见[编辑器](/docs/zh-cn/editor/overview/)。- 在 Details 里实时调 `color`(取色器)、`intensity`、`radius` 和聚光角度;结果在视口里即时更新。diff --git a/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx b/docs/astro/src/content/docs/zh-cn/graphics/materials.mdxindex d60cdf4d2..82d9f4df3 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx@@ -6,7 +6,7 @@ description: 自定义材质完整指南——用 #pragma param 反射 uniformimport { Aside } from '@astrojs/starlight/components';材质是**着色器加参数**。支持材质的渲染器——`Sprite`、`SpineAnimation`、`ParticleEmitter`、-`Mesh2D` 和 `UIVisual`——都暴露一个 `material` 句柄字段;设置它就用你自己的着色器绘制,而非默认。+`MeshRenderer` 和 `UIVisual`——都暴露一个 `material` 句柄字段;设置它就用你自己的着色器绘制,而非默认。## 工作原理@@ -289,7 +289,7 @@ Material.setUniform(mat, 'u_tint', [1, 0, 0, 1]); // 图参数就是普通参<Aside type="note">没有反射参数的原始着色器用 `Material.createShader(vertexSrc, fragmentSrc)` 而非`compileShader`。`ShapeRenderer` 和 `TilemapLayer` 没有 `material` 字段——只有 `Sprite`、- `SpineAnimation`、`ParticleEmitter`、`Mesh2D` 和 `UIVisual` 有。+ `SpineAnimation`、`ParticleEmitter`、`MeshRenderer` 和 `UIVisual` 有。</Aside>## 参见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 e4c2b0ce7..a157d491d 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@@ -35,7 +35,7 @@ Estella 通过 ping-pong 帧缓冲运行全屏后处理。加一个 `PostProcess当项目以**线性色彩空间**渲染时(见[光照](/docs/zh-cn/graphics/lighting/)),只要浮点渲染目标可用——WebGPU 恒可用,WebGL2 上是几乎无处不在的 `EXT_color_buffer_float`——效果链就跑在-**半浮点 HDR** 上。超过 `1.0` 的光照累积(`intensity` 大于 1 的 `Light2D`)会*存活*进效果链,+**半浮点 HDR** 上。超过 `1.0` 的光照累积(`intensity` 大于 1 的 `Light`)会*存活*进效果链,而不是在 8 位存储处被压平:- **`threshold` 大于 1 的 `bloom`** 只让超范围能量泛光——亮光发辉光,普通 LDR 美术保持锐利。diff --git a/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx b/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdxindex d20871b2f..17404baa8 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx@@ -216,7 +216,7 @@ setTextureParams(tex.handle, TextureFilter.Nearest, TextureFilter.Nearest,给 `sprite.material` 赋值,用你自己的着色器绘制精灵——染色、溶解、扭曲——见[材质与着色器](/docs/zh-cn/graphics/materials/)。-要让精灵响应 `Light2D` 光源,最简单的路径是设 `sprite.lit = true`——无需自定义材质+要让精灵响应 `Light` 光源,最简单的路径是设 `sprite.lit = true`——无需自定义材质(用平面法线受光)。需要法线贴图或完全自定义的观感时,改用 **Lit-2D 材质**。两种方式都见[2D 光照与阴影](/docs/zh-cn/graphics/lighting/)。diff --git a/docs/astro/src/content/docs/zh-cn/graphics/video.mdx b/docs/astro/src/content/docs/zh-cn/graphics/video.mdxindex 7480cbb61..e22bd7886 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/video.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/video.mdx@@ -12,7 +12,7 @@ Estella 通过声明式的 `Video` 组件把视频播放到任何可绘制的东## 工作原理-给一个同时带有可绘制组件(`Sprite`、`UIVisual` 或 `Mesh2D`)的实体加上 `Video` 组件,+给一个同时带有可绘制组件(`Sprite`、`UIVisual` 或 `MeshRenderer`)的实体加上 `Video` 组件,视频系统就会把 `source` 解码成一张纹理,并每帧把该纹理句柄写到那个可绘制组件上。这张帧纹理是**无路径的**(永不淘汰)且稳定的,所以写一次的句柄在整条流的生命周期内一直有效。@@ -21,7 +21,7 @@ Estella 通过声明式的 `Video` 组件把视频播放到任何可绘制的东<Aside type="note">静音的片段在任何地方都能自动播放。非静音的自动播放会被拦截,直到有用户手势(浏览器策略),- 所以带声音的播放要从点击或按键开始。`Video` 需要一个 `Sprite` / `UIVisual` / `Mesh2D`+ 所以带声音的播放要从点击或按键开始。`Video` 需要一个 `Sprite` / `UIVisual` / `MeshRenderer`兄弟组件来显示——单独存在时它会解码,但没有可绘制的目标。</Aside>@@ -52,8 +52,8 @@ const spawnScreen = defineSystem([Commands()], (cmds) => {| `fitSize` | boolean | `true` | 首帧时把 Sprite 调整为视频的原生像素尺寸。 || `enabled` | boolean | `true` | 关闭即停止并释放流,而不移除组件。 |-同一个组件会驱动它找到的第一个可绘制组件,顺序为 **`Sprite` → `UIVisual` → `Mesh2D`**:-把 `Video` 放到 `UIVisual` 上做 HUD 里的视频面板,或放到 `Mesh2D` 上把片段映射到自定义几何。+同一个组件会驱动它找到的第一个可绘制组件,顺序为 **`Sprite` → `UIVisual` → `MeshRenderer`**:+把 `Video` 放到 `UIVisual` 上做 HUD 里的视频面板,或放到 `MeshRenderer` 上把片段映射到自定义几何。## 一条流,多个表面@@ -89,7 +89,7 @@ import { defineSystem, Res, VideoPlayer } from 'esengine';const playIntro = defineSystem([Res(VideoPlayer)], (video) => {const stream = video.play('assets/intro.mp4', { loop: false, muted: true });stream.onEnded = () => { /* 跳过片头 */ };- // stream.isReady 后把 stream.textureHandle 赋到某个 Sprite/Mesh2D 上+ // stream.isReady 后把 stream.textureHandle 赋到某个 Sprite/MeshRenderer 上});```@@ -137,7 +137,7 @@ const playIntro = defineSystem([Res(VideoPlayer)], (video) => {- **自动播放就保持 `muted: true`**——带声音的播放要从用户手势开始,否则浏览器会拦截。- **共享一条流**给多个表面(用纹理句柄 + `uvOffset` / `uvScale`),而不是用多个 `Video` 组件重复解码同一个片段。-- **给 Video 一个可绘制组件**——`Sprite`(世界)、`UIVisual`(HUD)或 `Mesh2D`(自定义几何)+- **给 Video 一个可绘制组件**——`Sprite`(世界)、`UIVisual`(HUD)或 `MeshRenderer`(自定义几何)——才能真正显示帧。- **注意 `fitSize`**——它会在首帧把 Sprite 贴到片段的原生像素;当你设了明确尺寸(比如固定的屏幕)时把它关掉。diff --git a/docs/astro/src/content/docs/zh-cn/publishing/hot-update.mdx b/docs/astro/src/content/docs/zh-cn/publishing/hot-update.mdxindex 57ad95378..4051285dc 100644--- a/docs/astro/src/content/docs/zh-cn/publishing/hot-update.mdx+++ b/docs/astro/src/content/docs/zh-cn/publishing/hot-update.mdx@@ -164,7 +164,7 @@ const checkForUpdates = defineSystem([Res(Assets)], (assets) => {### 零代码重绑-当场景以 `@uuid` 引用某个资产、而该资产位于远端组时,`applyUpdate` 会**全部搞定**——它下载新字节、切换清单,内建重绑器随即把旧贴图换进屏幕上每一个运行中的 `Sprite` 与 `Mesh2D`。画面自行改变,场景作者什么都不用写。(`hot-update-demo` 示例的游戏代码字面上是空的。)+当场景以 `@uuid` 引用某个资产、而该资产位于远端组时,`applyUpdate` 会**全部搞定**——它下载新字节、切换清单,内建重绑器随即把旧贴图换进屏幕上每一个运行中的 `Sprite` 与 `MeshRenderer`。画面自行改变,场景作者什么都不用写。(`hot-update-demo` 示例的游戏代码字面上是空的。)对于内建重绑器覆盖不到的东西——你手动绑定的贴图、一段音效、一个自定义系统——订阅 `onInvalidate` 自行重绑:diff --git a/docs/astro/src/data/apiStability.generated.json b/docs/astro/src/data/apiStability.generated.jsonindex f22b4a7a0..e0baa2cf0 100644--- a/docs/astro/src/data/apiStability.generated.json+++ b/docs/astro/src/data/apiStability.generated.json@@ -284,7 +284,7 @@"whyZh": "同 AI —— 而且它背后的 render graph 还在动","entry": ["Material",- "Light2D",+ "Light","PostProcessStack"]}diff --git a/docs/astro/src/data/componentDocs.ts b/docs/astro/src/data/componentDocs.tsindex a1207a0a5..ae5bd395d 100644--- a/docs/astro/src/data/componentDocs.ts+++ b/docs/astro/src/data/componentDocs.ts@@ -70,11 +70,11 @@ export const COMPONENT_DOCS: Record<string, ComponentDoc> = {FollowTarget: { category: 'graphics', summary: 'Makes a camera chase an entity, with an offset, a dead zone and eased catch-up.', doc: 'graphics/camera', anchor: 'follow-a-target', anchorZh: '跟随目标' },CameraBounds: { category: 'graphics', summary: 'The world rectangle a camera may not look outside of, so the level edge stays at the screen edge.', doc: 'graphics/camera', anchor: 'keep-the-camera-inside-the-level', anchorZh: '把相机限制在关卡内' },Canvas: { category: 'graphics', summary: 'The design resolution and scale mode a scene is authored against — one per scene root.', doc: 'core-concepts/screen', anchor: 'the-canvas-component', anchorZh: 'canvas-组件' },- Light2D: { category: 'graphics', summary: 'A 2D light — point, directional, spot or ambient — that lit renderers and Lit2D materials receive.', doc: 'graphics/lighting', anchor: 'light-types', anchorZh: '光源类型' },+ Light: { category: 'graphics', summary: 'A light — point, directional, spot or ambient — read by lit renderers, Lit2D materials and mesh shadow maps.', doc: 'graphics/lighting', anchor: 'light-types', anchorZh: '光源类型' },ShadowCaster2D: { category: 'graphics', summary: 'Marks a renderer as an occluder, so 2D lights cast shadows from its silhouette.', doc: 'graphics/lighting', anchor: 'casting-shadows', anchorZh: '投射阴影' },PostProcessVolume: { category: 'graphics', summary: 'A stack of full-screen effects (bloom, vignette, colour grading) applied after the scene is drawn.', doc: 'graphics/post-processing', anchor: 'using-a-postprocessvolume', anchorZh: '使用-postprocessvolume' },- Mesh2D: { category: 'graphics', summary: 'Arbitrary 2D geometry — your own vertices, indices and material — drawn like any other renderer.', doc: 'graphics/drawing', anchor: 'custom-meshes-mesh2d', anchorZh: '自定义网格mesh2d' },- MeshSkin: { category: 'graphics', summary: 'The joint entities that deform a Mesh2D — an imported skin, in the order its bind matrices are in.', doc: 'assets/models', anchor: 'skinning', anchorZh: '蒙皮' },+ MeshRenderer: { category: 'graphics', summary: 'Geometry drawn as an entity — your own vertices or an imported mesh, with a material and a sorting layer.', doc: 'graphics/drawing', anchor: 'custom-meshes-meshrenderer', anchorZh: '自定义网格meshrenderer' },+ MeshSkin: { category: 'graphics', summary: 'The joint entities that deform a MeshRenderer — an imported skin, in the order its bind matrices are in.', doc: 'assets/models', anchor: 'skinning', anchorZh: '蒙皮' },Video: { category: 'graphics', summary: 'Plays a video stream onto a surface in the world or the UI.', doc: 'graphics/video', anchor: 'the-video-component', anchorZh: 'video-组件' },// ── UI ─────────────────────────────────────────────────────────────────────diff --git a/docs/astro/src/data/components.generated.json b/docs/astro/src/data/components.generated.jsonindex d6d2099b7..5d5179428 100644--- a/docs/astro/src/data/components.generated.json+++ b/docs/astro/src/data/components.generated.json@@ -1564,7 +1564,7 @@]},{- "name": "Light2D",+ "name": "Light","source": "cpp","fields": [{@@ -1698,7 +1698,43 @@]},{- "name": "Mesh2D",+ "name": "MeshCollider3D",+ "source": "cpp",+ "fields": [+ {+ "key": "mesh",+ "type": "Asset<mesh>",+ "default": "none",+ "doc": "Geometry (.esmesh) to collide against."+ },+ {+ "key": "layer",+ "type": "number",+ "default": "0",+ "range": "0–15",+ "advanced": true+ },+ {+ "key": "friction",+ "type": "number",+ "default": "0.3",+ "range": "≥ 0"+ },+ {+ "key": "restitution",+ "type": "number",+ "default": "0",+ "range": "0–1"+ },+ {+ "key": "enabled",+ "type": "boolean",+ "default": "true"+ }+ ]+ },+ {+ "name": "MeshRenderer","source": "cpp","fields": [{@@ -1741,7 +1777,7 @@"key": "lit","type": "boolean","default": "false",- "doc": "Receive 2D lights: Light2D entities light this mesh (flat normal). A custom material overrides this."+ "doc": "Receive 2D lights: Light entities light this mesh (flat normal). A custom material overrides this."},{"key": "parallax",@@ -1779,42 +1815,6 @@"color.a"]},- {- "name": "MeshCollider3D",- "source": "cpp",- "fields": [- {- "key": "mesh",- "type": "Asset<mesh>",- "default": "none",- "doc": "Geometry (.esmesh) to collide against."- },- {- "key": "layer",- "type": "number",- "default": "0",- "range": "0–15",- "advanced": true- },- {- "key": "friction",- "type": "number",- "default": "0.3",- "range": "≥ 0"- },- {- "key": "restitution",- "type": "number",- "default": "0",- "range": "0–1"- },- {- "key": "enabled",- "type": "boolean",- "default": "true"- }- ]- },{"name": "MeshSkin","source": "cpp",@@ -3564,7 +3564,7 @@"key": "lit","type": "boolean","default": "false",- "doc": "Receive 2D lights: Light2D entities light this sprite (flat normal). A custom material overrides this."+ "doc": "Receive 2D lights: Light entities light this sprite (flat normal). A custom material overrides this."},{"key": "flipX",diff --git a/examples/audio-demo/assets/scenes/main.esscene b/examples/audio-demo/assets/scenes/main.essceneindex 1fdcf35e9..6da09a825 100644--- a/examples/audio-demo/assets/scenes/main.esscene+++ b/examples/audio-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/camera-follow/assets/scenes/main.esscene b/examples/camera-follow/assets/scenes/main.essceneindex b9f8fb5e8..cc4a809aa 100644--- a/examples/camera-follow/assets/scenes/main.esscene+++ b/examples/camera-follow/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/celestial-heights/assets/scenes/hud.esscene b/examples/celestial-heights/assets/scenes/hud.essceneindex 1d9982968..dc7d5bfbb 100644--- a/examples/celestial-heights/assets/scenes/hud.esscene+++ b/examples/celestial-heights/assets/scenes/hud.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "hud","folders": [],"entities": [diff --git a/examples/celestial-heights/assets/scenes/main.esscene b/examples/celestial-heights/assets/scenes/main.essceneindex a82b9e772..b626525f0 100644--- a/examples/celestial-heights/assets/scenes/main.esscene+++ b/examples/celestial-heights/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "main","folders": ["Environment",diff --git a/examples/celestial-heights/assets/scenes/moonlit-gallery.esscene b/examples/celestial-heights/assets/scenes/moonlit-gallery.essceneindex c0aede751..1633440f7 100644--- a/examples/celestial-heights/assets/scenes/moonlit-gallery.esscene+++ b/examples/celestial-heights/assets/scenes/moonlit-gallery.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "moonlit-gallery","folders": ["Environment",diff --git a/examples/celestial-heights/assets/scenes/spire.esscene b/examples/celestial-heights/assets/scenes/spire.essceneindex 9d3fc1ebd..1f7d449f0 100644--- a/examples/celestial-heights/assets/scenes/spire.esscene+++ b/examples/celestial-heights/assets/scenes/spire.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "spire","folders": ["Environment",diff --git a/examples/chat/assets/scenes/main.esscene b/examples/chat/assets/scenes/main.essceneindex d1703fea9..60b09a981 100644--- a/examples/chat/assets/scenes/main.esscene+++ b/examples/chat/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/collision-layers/assets/scenes/main.esscene b/examples/collision-layers/assets/scenes/main.essceneindex ef3115c1f..2096e5c96 100644--- a/examples/collision-layers/assets/scenes/main.esscene+++ b/examples/collision-layers/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/cutscene/assets/scenes/main.esscene b/examples/cutscene/assets/scenes/main.essceneindex 5a91b95e8..bcfa6a91d 100644--- a/examples/cutscene/assets/scenes/main.esscene+++ b/examples/cutscene/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/dragonbones-demo/assets/scenes/main.esscene b/examples/dragonbones-demo/assets/scenes/main.essceneindex e6e9604dd..a6f51c5ce 100644--- a/examples/dragonbones-demo/assets/scenes/main.esscene+++ b/examples/dragonbones-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "DragonBonesDemo","entities": [{diff --git a/examples/drawing-demo/assets/scenes/main.esscene b/examples/drawing-demo/assets/scenes/main.essceneindex 3fa8cb142..0148b4af0 100644--- a/examples/drawing-demo/assets/scenes/main.esscene+++ b/examples/drawing-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -118,7 +118,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 420, "y": -40, "z": 0 } } },{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"color": { "r": 1, "g": 1, "b": 1, "a": 1 },"layer": 1diff --git a/examples/drawing-demo/src/main.ts b/examples/drawing-demo/src/main.tsindex 8f7d5c1f3..992087257 100644--- a/examples/drawing-demo/src/main.ts+++ b/examples/drawing-demo/src/main.ts@@ -4,8 +4,8 @@// bounding boxes) re-issued from scratch every frame in a draw callback.// • Graphics — retained path recorder: a star built once and replayed with// flush(); G clears and re-records it with new parameters.-// • Mesh2D — component mesh: a scene-authored ribbon whose vertices are-// regenerated each frame and re-uploaded through the Meshes2D resource.+// • MeshRenderer — component mesh: a scene-authored ribbon whose vertices are+// regenerated each frame and re-uploaded through the MeshRenderers resource.//// Importing radar.ts / star.ts registers their draw callbacks// (registerDrawCallback) as a side effect; systems only feed them data.diff --git a/examples/drawing-demo/src/systems/ribbon.ts b/examples/drawing-demo/src/systems/ribbon.tsindex 7163517bc..d8a2b2e2f 100644--- a/examples/drawing-demo/src/systems/ribbon.ts+++ b/examples/drawing-demo/src/systems/ribbon.ts@@ -1,11 +1,11 @@import {- defineSystem, GetWorld, Res, Time, Meshes2D, type Entity,+ defineSystem, GetWorld, Res, Time, MeshRenderers, type Entity,} from 'esengine';import { RIBBON, hsv } from '../config';-// The Mesh2D tier: a component-owned triangle mesh. The Ribbon entity lives in+// The MeshRenderer tier: a component-owned triangle mesh. The Ribbon entity lives in// the scene (sorted with sprites via `layer`, saved, inspectable); this system-// regenerates its vertices every frame and re-uploads through the Meshes2D+// regenerates its vertices every frame and re-uploads through the MeshRenderers// resource — the supported mutation path (direct writes to the component's// `geometry` field are not change-detected).@@ -21,7 +21,7 @@ for (let i = 0; i < N; i++) {let ribbon: Entity | null = null;export const ribbonSystem = defineSystem(- [GetWorld(), Res(Meshes2D), Res(Time)],+ [GetWorld(), Res(MeshRenderers), Res(Time)],(world, meshes, time) => {if (ribbon === null) ribbon = world.findEntityByName('Ribbon');if (ribbon === null) return;diff --git a/examples/ecs-basics/assets/scenes/main.esscene b/examples/ecs-basics/assets/scenes/main.essceneindex 5d8d274c7..929007828 100644--- a/examples/ecs-basics/assets/scenes/main.esscene+++ b/examples/ecs-basics/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/effects-gallery/assets/scenes/main.esscene b/examples/effects-gallery/assets/scenes/main.essceneindex 67a0c076c..202ca9c73 100644--- a/examples/effects-gallery/assets/scenes/main.esscene+++ b/examples/effects-gallery/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/enemy-ai-3d/assets/scenes/main.esscene b/examples/enemy-ai-3d/assets/scenes/main.essceneindex 85f9c0b4e..3d66f1aa1 100644--- a/examples/enemy-ai-3d/assets/scenes/main.esscene+++ b/examples/enemy-ai-3d/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/enemy-ai/assets/scenes/main.esscene b/examples/enemy-ai/assets/scenes/main.essceneindex 915a69723..2aac2a31d 100644--- a/examples/enemy-ai/assets/scenes/main.esscene+++ b/examples/enemy-ai/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/event-system/assets/scenes/main.esscene b/examples/event-system/assets/scenes/main.essceneindex 5d8d274c7..929007828 100644--- a/examples/event-system/assets/scenes/main.esscene+++ b/examples/event-system/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/hello-world/assets/scenes/main.esscene b/examples/hello-world/assets/scenes/main.essceneindex 24488ff42..7c48dd2d5 100644--- a/examples/hello-world/assets/scenes/main.esscene+++ b/examples/hello-world/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/hot-update-demo/assets/scenes/main.esscene b/examples/hot-update-demo/assets/scenes/main.essceneindex c83e281a6..4cd7ff770 100644--- a/examples/hot-update-demo/assets/scenes/main.esscene+++ b/examples/hot-update-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/input-actions/assets/scenes/main.esscene b/examples/input-actions/assets/scenes/main.essceneindex 2133702ae..1ce77ea73 100644--- a/examples/input-actions/assets/scenes/main.esscene+++ b/examples/input-actions/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/input-demo/assets/scenes/main.esscene b/examples/input-demo/assets/scenes/main.essceneindex bc457cd7d..b5737f9a7 100644--- a/examples/input-demo/assets/scenes/main.esscene+++ b/examples/input-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/lighting-2d/assets/scenes/main.esscene b/examples/lighting-2d/assets/scenes/main.essceneindex abecd5917..91852133f 100644--- a/examples/lighting-2d/assets/scenes/main.esscene+++ b/examples/lighting-2d/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -37,7 +37,7 @@"children": [],"components": [{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"color": {@@ -70,7 +70,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": {diff --git a/examples/lighting-2d/src/main.ts b/examples/lighting-2d/src/main.tsindex dde38ea82..d05ec8ed8 100644--- a/examples/lighting-2d/src/main.ts+++ b/examples/lighting-2d/src/main.ts@@ -1,4 +1,4 @@-// 2D Lighting — the engine's dynamic Light2D + ShadowCaster2D system shown+// 2D Lighting — the engine's dynamic Light + ShadowCaster2D system shown// interactively. The scene is a near-black room whose walls and props have// `lit: true` on their Sprite, so they are only visible where light reaches them.//diff --git a/examples/lighting-2d/src/systems/fade.ts b/examples/lighting-2d/src/systems/fade.tsindex 8b49457d1..baab3a2ce 100644--- a/examples/lighting-2d/src/systems/fade.ts+++ b/examples/lighting-2d/src/systems/fade.ts@@ -1,17 +1,17 @@import {defineSystem, Query, Mut, Res, Time, Commands,- Sprite, Light2D, ShadowCaster2D,+ Sprite, Light, ShadowCaster2D,} from 'esengine';import { Fading } from '../components';import { PLACED_LIGHT_INTENSITY, FADE_DURATION } from '../config';// Dims placed entities to nothing over FADE_DURATION, then despawns them. The-// two queries are disjoint: a placed light has Light2D (no ShadowCaster2D), an-// obstacle has ShadowCaster2D (no Light2D), so each entity is ticked exactly+// two queries are disjoint: a placed light has Light (no ShadowCaster2D), an+// obstacle has ShadowCaster2D (no Light), so each entity is ticked exactly// once. The torch never gets a Fading component, so it is never matched here.export const fadeSystem = defineSystem([- Query(Mut(Fading), Mut(Sprite), Mut(Light2D)),+ Query(Mut(Fading), Mut(Sprite), Mut(Light)),Query(Mut(Fading), Mut(Sprite), ShadowCaster2D),Res(Time),Commands(),diff --git a/examples/lighting-2d/src/systems/place.ts b/examples/lighting-2d/src/systems/place.tsindex 4d8d5a324..ab44dd71c 100644--- a/examples/lighting-2d/src/systems/place.ts+++ b/examples/lighting-2d/src/systems/place.ts@@ -1,6 +1,6 @@import {defineSystem, Res, Input, Commands, UICameraInfo,- Transform, Sprite, Light2D, Light2DType, ShadowCaster2D,+ Transform, Sprite, Light, LightType, ShadowCaster2D,} from 'esengine';import type { UICameraData } from 'esengine';import { Fading } from '../components';@@ -32,8 +32,8 @@ export const placeSystem = defineSystem(nextColor++;const entity = cmds.spawn().insert(Transform, { position: { x, y, z: 0 } })- .insert(Light2D, {- type: Light2DType.Point,+ .insert(Light, {+ type: LightType.Point,color,intensity: PLACED_LIGHT_INTENSITY,radius: PLACED_LIGHT_RADIUS,diff --git a/examples/lighting-3d/assets/models/waver.esprefab b/examples/lighting-3d/assets/models/waver.esprefabindex 4179e6984..9906f67a5 100644--- a/examples/lighting-3d/assets/models/waver.esprefab+++ b/examples/lighting-3d/assets/models/waver.esprefab@@ -39,7 +39,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "assets/models/waver_0_0.esmesh","lit": true,@@ -145,7 +145,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "assets/models/waver_1_0.esmesh","lit": true,diff --git a/examples/lighting-3d/assets/scenes/main.esscene b/examples/lighting-3d/assets/scenes/main.essceneindex 083a77a96..1e7bdef76 100644--- a/examples/lighting-3d/assets/scenes/main.esscene+++ b/examples/lighting-3d/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -50,7 +50,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {@@ -88,7 +88,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"color": {diff --git a/examples/model-import/assets/models/robot.esprefab b/examples/model-import/assets/models/robot.esprefabindex 596fce487..abd14a8f7 100644--- a/examples/model-import/assets/models/robot.esprefab+++ b/examples/model-import/assets/models/robot.esprefab@@ -44,7 +44,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "assets/models/robot_0_0.esmesh","lit": true,@@ -85,7 +85,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "assets/models/robot_1_0.esmesh","lit": true,diff --git a/examples/model-import/assets/scenes/main.esscene b/examples/model-import/assets/scenes/main.essceneindex 1cc1a6413..1c909322a 100644--- a/examples/model-import/assets/scenes/main.esscene+++ b/examples/model-import/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -48,7 +48,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {diff --git a/examples/multiplayer-arena/assets/scenes/main.esscene b/examples/multiplayer-arena/assets/scenes/main.essceneindex 6a76fb938..c0180267e 100644--- a/examples/multiplayer-arena/assets/scenes/main.esscene+++ b/examples/multiplayer-arena/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/particle-demo/assets/scenes/main.esscene b/examples/particle-demo/assets/scenes/main.essceneindex e43fb2e14..c2385c45d 100644--- a/examples/particle-demo/assets/scenes/main.esscene+++ b/examples/particle-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/particle-demo/assets/scenes/static-emitters.esscene b/examples/particle-demo/assets/scenes/static-emitters.essceneindex 7e0a288c1..e96327c67 100644--- a/examples/particle-demo/assets/scenes/static-emitters.esscene+++ b/examples/particle-demo/assets/scenes/static-emitters.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Static Emitters","entities": [{diff --git a/examples/physics-3d/assets/scenes/main.esscene b/examples/physics-3d/assets/scenes/main.essceneindex 450f8a335..70f3c3788 100644--- a/examples/physics-3d/assets/scenes/main.esscene+++ b/examples/physics-3d/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -72,7 +72,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -128,7 +128,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -184,7 +184,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -240,7 +240,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -298,7 +298,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -356,7 +356,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -414,7 +414,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -470,7 +470,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -547,7 +547,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -595,7 +595,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:capsule","lit": true,@@ -634,7 +634,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"intensity": 1.05,@@ -667,7 +667,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"intensity": 0.42,diff --git a/examples/physics-playground/assets/scenes/main.esscene b/examples/physics-playground/assets/scenes/main.essceneindex 4b1ff522d..77891ad7d 100644--- a/examples/physics-playground/assets/scenes/main.esscene+++ b/examples/physics-playground/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/physics-playground/assets/scenes/showcase.esscene b/examples/physics-playground/assets/scenes/showcase.essceneindex e9a858ecc..a6d8be7c9 100644--- a/examples/physics-playground/assets/scenes/showcase.esscene+++ b/examples/physics-playground/assets/scenes/showcase.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Showcase","entities": [{diff --git a/examples/physics-spinner/assets/scenes/main.esscene b/examples/physics-spinner/assets/scenes/main.essceneindex 9be5874a3..595630d3b 100644--- a/examples/physics-spinner/assets/scenes/main.esscene+++ b/examples/physics-spinner/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/platformer/assets/scenes/main.esscene b/examples/platformer/assets/scenes/main.essceneindex fc0aeb360..c98b5730f 100644--- a/examples/platformer/assets/scenes/main.esscene+++ b/examples/platformer/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","folders": ["Environment",diff --git a/examples/postprocess-effects/assets/scenes/main.esscene b/examples/postprocess-effects/assets/scenes/main.essceneindex 34d01fc5c..afd21d853 100644--- a/examples/postprocess-effects/assets/scenes/main.esscene+++ b/examples/postprocess-effects/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/render-texture/assets/scenes/main.esscene b/examples/render-texture/assets/scenes/main.essceneindex b9f8fb5e8..cc4a809aa 100644--- a/examples/render-texture/assets/scenes/main.esscene+++ b/examples/render-texture/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/rich-text/assets/scenes/main.esscene b/examples/rich-text/assets/scenes/main.essceneindex bab463788..8d7807be4 100644--- a/examples/rich-text/assets/scenes/main.esscene+++ b/examples/rich-text/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/save-load/assets/scenes/main.esscene b/examples/save-load/assets/scenes/main.essceneindex 7be919d95..62c801b33 100644--- a/examples/save-load/assets/scenes/main.esscene+++ b/examples/save-load/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/scene-flow/assets/scenes/main.esscene b/examples/scene-flow/assets/scenes/main.essceneindex 0b35dddb6..8162fd03c 100644--- a/examples/scene-flow/assets/scenes/main.esscene+++ b/examples/scene-flow/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/space-shooter/assets/scenes/main.esscene b/examples/space-shooter/assets/scenes/main.essceneindex 120aa68e2..480b24df3 100644--- a/examples/space-shooter/assets/scenes/main.esscene+++ b/examples/space-shooter/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/spine-demo/assets/scenes/aran.esscene b/examples/spine-demo/assets/scenes/aran.essceneindex 5fd3ee7bd..ce43bada5 100644--- a/examples/spine-demo/assets/scenes/aran.esscene+++ b/examples/spine-demo/assets/scenes/aran.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "AranShowcase","entities": [{diff --git a/examples/spine-demo/assets/scenes/main.esscene b/examples/spine-demo/assets/scenes/main.essceneindex 797c1ea82..135bd0701 100644--- a/examples/spine-demo/assets/scenes/main.esscene+++ b/examples/spine-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SpineDemo","entities": [{diff --git a/examples/sprite-animation/assets/scenes/coins.esscene b/examples/sprite-animation/assets/scenes/coins.essceneindex e6131a97f..c27b9db72 100644--- a/examples/sprite-animation/assets/scenes/coins.esscene+++ b/examples/sprite-animation/assets/scenes/coins.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Coins","entities": [{diff --git a/examples/sprite-animation/assets/scenes/main.esscene b/examples/sprite-animation/assets/scenes/main.essceneindex 5b8471f6e..3f8822d05 100644--- a/examples/sprite-animation/assets/scenes/main.esscene+++ b/examples/sprite-animation/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/sprite-rendering/assets/scenes/main.esscene b/examples/sprite-rendering/assets/scenes/main.essceneindex fa3f71c01..141b703f0 100644--- a/examples/sprite-rendering/assets/scenes/main.esscene+++ b/examples/sprite-rendering/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/tilemap-demo/assets/scenes/hex-map.esscene b/examples/tilemap-demo/assets/scenes/hex-map.essceneindex db90b4402..9ac012be9 100644--- a/examples/tilemap-demo/assets/scenes/hex-map.esscene+++ b/examples/tilemap-demo/assets/scenes/hex-map.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Tilemap Demo","entities": [{diff --git a/examples/tilemap-demo/assets/scenes/iso-map.esscene b/examples/tilemap-demo/assets/scenes/iso-map.essceneindex 795040c67..3c76e6589 100644--- a/examples/tilemap-demo/assets/scenes/iso-map.esscene+++ b/examples/tilemap-demo/assets/scenes/iso-map.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Tilemap Demo","entities": [{diff --git a/examples/tilemap-demo/assets/scenes/native-map.esscene b/examples/tilemap-demo/assets/scenes/native-map.essceneindex 47f952a35..54c0b51b5 100644--- a/examples/tilemap-demo/assets/scenes/native-map.esscene+++ b/examples/tilemap-demo/assets/scenes/native-map.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "NativeMap","entities": [{diff --git a/examples/tilemap-demo/assets/scenes/staggered-map.esscene b/examples/tilemap-demo/assets/scenes/staggered-map.essceneindex f275aaac5..4ca6c94a8 100644--- a/examples/tilemap-demo/assets/scenes/staggered-map.esscene+++ b/examples/tilemap-demo/assets/scenes/staggered-map.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Tilemap Demo","entities": [{diff --git a/examples/tilemap-demo/assets/scenes/tiled-map.esscene b/examples/tilemap-demo/assets/scenes/tiled-map.essceneindex 97b978664..67fda173e 100644--- a/examples/tilemap-demo/assets/scenes/tiled-map.esscene+++ b/examples/tilemap-demo/assets/scenes/tiled-map.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TiledMap","entities": [{diff --git a/examples/tilemap-demo/assets/scenes/wang-map.esscene b/examples/tilemap-demo/assets/scenes/wang-map.essceneindex ed860ca7f..c3335e0dc 100644--- a/examples/tilemap-demo/assets/scenes/wang-map.esscene+++ b/examples/tilemap-demo/assets/scenes/wang-map.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Tilemap Demo","entities": [{diff --git a/examples/timers-demo/assets/scenes/main.esscene b/examples/timers-demo/assets/scenes/main.essceneindex 3c2ed143f..2d8759ab4 100644--- a/examples/timers-demo/assets/scenes/main.esscene+++ b/examples/timers-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/trail-demo/assets/scenes/main.esscene b/examples/trail-demo/assets/scenes/main.essceneindex 8b627a41b..fbcfa46b4 100644--- a/examples/trail-demo/assets/scenes/main.esscene+++ b/examples/trail-demo/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/tween-animation/assets/scenes/main.esscene b/examples/tween-animation/assets/scenes/main.essceneindex 901176f68..2eda8e143 100644--- a/examples/tween-animation/assets/scenes/main.esscene+++ b/examples/tween-animation/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/ui-controller/assets/scenes/authoring.esscene b/examples/ui-controller/assets/scenes/authoring.essceneindex 436afc867..f1062e3dd 100644--- a/examples/ui-controller/assets/scenes/authoring.esscene+++ b/examples/ui-controller/assets/scenes/authoring.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "UI Controllers & Gears","entities": [{diff --git a/examples/ui-controller/assets/scenes/main.esscene b/examples/ui-controller/assets/scenes/main.essceneindex 3c5158f33..bf50d0fe4 100644--- a/examples/ui-controller/assets/scenes/main.esscene+++ b/examples/ui-controller/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/ui-controls/assets/scenes/main.esscene b/examples/ui-controls/assets/scenes/main.essceneindex c82186ad5..26f65d800 100644--- a/examples/ui-controls/assets/scenes/main.esscene+++ b/examples/ui-controls/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/ui-events/assets/scenes/main.esscene b/examples/ui-events/assets/scenes/main.essceneindex 23849aa45..7a53a3931 100644--- a/examples/ui-events/assets/scenes/main.esscene+++ b/examples/ui-events/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "UI Events (no code)","entities": [{diff --git a/examples/ui-interaction/assets/scenes/main.esscene b/examples/ui-interaction/assets/scenes/main.essceneindex 3919cab9f..8a292eaa3 100644--- a/examples/ui-interaction/assets/scenes/main.esscene+++ b/examples/ui-interaction/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/ui-layout/assets/scenes/main.esscene b/examples/ui-layout/assets/scenes/main.essceneindex f95011bff..82d9a1440 100644--- a/examples/ui-layout/assets/scenes/main.esscene+++ b/examples/ui-layout/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/ui-list/assets/scenes/main.esscene b/examples/ui-list/assets/scenes/main.essceneindex ad75cbb8b..3b0d10aa2 100644--- a/examples/ui-list/assets/scenes/main.esscene+++ b/examples/ui-list/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/video-playback/assets/scenes/main.esscene b/examples/video-playback/assets/scenes/main.essceneindex a57cbb2d9..39967cd10 100644--- a/examples/video-playback/assets/scenes/main.esscene+++ b/examples/video-playback/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/examples/video-puzzle/assets/scenes/main.esscene b/examples/video-puzzle/assets/scenes/main.essceneindex d3d42fef8..9c511ea88 100644--- a/examples/video-puzzle/assets/scenes/main.esscene+++ b/examples/video-puzzle/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/bitmaptext.esscene b/fixtures/scenes/bitmaptext.essceneindex 84a019bcb..c151908c9 100644--- a/fixtures/scenes/bitmaptext.esscene+++ b/fixtures/scenes/bitmaptext.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "BitmapTextGate","entities": [{diff --git a/fixtures/scenes/bloom-ldr.esscene b/fixtures/scenes/bloom-ldr.essceneindex 202d04c45..e41e33e5f 100644--- a/fixtures/scenes/bloom-ldr.esscene+++ b/fixtures/scenes/bloom-ldr.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "HDR Bloom","entities": [{@@ -32,7 +32,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/camera-culling.esscene b/fixtures/scenes/camera-culling.essceneindex 90f0b931e..02ed0ac39 100644--- a/fixtures/scenes/camera-culling.esscene+++ b/fixtures/scenes/camera-culling.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Camera.cullingMask drops whole layers: the HUD (its Canvas is on layer 1) and the blue sprite (layer 2) are cleared from the mask, leaving only the green world on layer 0.","entities": [{diff --git a/fixtures/scenes/camera-parent.esscene b/fixtures/scenes/camera-parent.essceneindex 88e45db5d..73d1c69da 100644--- a/fixtures/scenes/camera-parent.esscene+++ b/fixtures/scenes/camera-parent.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "CameraParent","entities": [{diff --git a/fixtures/scenes/camera-tilt.esscene b/fixtures/scenes/camera-tilt.essceneindex 721f93921..7a6fa9018 100644--- a/fixtures/scenes/camera-tilt.esscene+++ b/fixtures/scenes/camera-tilt.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "CameraTilt","entities": [{diff --git a/fixtures/scenes/depth-layers.esscene b/fixtures/scenes/depth-layers.essceneindex a6549c3d8..2476b5b5c 100644--- a/fixtures/scenes/depth-layers.esscene+++ b/fixtures/scenes/depth-layers.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "DepthLayers","entities": [{diff --git a/fixtures/scenes/dragonbones-test.esscene b/fixtures/scenes/dragonbones-test.essceneindex 2c49a5add..02a2f5429 100644--- a/fixtures/scenes/dragonbones-test.esscene+++ b/fixtures/scenes/dragonbones-test.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "DragonBonesTest","entities": [{diff --git a/fixtures/scenes/env-triangles.esprefab b/fixtures/scenes/env-triangles.esprefabindex 58088fdaf..af109e1f4 100644--- a/fixtures/scenes/env-triangles.esprefab+++ b/fixtures/scenes/env-triangles.esprefab@@ -15,7 +15,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/env-triangles.esmesh","lit": true,diff --git a/fixtures/scenes/hdr-bloom.esscene b/fixtures/scenes/hdr-bloom.essceneindex 432d96350..e46b24400 100644--- a/fixtures/scenes/hdr-bloom.esscene+++ b/fixtures/scenes/hdr-bloom.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "HDR Bloom","entities": [{@@ -32,7 +32,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/ktx2-orientation.esscene b/fixtures/scenes/ktx2-orientation.essceneindex efb6ea2c0..cfcc03b14 100644--- a/fixtures/scenes/ktx2-orientation.esscene+++ b/fixtures/scenes/ktx2-orientation.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "KTX2 Orientation","entities": [{diff --git a/fixtures/scenes/ktx2-sprite.esscene b/fixtures/scenes/ktx2-sprite.essceneindex d64a57280..c3fd3f099 100644--- a/fixtures/scenes/ktx2-sprite.esscene+++ b/fixtures/scenes/ktx2-sprite.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "KTX2 Sprite","entities": [{diff --git a/fixtures/scenes/lit-triangles.esprefab b/fixtures/scenes/lit-triangles.esprefabindex cef61fe7b..ac86d9bc6 100644--- a/fixtures/scenes/lit-triangles.esprefab+++ b/fixtures/scenes/lit-triangles.esprefab@@ -15,7 +15,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/lit-triangles.esmesh","lit": true,diff --git a/fixtures/scenes/lut-grade.esscene b/fixtures/scenes/lut-grade.essceneindex 609e9c079..d6f4232f8 100644--- a/fixtures/scenes/lut-grade.esscene+++ b/fixtures/scenes/lut-grade.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "LutGrade","entities": [{diff --git a/fixtures/scenes/mat-builtin-lit.esscene b/fixtures/scenes/mat-builtin-lit.essceneindex 4f955894c..6c4654306 100644--- a/fixtures/scenes/mat-builtin-lit.esscene+++ b/fixtures/scenes/mat-builtin-lit.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-dissolve.esscene b/fixtures/scenes/mat-dissolve.essceneindex da6019287..c76ef2419 100644--- a/fixtures/scenes/mat-dissolve.esscene+++ b/fixtures/scenes/mat-dissolve.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/mat-env-mirror.esscene b/fixtures/scenes/mat-env-mirror.essceneindex 6c27be991..b37ece5cb 100644--- a/fixtures/scenes/mat-env-mirror.esscene+++ b/fixtures/scenes/mat-env-mirror.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -48,7 +48,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"color": {@@ -86,7 +86,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","material": "/scenes/mat-env/mirror.esmaterial",@@ -125,7 +125,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","material": "/scenes/mat-env/rough.esmaterial",diff --git a/fixtures/scenes/mat-env.esscene b/fixtures/scenes/mat-env.essceneindex d0ad75296..8ad28fdd7 100644--- a/fixtures/scenes/mat-env.esscene+++ b/fixtures/scenes/mat-env.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -48,7 +48,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"color": {@@ -81,7 +81,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"color": {"r": 1,diff --git a/fixtures/scenes/mat-graph.esscene b/fixtures/scenes/mat-graph.essceneindex 1acf5510b..0311d3b50 100644--- a/fixtures/scenes/mat-graph.esscene+++ b/fixtures/scenes/mat-graph.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/mat-instance.esscene b/fixtures/scenes/mat-instance.essceneindex 77faa5e91..e52c1d17c 100644--- a/fixtures/scenes/mat-instance.esscene+++ b/fixtures/scenes/mat-instance.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/mat-lit-flatnormal.esscene b/fixtures/scenes/mat-lit-flatnormal.essceneindex e4f9e3def..48fa9788a 100644--- a/fixtures/scenes/mat-lit-flatnormal.esscene+++ b/fixtures/scenes/mat-lit-flatnormal.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-lit-normal.esscene b/fixtures/scenes/mat-lit-normal.essceneindex 880bf87cd..6fd12f844 100644--- a/fixtures/scenes/mat-lit-normal.esscene+++ b/fixtures/scenes/mat-lit-normal.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-lit-point.esscene b/fixtures/scenes/mat-lit-point.essceneindex ec04aa776..53dd5dbfd 100644--- a/fixtures/scenes/mat-lit-point.esscene+++ b/fixtures/scenes/mat-lit-point.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-lit-shadow-dir.esscene b/fixtures/scenes/mat-lit-shadow-dir.essceneindex a01bfd176..b3c5c5b4b 100644--- a/fixtures/scenes/mat-lit-shadow-dir.esscene+++ b/fixtures/scenes/mat-lit-shadow-dir.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-lit-shadow-hard.esscene b/fixtures/scenes/mat-lit-shadow-hard.essceneindex e3988b900..1fd415d8a 100644--- a/fixtures/scenes/mat-lit-shadow-hard.esscene+++ b/fixtures/scenes/mat-lit-shadow-hard.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": -150, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-lit-shadow-soft.esscene b/fixtures/scenes/mat-lit-shadow-soft.essceneindex 77cef081c..fdacf5098 100644--- a/fixtures/scenes/mat-lit-shadow-soft.esscene+++ b/fixtures/scenes/mat-lit-shadow-soft.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": -150, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-lit-shadow.esscene b/fixtures/scenes/mat-lit-shadow.essceneindex 835c5208a..1d09a109a 100644--- a/fixtures/scenes/mat-lit-shadow.esscene+++ b/fixtures/scenes/mat-lit-shadow.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": -150, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-lit-spot.esscene b/fixtures/scenes/mat-lit-spot.essceneindex 13d45c3f0..95ad79c0b 100644--- a/fixtures/scenes/mat-lit-spot.esscene+++ b/fixtures/scenes/mat-lit-spot.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 200, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 3,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-lit.esscene b/fixtures/scenes/mat-lit.essceneindex 8ef91a47b..1d6bc0c4b 100644--- a/fixtures/scenes/mat-lit.esscene+++ b/fixtures/scenes/mat-lit.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mat-model-env.esscene b/fixtures/scenes/mat-model-env.essceneindex 2a0a5d688..cee2fe470 100644--- a/fixtures/scenes/mat-model-env.esscene+++ b/fixtures/scenes/mat-model-env.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -118,7 +118,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"color": {diff --git a/fixtures/scenes/mat-model.esscene b/fixtures/scenes/mat-model.essceneindex 63430f39f..c8d83431a 100644--- a/fixtures/scenes/mat-model.esscene+++ b/fixtures/scenes/mat-model.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -118,7 +118,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": {@@ -151,7 +151,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": {diff --git a/fixtures/scenes/mat-pbr.esscene b/fixtures/scenes/mat-pbr.essceneindex 31bf4a550..d6da93147 100644--- a/fixtures/scenes/mat-pbr.esscene+++ b/fixtures/scenes/mat-pbr.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -154,7 +154,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": {@@ -187,7 +187,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": {diff --git a/fixtures/scenes/mat-sw.esscene b/fixtures/scenes/mat-sw.essceneindex 3118dc942..c44c56032 100644--- a/fixtures/scenes/mat-sw.esscene+++ b/fixtures/scenes/mat-sw.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/mat-tex.esscene b/fixtures/scenes/mat-tex.essceneindex 15f170987..90199584e 100644--- a/fixtures/scenes/mat-tex.esscene+++ b/fixtures/scenes/mat-tex.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/mat-tint.esscene b/fixtures/scenes/mat-tint.essceneindex 3916a6967..33862b052 100644--- a/fixtures/scenes/mat-tint.esscene+++ b/fixtures/scenes/mat-tint.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/mesh-builtin.esscene b/fixtures/scenes/mesh-builtin.essceneindex 8534f2f16..3eaa0f574 100644--- a/fixtures/scenes/mesh-builtin.esscene+++ b/fixtures/scenes/mesh-builtin.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshBuiltin","entities": [{@@ -39,7 +39,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","color": { "r": 1, "g": 1, "b": 1, "a": 1 },@@ -63,7 +63,7 @@"data": { "position": { "x": 75, "y": 0, "z": 0 } }},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:sphere","color": { "r": 1, "g": 1, "b": 1, "a": 1 },@@ -87,7 +87,7 @@"data": { "position": { "x": 0, "y": 0, "z": 0 } }},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": { "r": 1, "g": 1, "b": 1, "a": 1 },diff --git a/fixtures/scenes/mesh-depth-through-capture.esscene b/fixtures/scenes/mesh-depth-through-capture.essceneindex 246f29428..ebf319efb 100644--- a/fixtures/scenes/mesh-depth-through-capture.esscene+++ b/fixtures/scenes/mesh-depth-through-capture.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshDepthThroughCapture","entities": [{@@ -22,7 +22,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 60 } } },{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","color": { "r": 1, "g": 0, "b": 0, "a": 1 },@@ -43,7 +43,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 40, "y": 0, "z": -60 } } },{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mesh-depth.esscene b/fixtures/scenes/mesh-depth.essceneindex fc4e6b68a..8056ee4f5 100644--- a/fixtures/scenes/mesh-depth.esscene+++ b/fixtures/scenes/mesh-depth.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshDepth","entities": [{@@ -48,7 +48,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"color": {"r": 1,@@ -88,7 +88,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"color": {"r": 0,diff --git a/fixtures/scenes/mesh-flat-lit.esscene b/fixtures/scenes/mesh-flat-lit.essceneindex 4f2b9d9ff..6fcb033bc 100644--- a/fixtures/scenes/mesh-flat-lit.esscene+++ b/fixtures/scenes/mesh-flat-lit.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshFlatLit","entities": [{@@ -47,7 +47,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {@@ -84,7 +84,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"color": {"r": 1,diff --git a/fixtures/scenes/mesh-flat-point-3d.esscene b/fixtures/scenes/mesh-flat-point-3d.essceneindex 2ab068021..f80880596 100644--- a/fixtures/scenes/mesh-flat-point-3d.esscene+++ b/fixtures/scenes/mesh-flat-point-3d.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshFlatPoint3D","entities": [{@@ -48,7 +48,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/white-triangles.esmesh","color": {@@ -82,7 +82,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": {diff --git a/fixtures/scenes/mesh-instanced.esscene b/fixtures/scenes/mesh-instanced.essceneindex 6eb47591f..a311f9d08 100644--- a/fixtures/scenes/mesh-instanced.esscene+++ b/fixtures/scenes/mesh-instanced.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshInstanced","entities": [{@@ -48,7 +48,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","color": {@@ -83,7 +83,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","color": {@@ -118,7 +118,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","color": {@@ -153,7 +153,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","color": {diff --git a/fixtures/scenes/mesh-lit.esscene b/fixtures/scenes/mesh-lit.essceneindex 837bc8edc..5dbf94190 100644--- a/fixtures/scenes/mesh-lit.esscene+++ b/fixtures/scenes/mesh-lit.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshLit","entities": [{@@ -47,7 +47,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {@@ -84,7 +84,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"color": {"r": 1,diff --git a/fixtures/scenes/mesh-material.esscene b/fixtures/scenes/mesh-material.essceneindex 296f1b24e..9d0198979 100644--- a/fixtures/scenes/mesh-material.esscene+++ b/fixtures/scenes/mesh-material.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshMaterial","entities": [{@@ -20,7 +20,7 @@"children": [],"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },- { "type": "Mesh2D", "data": { "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "layer": 0, "enabled": true } }+ { "type": "MeshRenderer", "data": { "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "layer": 0, "enabled": true } }],"visible": true}diff --git a/fixtures/scenes/mesh-nodes.esscene b/fixtures/scenes/mesh-nodes.essceneindex e639f63c6..197158c8a 100644--- a/fixtures/scenes/mesh-nodes.esscene+++ b/fixtures/scenes/mesh-nodes.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshNodes","entities": [{diff --git a/fixtures/scenes/mesh-normalmap.esscene b/fixtures/scenes/mesh-normalmap.essceneindex 023444911..b66ee3743 100644--- a/fixtures/scenes/mesh-normalmap.esscene+++ b/fixtures/scenes/mesh-normalmap.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshNormalMap","entities": [{@@ -48,7 +48,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {diff --git a/fixtures/scenes/mesh-point-3d.esscene b/fixtures/scenes/mesh-point-3d.essceneindex 0ec60caa7..491b0bcf4 100644--- a/fixtures/scenes/mesh-point-3d.esscene+++ b/fixtures/scenes/mesh-point-3d.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshPoint3D","entities": [{@@ -39,7 +39,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": { "r": 1, "g": 1, "b": 1, "a": 1 },@@ -62,7 +62,7 @@"data": { "position": { "x": 0, "y": 0, "z": 120 } }},{- "type": "Light2D",+ "type": "Light","data": {"type": 0,"color": { "r": 1, "g": 1, "b": 1, "a": 1 },diff --git a/fixtures/scenes/mesh2d.esscene b/fixtures/scenes/mesh-renderer.esscenesimilarity index 93%rename from fixtures/scenes/mesh2d.esscenerename to fixtures/scenes/mesh-renderer.essceneindex 23cbd2504..ce898017e 100644--- a/fixtures/scenes/mesh2d.esscene+++ b/fixtures/scenes/mesh-renderer.esscene@@ -1,6 +1,6 @@{- "version": 1,- "name": "Mesh2D",+ "version": 2,+ "name": "MeshRenderer","entities": [{"id": 0,@@ -21,7 +21,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"color": { "r": 1, "g": 1, "b": 1, "a": 1 },"layer": 0,diff --git a/fixtures/scenes/mesh2d.textures.json b/fixtures/scenes/mesh-renderer.textures.jsonsimilarity index 100%rename from fixtures/scenes/mesh2d.textures.jsonrename to fixtures/scenes/mesh-renderer.textures.jsondiff --git a/fixtures/scenes/mesh-shadow-aimed.esscene b/fixtures/scenes/mesh-shadow-aimed.essceneindex b6511ecc2..f740208ab 100644--- a/fixtures/scenes/mesh-shadow-aimed.esscene+++ b/fixtures/scenes/mesh-shadow-aimed.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshShadowAimed","entities": [{@@ -53,7 +53,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -92,7 +92,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -116,7 +116,7 @@"visible": true,"components": [{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {diff --git a/fixtures/scenes/mesh-shadow-cascade.esscene b/fixtures/scenes/mesh-shadow-cascade.essceneindex 8224d38fd..40fcbf8e7 100644--- a/fixtures/scenes/mesh-shadow-cascade.esscene+++ b/fixtures/scenes/mesh-shadow-cascade.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshShadowCascade","entities": [{@@ -55,7 +55,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -94,7 +94,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -133,7 +133,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -167,7 +167,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {diff --git a/fixtures/scenes/mesh-shadow-caster-behind.esscene b/fixtures/scenes/mesh-shadow-caster-behind.essceneindex eaa357097..9be614ac1 100644--- a/fixtures/scenes/mesh-shadow-caster-behind.esscene+++ b/fixtures/scenes/mesh-shadow-caster-behind.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshShadowCasterBehind","entities": [{@@ -55,7 +55,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -94,7 +94,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -128,7 +128,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {diff --git a/fixtures/scenes/mesh-shadow-material.esscene b/fixtures/scenes/mesh-shadow-material.essceneindex 96e3dce2a..ac949c6a8 100644--- a/fixtures/scenes/mesh-shadow-material.esscene+++ b/fixtures/scenes/mesh-shadow-material.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshShadowMaterial","entities": [{@@ -53,7 +53,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -92,7 +92,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -127,7 +127,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {diff --git a/fixtures/scenes/mesh-shadow-perspective.esscene b/fixtures/scenes/mesh-shadow-perspective.essceneindex fdd63e152..a14907fe3 100644--- a/fixtures/scenes/mesh-shadow-perspective.esscene+++ b/fixtures/scenes/mesh-shadow-perspective.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshShadowPerspective","entities": [{@@ -35,7 +35,7 @@"data": { "position": { "x": 0, "y": 0, "z": -200 }, "scale": { "x": 600, "y": 600, "z": 1 } }},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": { "r": 1, "g": 1, "b": 1, "a": 1 },@@ -58,7 +58,7 @@"data": { "position": { "x": 0, "y": 0, "z": 0 }, "scale": { "x": 150, "y": 150, "z": 1 } }},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": { "r": 1, "g": 1, "b": 1, "a": 1 },@@ -78,7 +78,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": { "r": 1, "g": 1, "b": 1, "a": 1 },diff --git a/fixtures/scenes/mesh-shadow.esscene b/fixtures/scenes/mesh-shadow.essceneindex 68dfb8f05..42f797771 100644--- a/fixtures/scenes/mesh-shadow.esscene+++ b/fixtures/scenes/mesh-shadow.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshShadow","entities": [{@@ -53,7 +53,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -92,7 +92,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "/scenes/shadow-quad.esmesh","color": {@@ -126,7 +126,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": {diff --git a/fixtures/scenes/mesh-skin-mat.esscene b/fixtures/scenes/mesh-skin-mat.essceneindex 1d2f1c24d..0f0a77621 100644--- a/fixtures/scenes/mesh-skin-mat.esscene+++ b/fixtures/scenes/mesh-skin-mat.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshSkinMaterial","entities": [{@@ -85,7 +85,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/skinned-arm.esmesh","color": {diff --git a/fixtures/scenes/mesh-skin.esscene b/fixtures/scenes/mesh-skin.essceneindex 8b50ea987..56081ad29 100644--- a/fixtures/scenes/mesh-skin.esscene+++ b/fixtures/scenes/mesh-skin.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshSkin","entities": [{@@ -47,7 +47,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/skinned-arm.esmesh","color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/mesh-sky.esscene b/fixtures/scenes/mesh-sky.essceneindex bc276336c..284d7984b 100644--- a/fixtures/scenes/mesh-sky.esscene+++ b/fixtures/scenes/mesh-sky.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshSky","entities": [{@@ -50,7 +50,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"color": {diff --git a/fixtures/scenes/mesh-textured.esscene b/fixtures/scenes/mesh-textured.essceneindex 626de7d72..d0556d8ae 100644--- a/fixtures/scenes/mesh-textured.esscene+++ b/fixtures/scenes/mesh-textured.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "MeshTextured","entities": [{diff --git a/fixtures/scenes/model-animation.esscene b/fixtures/scenes/model-animation.essceneindex 0ec60b708..6f703df38 100644--- a/fixtures/scenes/model-animation.esscene+++ b/fixtures/scenes/model-animation.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ModelAnimation","entities": [{@@ -30,7 +30,7 @@"data": { "position": { "x": 150, "y": 0, "z": 0 } }},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/moving-quad.esmesh","color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/model-material.esprefab b/fixtures/scenes/model-material.esprefabindex d18aec3d2..84520d1ac 100644--- a/fixtures/scenes/model-material.esprefab+++ b/fixtures/scenes/model-material.esprefab@@ -38,7 +38,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/model-material_0_0.esmesh","lit": true,@@ -68,7 +68,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/model-material_1_0.esmesh","lit": true,@@ -104,7 +104,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/model-material_2_0.esmesh","lit": true,diff --git a/fixtures/scenes/model-material.esscene b/fixtures/scenes/model-material.essceneindex 601f619a3..3f2565ad8 100644--- a/fixtures/scenes/model-material.esscene+++ b/fixtures/scenes/model-material.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ModelMaterial","entities": [{@@ -48,7 +48,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"color": {diff --git a/fixtures/scenes/moving-quad.esprefab b/fixtures/scenes/moving-quad.esprefabindex 887e6f5e0..ddbf53556 100644--- a/fixtures/scenes/moving-quad.esprefab+++ b/fixtures/scenes/moving-quad.esprefab@@ -15,7 +15,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/moving-quad.esmesh","enabled": truediff --git a/fixtures/scenes/node-tree.esprefab b/fixtures/scenes/node-tree.esprefabindex 4d59b6cb7..d83964bc6 100644--- a/fixtures/scenes/node-tree.esprefab+++ b/fixtures/scenes/node-tree.esprefab@@ -43,7 +43,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/node-tree_0_0.esmesh","color": {@@ -82,7 +82,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/node-tree_1_0.esmesh","color": {diff --git a/fixtures/scenes/normalmap-quad.esprefab b/fixtures/scenes/normalmap-quad.esprefabindex ef12d75c6..a32bd075e 100644--- a/fixtures/scenes/normalmap-quad.esprefab+++ b/fixtures/scenes/normalmap-quad.esprefab@@ -15,7 +15,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/normalmap-quad.esmesh","lit": true,diff --git a/fixtures/scenes/ortho-clip-behind-camera.esscene b/fixtures/scenes/ortho-clip-behind-camera.essceneindex a1d893523..da1ee7b62 100644--- a/fixtures/scenes/ortho-clip-behind-camera.esscene+++ b/fixtures/scenes/ortho-clip-behind-camera.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "OrthoClipBehindCamera","entities": [{diff --git a/fixtures/scenes/parallax-control.esscene b/fixtures/scenes/parallax-control.essceneindex 5035ecddd..9dbedd3e3 100644--- a/fixtures/scenes/parallax-control.esscene+++ b/fixtures/scenes/parallax-control.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/parallax-shape.esscene b/fixtures/scenes/parallax-shape.essceneindex 68d9b4a0b..5ccd8c20f 100644--- a/fixtures/scenes/parallax-shape.esscene+++ b/fixtures/scenes/parallax-shape.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ParallaxShape","entities": [{diff --git a/fixtures/scenes/parallax.esscene b/fixtures/scenes/parallax.essceneindex 2cb35d254..bf73eed30 100644--- a/fixtures/scenes/parallax.esscene+++ b/fixtures/scenes/parallax.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/particle-billboard.esscene b/fixtures/scenes/particle-billboard.essceneindex b0e4e4317..73ec7c8a3 100644--- a/fixtures/scenes/particle-billboard.esscene+++ b/fixtures/scenes/particle-billboard.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ParticleBillboard","entities": [{diff --git a/fixtures/scenes/particle-collision.esscene b/fixtures/scenes/particle-collision.essceneindex b03ac0502..7a60e43a2 100644--- a/fixtures/scenes/particle-collision.esscene+++ b/fixtures/scenes/particle-collision.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ParticleCollision","entities": [{diff --git a/fixtures/scenes/particle-demo.esscene b/fixtures/scenes/particle-demo.essceneindex 9ad0965b6..b511e7611 100644--- a/fixtures/scenes/particle-demo.esscene+++ b/fixtures/scenes/particle-demo.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/particle-forcefield.esscene b/fixtures/scenes/particle-forcefield.essceneindex 0e27a938c..54d2a1c75 100644--- a/fixtures/scenes/particle-forcefield.esscene+++ b/fixtures/scenes/particle-forcefield.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ParticleForceField","entities": [{diff --git a/fixtures/scenes/particle-gradient.esscene b/fixtures/scenes/particle-gradient.essceneindex 0ab9323de..8b8394aec 100644--- a/fixtures/scenes/particle-gradient.esscene+++ b/fixtures/scenes/particle-gradient.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ParticleGradient","entities": [{diff --git a/fixtures/scenes/particle-sizecurve.esscene b/fixtures/scenes/particle-sizecurve.essceneindex c623b52f4..aca16a783 100644--- a/fixtures/scenes/particle-sizecurve.esscene+++ b/fixtures/scenes/particle-sizecurve.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ParticleSizeCurve","entities": [{diff --git a/fixtures/scenes/particle-trail.esscene b/fixtures/scenes/particle-trail.essceneindex 625a5c2a7..e097318e9 100644--- a/fixtures/scenes/particle-trail.esscene+++ b/fixtures/scenes/particle-trail.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "ParticleTrail","entities": [{diff --git a/fixtures/scenes/pixel-perfect.esscene b/fixtures/scenes/pixel-perfect.essceneindex 7a384fd2b..fb711a5f2 100644--- a/fixtures/scenes/pixel-perfect.esscene+++ b/fixtures/scenes/pixel-perfect.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/platformer.esscene b/fixtures/scenes/platformer.essceneindex 9fb18a3b3..357936183 100644--- a/fixtures/scenes/platformer.esscene+++ b/fixtures/scenes/platformer.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/point-shadow.esscene b/fixtures/scenes/point-shadow.essceneindex e37efe495..b57f12d8b 100644--- a/fixtures/scenes/point-shadow.esscene+++ b/fixtures/scenes/point-shadow.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "PointShadow","entities": [{@@ -13,28 +13,28 @@"id": 1, "name": "Ground", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": -100 }, "scale": { "x": 800, "y": 800, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 2, "name": "BlockerLeft", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": -100, "y": 0, "z": -50 }, "scale": { "x": 50, "y": 50, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 3, "name": "BlockerBelow", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": -100, "z": -50 }, "scale": { "x": 50, "y": 50, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 4, "name": "Lamp", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },- { "type": "Light2D", "data": { "type": 0, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "radius": 2000, "meshShadows": true } }+ { "type": "Light", "data": { "type": 0, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "radius": 2000, "meshShadows": true } }]}]diff --git a/fixtures/scenes/postprocess-effects.esscene b/fixtures/scenes/postprocess-effects.essceneindex b6bd3962d..49d9e2a45 100644--- a/fixtures/scenes/postprocess-effects.esscene+++ b/fixtures/scenes/postprocess-effects.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/shadow-quad.esprefab b/fixtures/scenes/shadow-quad.esprefabindex 6cee602a7..df1ae985e 100644--- a/fixtures/scenes/shadow-quad.esprefab+++ b/fixtures/scenes/shadow-quad.esprefab@@ -15,7 +15,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/shadow-quad.esmesh","lit": true,diff --git a/fixtures/scenes/skinned-arm.esprefab b/fixtures/scenes/skinned-arm.esprefabindex 82d7856e9..2617f14b8 100644--- a/fixtures/scenes/skinned-arm.esprefab+++ b/fixtures/scenes/skinned-arm.esprefab@@ -64,7 +64,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/skinned-arm.esmesh","enabled": truediff --git a/fixtures/scenes/soft-shadow-contact.esscene b/fixtures/scenes/soft-shadow-contact.essceneindex 770acf877..6e450491a 100644--- a/fixtures/scenes/soft-shadow-contact.esscene+++ b/fixtures/scenes/soft-shadow-contact.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SoftShadowContact","entities": [{@@ -13,21 +13,21 @@"id": 1, "name": "Ground", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": -200 }, "scale": { "x": 900, "y": 900, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 2, "name": "Blocker", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 80, "y": 0, "z": -160 }, "scale": { "x": 100, "y": 100, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 3, "name": "Lamp", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": -100, "y": 0, "z": 200 } } },- { "type": "Light2D", "data": { "type": 3, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "radius": 3000, "innerAngle": 80, "outerAngle": 90, "meshShadows": true, "shadowSoftness": 40 } }+ { "type": "Light", "data": { "type": 3, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "radius": 3000, "innerAngle": 80, "outerAngle": 90, "meshShadows": true, "shadowSoftness": 40 } }]}]diff --git a/fixtures/scenes/soft-shadow.esscene b/fixtures/scenes/soft-shadow.essceneindex e398efe38..bc09965a1 100644--- a/fixtures/scenes/soft-shadow.esscene+++ b/fixtures/scenes/soft-shadow.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SoftShadow","entities": [{@@ -13,21 +13,21 @@"id": 1, "name": "Ground", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": -200 }, "scale": { "x": 900, "y": 900, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 2, "name": "Blocker", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 }, "scale": { "x": 100, "y": 100, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 3, "name": "Lamp", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": -100, "y": 0, "z": 200 } } },- { "type": "Light2D", "data": { "type": 3, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "radius": 3000, "innerAngle": 80, "outerAngle": 90, "meshShadows": true, "shadowSoftness": 40 } }+ { "type": "Light", "data": { "type": 3, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "radius": 3000, "innerAngle": 80, "outerAngle": 90, "meshShadows": true, "shadowSoftness": 40 } }]}]diff --git a/fixtures/scenes/sort-view-depth.esscene b/fixtures/scenes/sort-view-depth.essceneindex d95f45eb9..9a0f14326 100644--- a/fixtures/scenes/sort-view-depth.esscene+++ b/fixtures/scenes/sort-view-depth.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SortViewDepth","entities": [{diff --git a/fixtures/scenes/space-shooter.esscene b/fixtures/scenes/space-shooter.essceneindex e21b43f11..1763b246d 100644--- a/fixtures/scenes/space-shooter.esscene+++ b/fixtures/scenes/space-shooter.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/spine-test.esscene b/fixtures/scenes/spine-test.essceneindex b41bc9263..01bd60f03 100644--- a/fixtures/scenes/spine-test.esscene+++ b/fixtures/scenes/spine-test.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SpineTest","entities": [{diff --git a/fixtures/scenes/spot-shadow.esscene b/fixtures/scenes/spot-shadow.essceneindex 23ad95b26..f194715b0 100644--- a/fixtures/scenes/spot-shadow.esscene+++ b/fixtures/scenes/spot-shadow.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SpotShadow","entities": [{@@ -13,21 +13,21 @@"id": 1, "name": "Ground", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": -200 }, "scale": { "x": 600, "y": 600, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 2, "name": "Blocker", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 }, "scale": { "x": 150, "y": 150, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 3, "name": "Spot", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": -100, "y": 0, "z": 400 } } },- { "type": "Light2D", "data": { "type": 3, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "radius": 2000, "innerAngle": 80, "outerAngle": 90, "meshShadows": true } }+ { "type": "Light", "data": { "type": 3, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "radius": 2000, "innerAngle": 80, "outerAngle": 90, "meshShadows": true } }]}]diff --git a/fixtures/scenes/sprite-lit.esscene b/fixtures/scenes/sprite-lit.essceneindex 94a1dc5c4..eca534acc 100644--- a/fixtures/scenes/sprite-lit.esscene+++ b/fixtures/scenes/sprite-lit.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{@@ -39,7 +39,7 @@"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"color": { "r": 0, "g": 1, "b": 0, "a": 1 },diff --git a/fixtures/scenes/sprite-rendering.esscene b/fixtures/scenes/sprite-rendering.essceneindex 3aa4af823..bd7400e59 100644--- a/fixtures/scenes/sprite-rendering.esscene+++ b/fixtures/scenes/sprite-rendering.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/srgb-midtone.esscene b/fixtures/scenes/srgb-midtone.essceneindex 4921e4b33..2136fdb41 100644--- a/fixtures/scenes/srgb-midtone.esscene+++ b/fixtures/scenes/srgb-midtone.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "sRGB Midtone Roundtrip","entities": [{diff --git a/fixtures/scenes/sun-shadow-contact.esscene b/fixtures/scenes/sun-shadow-contact.essceneindex abc9f2085..4b1dc307e 100644--- a/fixtures/scenes/sun-shadow-contact.esscene+++ b/fixtures/scenes/sun-shadow-contact.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SunShadowContact","entities": [{@@ -13,21 +13,21 @@"id": 1, "name": "Ground", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": -100 }, "scale": { "x": 1000, "y": 1000, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 2, "name": "Blocker", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": -1.25, "y": 0, "z": -75 }, "scale": { "x": 20, "y": 20, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 3, "name": "Sun", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },- { "type": "Light2D", "data": { "type": 1, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "direction": { "x": 0.25, "y": 0 }, "meshShadows": true, "shadowExtent": 500, "sourceAngle": 5.6 } }+ { "type": "Light", "data": { "type": 1, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "direction": { "x": 0.25, "y": 0 }, "meshShadows": true, "shadowExtent": 500, "sourceAngle": 5.6 } }]}]diff --git a/fixtures/scenes/sun-shadow.esscene b/fixtures/scenes/sun-shadow.essceneindex 12a7dae8b..5a45486a0 100644--- a/fixtures/scenes/sun-shadow.esscene+++ b/fixtures/scenes/sun-shadow.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SunShadow","entities": [{@@ -13,21 +13,21 @@"id": 1, "name": "Ground", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": -100 }, "scale": { "x": 1000, "y": 1000, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 2, "name": "Blocker", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": -20, "y": 0, "z": 0 }, "scale": { "x": 20, "y": 20, "z": 1 } } },- { "type": "Mesh2D", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }+ { "type": "MeshRenderer", "data": { "mesh": "/scenes/shadow-quad.esmesh", "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "lit": true, "opaque": true, "enabled": true } }]},{"id": 3, "name": "Sun", "parent": null, "children": [], "visible": true,"components": [{ "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },- { "type": "Light2D", "data": { "type": 1, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "direction": { "x": 0.25, "y": 0 }, "meshShadows": true, "shadowExtent": 500, "sourceAngle": 5.6 } }+ { "type": "Light", "data": { "type": 1, "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, "intensity": 1, "direction": { "x": 0.25, "y": 0 }, "meshShadows": true, "shadowExtent": 500, "sourceAngle": 5.6 } }]}]diff --git a/fixtures/scenes/textured-quad.esprefab b/fixtures/scenes/textured-quad.esprefabindex a225b6d64..20a451a16 100644--- a/fixtures/scenes/textured-quad.esprefab+++ b/fixtures/scenes/textured-quad.esprefab@@ -15,7 +15,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/textured-quad.esmesh","texture": "scenes/textured-quad_0.png",diff --git a/fixtures/scenes/tilemap-flip.esscene b/fixtures/scenes/tilemap-flip.essceneindex 2a5ede70a..871542d1c 100644--- a/fixtures/scenes/tilemap-flip.esscene+++ b/fixtures/scenes/tilemap-flip.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TilemapFlip","entities": [{diff --git a/fixtures/scenes/tilemap-gidobj.esscene b/fixtures/scenes/tilemap-gidobj.essceneindex 12769c868..6f4452a9c 100644--- a/fixtures/scenes/tilemap-gidobj.esscene+++ b/fixtures/scenes/tilemap-gidobj.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TilemapGidObject","entities": [{diff --git a/fixtures/scenes/tilemap-hex.esscene b/fixtures/scenes/tilemap-hex.essceneindex e015d21d6..8bfc9ea93 100644--- a/fixtures/scenes/tilemap-hex.esscene+++ b/fixtures/scenes/tilemap-hex.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TilemapHex","entities": [{diff --git a/fixtures/scenes/tilemap-multiset.esscene b/fixtures/scenes/tilemap-multiset.essceneindex 83de6dd17..b0d4f36de 100644--- a/fixtures/scenes/tilemap-multiset.esscene+++ b/fixtures/scenes/tilemap-multiset.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TilemapMultiset","entities": [{diff --git a/fixtures/scenes/tilemap-oob.esscene b/fixtures/scenes/tilemap-oob.essceneindex e557f753a..b2c0161f4 100644--- a/fixtures/scenes/tilemap-oob.esscene+++ b/fixtures/scenes/tilemap-oob.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TilemapOutOfRange","entities": [{diff --git a/fixtures/scenes/tilemap-parallax.esscene b/fixtures/scenes/tilemap-parallax.essceneindex 975cdb9b7..3563092c2 100644--- a/fixtures/scenes/tilemap-parallax.esscene+++ b/fixtures/scenes/tilemap-parallax.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TilemapParallax","entities": [{diff --git a/fixtures/scenes/tilemap-spacing.esscene b/fixtures/scenes/tilemap-spacing.essceneindex 73d960cb9..c6ab07bed 100644--- a/fixtures/scenes/tilemap-spacing.esscene+++ b/fixtures/scenes/tilemap-spacing.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TilemapSpacing","entities": [{diff --git a/fixtures/scenes/tilemap-transform.esscene b/fixtures/scenes/tilemap-transform.essceneindex 8e674dd68..afcadc63b 100644--- a/fixtures/scenes/tilemap-transform.esscene+++ b/fixtures/scenes/tilemap-transform.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TilemapTransform","entities": [{diff --git a/fixtures/scenes/trail.esscene b/fixtures/scenes/trail.essceneindex 479a4049b..ee007a7d4 100644--- a/fixtures/scenes/trail.esscene+++ b/fixtures/scenes/trail.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Trail","entities": [{diff --git a/fixtures/scenes/two-triangles.esprefab b/fixtures/scenes/two-triangles.esprefabindex f08619325..f69c89432 100644--- a/fixtures/scenes/two-triangles.esprefab+++ b/fixtures/scenes/two-triangles.esprefab@@ -15,7 +15,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/two-triangles.esmesh","enabled": truediff --git a/fixtures/scenes/ui-layout.esscene b/fixtures/scenes/ui-layout.essceneindex e70c337ee..d761f5979 100644--- a/fixtures/scenes/ui-layout.esscene+++ b/fixtures/scenes/ui-layout.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/fixtures/scenes/ui-list-mask.esscene b/fixtures/scenes/ui-list-mask.essceneindex e0d8afb2c..8438ac38e 100644--- a/fixtures/scenes/ui-list-mask.esscene+++ b/fixtures/scenes/ui-list-mask.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "UIMask (Scissor) clips overflowing content to the viewport — the primitive createListView relies on","entities": [{diff --git a/fixtures/scenes/ui-node-absolute.esscene b/fixtures/scenes/ui-node-absolute.essceneindex d34964957..390f3352e 100644--- a/fixtures/scenes/ui-node-absolute.esscene+++ b/fixtures/scenes/ui-node-absolute.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "UINode absolute positioning / inset (REARCH_GUI F3 unification)","entities": [{diff --git a/fixtures/scenes/ui-node-flex.esscene b/fixtures/scenes/ui-node-flex.essceneindex bcc61ead2..78726e2a4 100644--- a/fixtures/scenes/ui-node-flex.esscene+++ b/fixtures/scenes/ui-node-flex.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "UINode single-pass flex layout (REARCH_GUI F3.2)","entities": [{diff --git a/fixtures/scenes/ui-screen-root.esscene b/fixtures/scenes/ui-screen-root.essceneindex b8db0947d..85e499b09 100644--- a/fixtures/scenes/ui-screen-root.esscene+++ b/fixtures/scenes/ui-screen-root.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Screen root tracks the camera; parented UI rides its parent. The camera starts at the origin and is driven away at runtime, so the layout box moves without resizing.","entities": [{diff --git a/fixtures/scenes/ui-text-effects.esscene b/fixtures/scenes/ui-text-effects.essceneindex bd6f967f8..cf10dd4f7 100644--- a/fixtures/scenes/ui-text-effects.esscene+++ b/fixtures/scenes/ui-text-effects.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SDF text outline + shadow (REARCH_GUI F8)","entities": [{diff --git a/fixtures/scenes/ui-text-overflow.esscene b/fixtures/scenes/ui-text-overflow.essceneindex b05596f3a..5d30828ed 100644--- a/fixtures/scenes/ui-text-overflow.esscene+++ b/fixtures/scenes/ui-text-overflow.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "TextOverflow — Visible beside Clip","entities": [{diff --git a/fixtures/scenes/ui-text-rect.esscene b/fixtures/scenes/ui-text-rect.essceneindex 392bdfc0a..5e4734ca1 100644--- a/fixtures/scenes/ui-text-rect.esscene+++ b/fixtures/scenes/ui-text-rect.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SDF Text in UIRect","entities": [{diff --git a/fixtures/scenes/ui-text-sdf.esscene b/fixtures/scenes/ui-text-sdf.essceneindex 3c7d6ec15..414b5f107 100644--- a/fixtures/scenes/ui-text-sdf.esscene+++ b/fixtures/scenes/ui-text-sdf.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SDF Text Verify","entities": [{diff --git a/fixtures/scenes/ui-text-uinode.esscene b/fixtures/scenes/ui-text-uinode.essceneindex e29fd6578..18fda2a34 100644--- a/fixtures/scenes/ui-text-uinode.esscene+++ b/fixtures/scenes/ui-text-uinode.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Text laid out in a UINode box (REARCH_GUI S1)","entities": [{diff --git a/fixtures/scenes/ui-text-zorder.esscene b/fixtures/scenes/ui-text-zorder.essceneindex ded9be8c2..59540a5dc 100644--- a/fixtures/scenes/ui-text-zorder.esscene+++ b/fixtures/scenes/ui-text-zorder.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SDF Text z-order over UI","entities": [{diff --git a/fixtures/scenes/ui-textinput.esscene b/fixtures/scenes/ui-textinput.essceneindex 3fd232845..ae8743094 100644--- a/fixtures/scenes/ui-textinput.esscene+++ b/fixtures/scenes/ui-textinput.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "SDF TextInput (REARCH_GUI F8)","entities": [{diff --git a/fixtures/scenes/ui-visual-filled.esscene b/fixtures/scenes/ui-visual-filled.essceneindex 8841c3c99..c5935ed0c 100644--- a/fixtures/scenes/ui-visual-filled.esscene+++ b/fixtures/scenes/ui-visual-filled.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "UIVisual Filled — geometry+UV crop reveals a solid/textured fill along fillMethod/fillOrigin (progress/slider basis)","entities": [{diff --git a/fixtures/scenes/video-playback.esscene b/fixtures/scenes/video-playback.essceneindex 8ea50cdda..e322ad43a 100644--- a/fixtures/scenes/video-playback.esscene+++ b/fixtures/scenes/video-playback.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "VideoPlayback","entities": [{diff --git a/fixtures/scenes/video-ui.esscene b/fixtures/scenes/video-ui.essceneindex 2eb400e29..02ed2c521 100644--- a/fixtures/scenes/video-ui.esscene+++ b/fixtures/scenes/video-ui.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "VideoUI","entities": [{diff --git a/fixtures/scenes/white-triangles.esprefab b/fixtures/scenes/white-triangles.esprefabindex 003c6281b..7b1d5dabf 100644--- a/fixtures/scenes/white-triangles.esprefab+++ b/fixtures/scenes/white-triangles.esprefab@@ -15,7 +15,7 @@"data": {}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "scenes/white-triangles.esmesh","enabled": truediff --git a/fixtures/scenes/ysort.esscene b/fixtures/scenes/ysort.essceneindex c1bc56dd5..f370a795b 100644--- a/fixtures/scenes/ysort.esscene+++ b/fixtures/scenes/ysort.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "YSort","entities": [{diff --git a/native/host/bindings/EcsBindings.cpp b/native/host/bindings/EcsBindings.cppindex 94df6f6f3..8d035523a 100644--- a/native/host/bindings/EcsBindings.cpp+++ b/native/host/bindings/EcsBindings.cpp@@ -24,7 +24,7 @@#include "esengine/ecs/TransformSystem.hpp" // ecs::setParent#include "esengine/ecs/components/Hierarchy.hpp" // Parent / Children-#include "esengine/ecs/components/Mesh2D.hpp" // MeshSkin+#include "esengine/ecs/components/MeshRenderer.hpp" // MeshSkinusing namespace esengine;diff --git a/pipeline/src/assets/gltfImport.ts b/pipeline/src/assets/gltfImport.tsindex b40b15df4..229183569 100644--- a/pipeline/src/assets/gltfImport.ts+++ b/pipeline/src/assets/gltfImport.ts@@ -433,7 +433,7 @@ function readSampler(ctx: MaterialContext, index: number | undefined,return Object.keys(out).length > 0 ? out : undefined;}-/** Resolves a glTF texture index to the file a Mesh2D will sample, extracting inline images. */+/** Resolves a glTF texture index to the file a MeshRenderer will sample, extracting inline images. */function readTexture(ctx: MaterialContext, cache: Map<number, ImportedImageRef | null>,ref: GltfTextureRef, label: string): ImportedImageRef | null {if (ref.texCoord) ctx.warnings.push(`${label}: TEXCOORD_${ref.texCoord} is not imported (one UV set)`);diff --git a/pipeline/src/assets/modelImport.ts b/pipeline/src/assets/modelImport.tsindex 75f37214b..f0a302c47 100644--- a/pipeline/src/assets/modelImport.ts+++ b/pipeline/src/assets/modelImport.ts@@ -44,7 +44,7 @@ export interface ImportedImageRef {/*** A material, split by what can carry it: baseColor is `texture(uv) *- * vertexColor * tint`, which a Mesh2D's own fields say, and the shading around+ * vertexColor * tint`, which a MeshRenderer's own fields say, and the shading around* it becomes an `.esmaterial` (@ref materialProducts). What neither can express* is reported, not dropped.*/@@ -76,7 +76,7 @@ export interface ImportedMaterial {cullBackfaces: boolean;}-/** A material product: the shading a Mesh2D's own fields cannot say. */+/** A material product: the shading a MeshRenderer's own fields cannot say. */export interface ImportedMaterialAsset {/** `<stem>_m<material index>` — stable across re-imports, so overrides keep matching. */name: string;@@ -328,7 +328,7 @@ function materialImageRef(image: ImportedImageRef, refs: ProductRefs): string {}/**- * Whether this material says anything a Mesh2D's own fields cannot: shading is+ * Whether this material says anything a MeshRenderer's own fields cannot: shading is* per-material constants and samplers, and the component has neither. A metal-* roughness pair the engine's defaults already are needs nothing written — but* glTF defaults both factors to 1, so most materials do.@@ -416,7 +416,7 @@ function meshComponent(mesh: ImportedMesh, stem: string, refs: ProductRefs): Com// unlit variant and the map would be a reference to nothing.const normalMap = !material && hasNormals && mesh.material?.normalTexture? imageRef(mesh.material.normalTexture, refs) : null;- return { type: 'Mesh2D', data: {+ return { type: 'MeshRenderer', data: {mesh: `${prefix}${mesh.name}.esmesh`,// Geometry that carries normals was authored to be shaded, so the product// says so. Written rather than assumed: `lit` is a field a user can turn@@ -476,7 +476,7 @@ export function assembleModelPrefab(name: string, meshes: ImportedMesh[],const emitNode = (node: ImportedNode, parent: string | null, rootScale?: number): string => {const id = `n${node.index}`;const drawn = node.meshes.map(i => meshes[i]).filter((m): m is ImportedMesh => !!m);- // One primitive rides the node itself; several cannot, since a Mesh2D+ // One primitive rides the node itself; several cannot, since a MeshRenderer// draws one mesh — they become its children, at its own origin.const own = drawn.length === 1 && drawn[0]? [meshComponent(drawn[0], name, refs), ...skinComponent(drawn[0])] : [];diff --git a/pipeline/tests/document-ref-cook-deps.test.ts b/pipeline/tests/document-ref-cook-deps.test.tsindex ad19d8981..ab75846d0 100644--- a/pipeline/tests/document-ref-cook-deps.test.ts+++ b/pipeline/tests/document-ref-cook-deps.test.ts@@ -71,7 +71,7 @@ const scene = JSON.stringify({entities: [{id: 1, name: 'Sky', parent: null, children: [],- components: [{ type: 'Light2D', data: { type: 2, environment: 'assets/env/sky.esenv' } }],+ components: [{ type: 'Light', data: { type: 2, environment: 'assets/env/sky.esenv' } }],},{id: 2, name: 'Actor', parent: null, children: [],@@ -160,7 +160,7 @@ describe('assets named only inside another document are cooked', () => {version: '1.0', name: 'm',entities: [{id: 1, name: 'Cube', parent: null, children: [],- components: [{ type: 'Mesh2D', data: { mesh: 'builtin:cube', lit: true } }],+ components: [{ type: 'MeshRenderer', data: { mesh: 'builtin:cube', lit: true } }],}],}));const res = await cookAssets(lone, {@@ -195,7 +195,7 @@ describe('assets named only inside another document are cooked', () => {version: '1.0', name: 'm',entities: [{id: 1, name: 'Sky', parent: null, children: [],- components: [{ type: 'Light2D', data: { type: 2, environment: 'assets/env/gone.esenv' } }],+ components: [{ type: 'Light', data: { type: 2, environment: 'assets/env/gone.esenv' } }],}],}));const res = await cookAssets(lone, { entryScenes: ['assets/scenes/main.esscene'], outDir: 'build' });diff --git a/pipeline/tests/fbx-import.test.ts b/pipeline/tests/fbx-import.test.tsindex 5093b7ca2..f799c9424 100644--- a/pipeline/tests/fbx-import.test.ts+++ b/pipeline/tests/fbx-import.test.ts@@ -114,7 +114,7 @@ describe('fbx materials', () => {expect(externalFiles).toEqual(['textures/brick.png']);});- it('writes an .esmaterial for what a Mesh2D cannot say', async () => {+ it('writes an .esmaterial for what a MeshRenderer cannot say', async () => {const { meshes } = await importFbxMeshes(texturedTriangle(), 'tri', 'tri.fbx');const products = materialProducts(meshes, 'tri');expect(products).toHaveLength(1);diff --git a/pipeline/tests/gltf-import.test.ts b/pipeline/tests/gltf-import.test.tsindex 41e8aec15..4de0815c5 100644--- a/pipeline/tests/gltf-import.test.ts+++ b/pipeline/tests/gltf-import.test.ts@@ -327,7 +327,7 @@ describe('glTF material products', () => {return { meshes, products: materialProducts(meshes, 'model', refs) };};- it('writes nothing for a material a Mesh2D already carries whole', async () => {+ it('writes nothing for a material a MeshRenderer already carries whole', async () => {// baseColor is the component's own texture x colour, so a material here// would be a second file saying what the first one says.const { products } = await productsOf(withInlineImage());@@ -364,9 +364,9 @@ describe('glTF material products', () => {{ prefix: 'assets/models/' });expect(products[0]!.data.properties.u_normalMap).toBe('model_0.png');const prefab = assembleModelPrefab('model', meshes, { refs: { prefix: 'assets/models/' } });- const mesh2d = prefab.entities[1]!.components[1]!.data;- expect(mesh2d.material).toBe('assets/models/model_m0.esmaterial');- expect(mesh2d.normalMap).toBeUndefined();+ const meshRenderer = prefab.entities[1]!.components[1]!.data;+ expect(meshRenderer.material).toBe('assets/models/model_m0.esmaterial');+ expect(meshRenderer.normalMap).toBeUndefined();});it('says the render state the draw would otherwise have said itself', async () => {@@ -394,7 +394,7 @@ describe('glTF material products', () => {expect(materialProducts(meshes, 'model', refs)).toHaveLength(1);const prefab = assembleModelPrefab('model', meshes, { refs });const refsUsed = prefab.entities.flatMap(e => e.components- .filter(c => c.type === 'Mesh2D').map(c => c.data.material));+ .filter(c => c.type === 'MeshRenderer').map(c => c.data.material));expect(refsUsed).toEqual(['assets/models/model_m0.esmaterial','assets/models/model_m0.esmaterial']);});@@ -428,7 +428,7 @@ describe('glTF prefab assembly', () => {expect(prefab.entities).toHaveLength(1);expect(prefab.rootEntityId).toBe('n0');expect(prefab.entities[0]!.components[1]).toEqual({- type: 'Mesh2D',+ type: 'MeshRenderer',data: {mesh: 'assets/models/model.esmesh',texture: 'assets/models/model_0.png',diff --git a/pipeline/tests/target-support.test.ts b/pipeline/tests/target-support.test.tsindex 5e7275964..a13a5bd3e 100644--- a/pipeline/tests/target-support.test.ts+++ b/pipeline/tests/target-support.test.ts@@ -43,7 +43,7 @@ describe('collectSubsystems', () => {});it('says nothing about a project that only uses what every target has', () => {- const scene = { entities: [{ components: [{ type: 'Sprite' }, { type: 'Light2D' }, { type: 'TrailRenderer' }] }] };+ const scene = { entities: [{ components: [{ type: 'Sprite' }, { type: 'Light' }, { type: 'TrailRenderer' }] }] };expect(collectSubsystems(scene).size).toBe(0);});diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.mdindex 801b8fe70..a32742ba0 100644--- a/sdk/etc/index.api.md+++ b/sdk/etc/index.api.md@@ -5,7 +5,7 @@ Symbols: 113 public · 66 beta · 1515 experimental · 3 deprecated## ABI_LAYOUT_HASH — const @experimental```-"dc813d9c5d77b235"+"43f91684e5f3d3fb"```## ANCHOR_AXES — const @experimental@@ -4032,12 +4032,12 @@ static prototype: LifecyclePluginautoPause: boolean | undefined```-## Light2D — const @experimental+## Light — const @experimental```-BuiltinComponentDef<Light2DData>+BuiltinComponentDef<LightData>```-## Light2DData — interface @experimental+## LightData — interface @experimental```color: ColordrawEnvironment: boolean@@ -4055,7 +4055,7 @@ sourceAngle: numbertype: number```-## Light2DType — enum @experimental+## LightType — enum @experimental```Ambient = 2Directional = 1@@ -4468,54 +4468,6 @@ static pair: (options?: MemoryTransportOptions) => [MemoryTransport, MemoryTransstatic prototype: MemoryTransport```-## Mesh2D — const @experimental-```-BuiltinComponentDef<Mesh2DData>-```--## Mesh2DAPI — class @experimental-```-clearGeometry: (entity: Entity) => void-getGeometry: (entity: Entity) => Mesh2DGeometry | undefined-setGeometry: (entity: Entity, geometry: Mesh2DGeometry) => void-static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): Mesh2DAPI-static prototype: Mesh2DAPI-```--## Mesh2DData — interface @experimental-```-color: Color-cullBackfaces: boolean-enabled: boolean-geometry: Mesh2DGeometry-layer: number-lit: boolean-material: number-mesh: number-normalMap: number-opaque: boolean-parallax: Vec2-texture: number-```--## Mesh2DGeometry — interface @experimental-```-colors: number[] | undefined-indices: number[]-positions: number[]-uvs: number[] | undefined-```--## Mesh2DPlugin — class @experimental-```-build: (app: App) => void-cleanup: () => void-name: string-profileDomain: "render"-static new (): Mesh2DPlugin-static prototype: Mesh2DPlugin-```-## MeshChannel — const @experimental```{ readonly Position: 0; readonly Color: 1; readonly TexCoord0: 2; readonly Normal: 3; readonly Tangent: 4; readonly Joints: 5; readonly Weights: 6; }@@ -4560,14 +4512,62 @@ vertexStride: numbervertices: Uint8Array<ArrayBufferLike>```-## MeshResult — interface @experimental+## MeshRenderer — const @experimental```-handle: number+BuiltinComponentDef<MeshRendererData>+```++## MeshRendererAPI — class @experimental+```+clearGeometry: (entity: Entity) => void+getGeometry: (entity: Entity) => MeshRendererGeometry | undefined+setGeometry: (entity: Entity, geometry: MeshRendererGeometry) => void+static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): MeshRendererAPI+static prototype: MeshRendererAPI+```++## MeshRendererData — interface @experimental+```+color: Color+cullBackfaces: boolean+enabled: boolean+geometry: MeshRendererGeometry+layer: number+lit: boolean+material: number+mesh: number+normalMap: number+opaque: boolean+parallax: Vec2+texture: number+```++## MeshRendererGeometry — interface @experimental+```+colors: number[] | undefined+indices: number[]+positions: number[]+uvs: number[] | undefined```-## Meshes2D — const @experimental+## MeshRendererPlugin — class @experimental```-ResourceDef<Mesh2DAPI>+build: (app: App) => void+cleanup: () => void+name: string+profileDomain: "render"+static new (): MeshRendererPlugin+static prototype: MeshRendererPlugin+```++## MeshRenderers — const @experimental+```+ResourceDef<MeshRendererAPI>+```++## MeshResult — interface @experimental+```+handle: number```## MessageHandler — type @experimental@@ -6604,7 +6604,7 @@ ComponentDef<{}>## SCENE_FORMAT_VERSION — const @experimental```-1+2```## SCREEN_FIT_OFF — const @experimental@@ -11017,9 +11017,9 @@ Logger(text: string, opts: MeasureTextOptions): TextMetrics```-## mesh2dPlugin — const @experimental+## meshRendererPlugin — const @experimental```-Mesh2DPlugin+MeshRendererPlugin```## meshWorldBox — function @experimentaldiff --git a/sdk/etc/index.native.api.md b/sdk/etc/index.native.api.mdindex 0cdc2dc6f..68b98fa50 100644--- a/sdk/etc/index.native.api.md+++ b/sdk/etc/index.native.api.md@@ -5,7 +5,7 @@ Symbols: 113 public · 71 beta · 1534 experimental · 3 deprecated## ABI_LAYOUT_HASH — const @experimental```-"dc813d9c5d77b235"+"43f91684e5f3d3fb"```## ANCHOR_AXES — const @experimental@@ -4040,12 +4040,12 @@ static prototype: LifecyclePluginautoPause: boolean | undefined```-## Light2D — const @experimental+## Light — const @experimental```-BuiltinComponentDef<Light2DData>+BuiltinComponentDef<LightData>```-## Light2DData — interface @experimental+## LightData — interface @experimental```color: ColordrawEnvironment: boolean@@ -4063,7 +4063,7 @@ sourceAngle: numbertype: number```-## Light2DType — enum @experimental+## LightType — enum @experimental```Ambient = 2Directional = 1@@ -4481,54 +4481,6 @@ static pair: (options?: MemoryTransportOptions) => [MemoryTransport, MemoryTransstatic prototype: MemoryTransport```-## Mesh2D — const @experimental-```-BuiltinComponentDef<Mesh2DData>-```--## Mesh2DAPI — class @experimental-```-clearGeometry: (entity: Entity) => void-getGeometry: (entity: Entity) => Mesh2DGeometry | undefined-setGeometry: (entity: Entity, geometry: Mesh2DGeometry) => void-static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): Mesh2DAPI-static prototype: Mesh2DAPI-```--## Mesh2DData — interface @experimental-```-color: Color-cullBackfaces: boolean-enabled: boolean-geometry: Mesh2DGeometry-layer: number-lit: boolean-material: number-mesh: number-normalMap: number-opaque: boolean-parallax: Vec2-texture: number-```--## Mesh2DGeometry — interface @experimental-```-colors: number[] | undefined-indices: number[]-positions: number[]-uvs: number[] | undefined-```--## Mesh2DPlugin — class @experimental-```-build: (app: App) => void-cleanup: () => void-name: string-profileDomain: "render"-static new (): Mesh2DPlugin-static prototype: Mesh2DPlugin-```-## MeshChannel — const @experimental```{ readonly Position: 0; readonly Color: 1; readonly TexCoord0: 2; readonly Normal: 3; readonly Tangent: 4; readonly Joints: 5; readonly Weights: 6; }@@ -4573,14 +4525,62 @@ vertexStride: numbervertices: Uint8Array<ArrayBufferLike>```-## MeshResult — interface @experimental+## MeshRenderer — const @experimental```-handle: number+BuiltinComponentDef<MeshRendererData>+```++## MeshRendererAPI — class @experimental+```+clearGeometry: (entity: Entity) => void+getGeometry: (entity: Entity) => MeshRendererGeometry | undefined+setGeometry: (entity: Entity, geometry: MeshRendererGeometry) => void+static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): MeshRendererAPI+static prototype: MeshRendererAPI+```++## MeshRendererData — interface @experimental+```+color: Color+cullBackfaces: boolean+enabled: boolean+geometry: MeshRendererGeometry+layer: number+lit: boolean+material: number+mesh: number+normalMap: number+opaque: boolean+parallax: Vec2+texture: number+```++## MeshRendererGeometry — interface @experimental+```+colors: number[] | undefined+indices: number[]+positions: number[]+uvs: number[] | undefined```-## Meshes2D — const @experimental+## MeshRendererPlugin — class @experimental```-ResourceDef<Mesh2DAPI>+build: (app: App) => void+cleanup: () => void+name: string+profileDomain: "render"+static new (): MeshRendererPlugin+static prototype: MeshRendererPlugin+```++## MeshRenderers — const @experimental+```+ResourceDef<MeshRendererAPI>+```++## MeshResult — interface @experimental+```+handle: number```## MessageHandler — type @experimental@@ -6797,7 +6797,7 @@ ComponentDef<{}>## SCENE_FORMAT_VERSION — const @experimental```-1+2```## SCREEN_FIT_OFF — const @experimental@@ -11260,9 +11260,9 @@ Logger(text: string, opts: MeasureTextOptions): TextMetrics```-## mesh2dPlugin — const @experimental+## meshRendererPlugin — const @experimental```-Mesh2DPlugin+MeshRendererPlugin```## meshWorldBox — function @experimentaldiff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.mdindex df88225f2..04aba0f45 100644--- a/sdk/etc/index.node.api.md+++ b/sdk/etc/index.node.api.md@@ -4027,12 +4027,12 @@ static prototype: LifecyclePluginautoPause: boolean | undefined```-## Light2D — const @experimental+## Light — const @experimental```-BuiltinComponentDef<Light2DData>+BuiltinComponentDef<LightData>```-## Light2DData — interface @experimental+## LightData — interface @experimental```color: ColordrawEnvironment: boolean@@ -4050,7 +4050,7 @@ sourceAngle: numbertype: number```-## Light2DType — enum @experimental+## LightType — enum @experimental```Ambient = 2Directional = 1@@ -4463,54 +4463,6 @@ static pair: (options?: MemoryTransportOptions) => [MemoryTransport, MemoryTransstatic prototype: MemoryTransport```-## Mesh2D — const @experimental-```-BuiltinComponentDef<Mesh2DData>-```--## Mesh2DAPI — class @experimental-```-clearGeometry: (entity: Entity) => void-getGeometry: (entity: Entity) => Mesh2DGeometry | undefined-setGeometry: (entity: Entity, geometry: Mesh2DGeometry) => void-static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): Mesh2DAPI-static prototype: Mesh2DAPI-```--## Mesh2DData — interface @experimental-```-color: Color-cullBackfaces: boolean-enabled: boolean-geometry: Mesh2DGeometry-layer: number-lit: boolean-material: number-mesh: number-normalMap: number-opaque: boolean-parallax: Vec2-texture: number-```--## Mesh2DGeometry — interface @experimental-```-colors: number[] | undefined-indices: number[]-positions: number[]-uvs: number[] | undefined-```--## Mesh2DPlugin — class @experimental-```-build: (app: App) => void-cleanup: () => void-name: string-profileDomain: "render"-static new (): Mesh2DPlugin-static prototype: Mesh2DPlugin-```-## MeshChannel — const @experimental```{ readonly Position: 0; readonly Color: 1; readonly TexCoord0: 2; readonly Normal: 3; readonly Tangent: 4; readonly Joints: 5; readonly Weights: 6; }@@ -4555,14 +4507,62 @@ vertexStride: numbervertices: Uint8Array<ArrayBufferLike>```-## MeshResult — interface @experimental+## MeshRenderer — const @experimental```-handle: number+BuiltinComponentDef<MeshRendererData>+```++## MeshRendererAPI — class @experimental+```+clearGeometry: (entity: Entity) => void+getGeometry: (entity: Entity) => MeshRendererGeometry | undefined+setGeometry: (entity: Entity, geometry: MeshRendererGeometry) => void+static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): MeshRendererAPI+static prototype: MeshRendererAPI+```++## MeshRendererData — interface @experimental+```+color: Color+cullBackfaces: boolean+enabled: boolean+geometry: MeshRendererGeometry+layer: number+lit: boolean+material: number+mesh: number+normalMap: number+opaque: boolean+parallax: Vec2+texture: number+```++## MeshRendererGeometry — interface @experimental+```+colors: number[] | undefined+indices: number[]+positions: number[]+uvs: number[] | undefined```-## Meshes2D — const @experimental+## MeshRendererPlugin — class @experimental```-ResourceDef<Mesh2DAPI>+build: (app: App) => void+cleanup: () => void+name: string+profileDomain: "render"+static new (): MeshRendererPlugin+static prototype: MeshRendererPlugin+```++## MeshRenderers — const @experimental+```+ResourceDef<MeshRendererAPI>+```++## MeshResult — interface @experimental+```+handle: number```## MessageHandler — type @experimental@@ -6599,7 +6599,7 @@ ComponentDef<{}>## SCENE_FORMAT_VERSION — const @experimental```-1+2```## SCREEN_FIT_OFF — const @experimental@@ -11017,9 +11017,9 @@ Logger(text: string, opts: MeasureTextOptions): TextMetrics```-## mesh2dPlugin — const @experimental+## meshRendererPlugin — const @experimental```-Mesh2DPlugin+MeshRendererPlugin```## meshWorldBox — function @experimentaldiff --git a/sdk/etc/minigame.api.md b/sdk/etc/minigame.api.mdindex 652c3657c..9903215dd 100644--- a/sdk/etc/minigame.api.md+++ b/sdk/etc/minigame.api.md@@ -4027,12 +4027,12 @@ static prototype: LifecyclePluginautoPause: boolean | undefined```-## Light2D — const @experimental+## Light — const @experimental```-BuiltinComponentDef<Light2DData>+BuiltinComponentDef<LightData>```-## Light2DData — interface @experimental+## LightData — interface @experimental```color: ColordrawEnvironment: boolean@@ -4050,7 +4050,7 @@ sourceAngle: numbertype: number```-## Light2DType — enum @experimental+## LightType — enum @experimental```Ambient = 2Directional = 1@@ -4463,54 +4463,6 @@ static pair: (options?: MemoryTransportOptions) => [MemoryTransport, MemoryTransstatic prototype: MemoryTransport```-## Mesh2D — const @experimental-```-BuiltinComponentDef<Mesh2DData>-```--## Mesh2DAPI — class @experimental-```-clearGeometry: (entity: Entity) => void-getGeometry: (entity: Entity) => Mesh2DGeometry | undefined-setGeometry: (entity: Entity, geometry: Mesh2DGeometry) => void-static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): Mesh2DAPI-static prototype: Mesh2DAPI-```--## Mesh2DData — interface @experimental-```-color: Color-cullBackfaces: boolean-enabled: boolean-geometry: Mesh2DGeometry-layer: number-lit: boolean-material: number-mesh: number-normalMap: number-opaque: boolean-parallax: Vec2-texture: number-```--## Mesh2DGeometry — interface @experimental-```-colors: number[] | undefined-indices: number[]-positions: number[]-uvs: number[] | undefined-```--## Mesh2DPlugin — class @experimental-```-build: (app: App) => void-cleanup: () => void-name: string-profileDomain: "render"-static new (): Mesh2DPlugin-static prototype: Mesh2DPlugin-```-## MeshChannel — const @experimental```{ readonly Position: 0; readonly Color: 1; readonly TexCoord0: 2; readonly Normal: 3; readonly Tangent: 4; readonly Joints: 5; readonly Weights: 6; }@@ -4555,14 +4507,62 @@ vertexStride: numbervertices: Uint8Array<ArrayBufferLike>```-## MeshResult — interface @experimental+## MeshRenderer — const @experimental```-handle: number+BuiltinComponentDef<MeshRendererData>+```++## MeshRendererAPI — class @experimental+```+clearGeometry: (entity: Entity) => void+getGeometry: (entity: Entity) => MeshRendererGeometry | undefined+setGeometry: (entity: Entity, geometry: MeshRendererGeometry) => void+static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): MeshRendererAPI+static prototype: MeshRendererAPI+```++## MeshRendererData — interface @experimental+```+color: Color+cullBackfaces: boolean+enabled: boolean+geometry: MeshRendererGeometry+layer: number+lit: boolean+material: number+mesh: number+normalMap: number+opaque: boolean+parallax: Vec2+texture: number+```++## MeshRendererGeometry — interface @experimental+```+colors: number[] | undefined+indices: number[]+positions: number[]+uvs: number[] | undefined```-## Meshes2D — const @experimental+## MeshRendererPlugin — class @experimental```-ResourceDef<Mesh2DAPI>+build: (app: App) => void+cleanup: () => void+name: string+profileDomain: "render"+static new (): MeshRendererPlugin+static prototype: MeshRendererPlugin+```++## MeshRenderers — const @experimental+```+ResourceDef<MeshRendererAPI>+```++## MeshResult — interface @experimental+```+handle: number```## MessageHandler — type @experimental@@ -6844,7 +6844,7 @@ ComponentDef<{}>## SCENE_FORMAT_VERSION — const @experimental```-1+2```## SCREEN_FIT_OFF — const @experimental@@ -11272,9 +11272,9 @@ Logger(text: string, opts: MeasureTextOptions): TextMetrics```-## mesh2dPlugin — const @experimental+## meshRendererPlugin — const @experimental```-Mesh2DPlugin+MeshRendererPlugin```## meshWorldBox — function @experimentaldiff --git a/sdk/etc/wasm.api.md b/sdk/etc/wasm.api.mdindex ea95b3436..2256c1c63 100644--- a/sdk/etc/wasm.api.md+++ b/sdk/etc/wasm.api.md@@ -28,9 +28,9 @@ addDraggable: (entity: Entity, component: Draggable) => voidaddDragonBonesAnimation: (entity: Entity, component: DragonBonesAnimation) => voidaddFlexContainer: (entity: Entity, component: FlexContainer) => voidaddInteractable: (entity: Entity, component: Interactable) => void-addLight2D: (entity: Entity, component: Light2D) => void-addMesh2D: (entity: Entity, component: Mesh2D) => void+addLight: (entity: Entity, component: Light) => voidaddMeshCollider3D: (entity: Entity, component: MeshCollider3D) => void+addMeshRenderer: (entity: Entity, component: MeshRenderer) => voidaddMeshSkin: (entity: Entity, component: MeshSkin) => voidaddParent: (entity: Entity, component: Parent) => voidaddParticleEmitter: (entity: Entity, component: ParticleEmitter) => void@@ -71,9 +71,9 @@ getDraggable: (entity: Entity) => DraggablegetDragonBonesAnimation: (entity: Entity) => DragonBonesAnimationgetFlexContainer: (entity: Entity) => FlexContainergetInteractable: (entity: Entity) => Interactable-getLight2D: (entity: Entity) => Light2D-getMesh2D: (entity: Entity) => Mesh2D+getLight: (entity: Entity) => LightgetMeshCollider3D: (entity: Entity) => MeshCollider3D+getMeshRenderer: (entity: Entity) => MeshRenderergetMeshSkin: (entity: Entity) => MeshSkingetParent: (entity: Entity) => ParentgetParticleEmitter: (entity: Entity) => ParticleEmitter@@ -110,9 +110,9 @@ hasDraggable: (entity: Entity) => booleanhasDragonBonesAnimation: (entity: Entity) => booleanhasFlexContainer: (entity: Entity) => booleanhasInteractable: (entity: Entity) => boolean-hasLight2D: (entity: Entity) => boolean-hasMesh2D: (entity: Entity) => boolean+hasLight: (entity: Entity) => booleanhasMeshCollider3D: (entity: Entity) => boolean+hasMeshRenderer: (entity: Entity) => booleanhasMeshSkin: (entity: Entity) => booleanhasParent: (entity: Entity) => booleanhasParticleEmitter: (entity: Entity) => boolean@@ -149,9 +149,9 @@ removeDraggable: (entity: Entity) => voidremoveDragonBonesAnimation: (entity: Entity) => voidremoveFlexContainer: (entity: Entity) => voidremoveInteractable: (entity: Entity) => void-removeLight2D: (entity: Entity) => void-removeMesh2D: (entity: Entity) => void+removeLight: (entity: Entity) => voidremoveMeshCollider3D: (entity: Entity) => void+removeMeshRenderer: (entity: Entity) => voidremoveMeshSkin: (entity: Entity) => voidremoveParent: (entity: Entity) => voidremoveParticleEmitter: (entity: Entity) => void@@ -297,13 +297,13 @@ material_define: (materialId: number, shaderHandle: number, blendMode: number, fmaterial_setTexture: (materialId: number, name: string, textureHandle: number) => voidmaterial_setUniform: (materialId: number, name: string, arity: number, v0: number, v1: number, v2: number, v3: number) => voidmaterial_undefine: (materialId: number) => void-mesh2d_localBounds: ((registry: CppRegistry, entity: number) => { minX: number; minY: number; maxX: number; maxY: number; } | null) | undefined-mesh2d_makeAllResident: ((registry: CppRegistry) => number) | undefined-mesh2d_makeResident: ((registry: CppRegistry, entity: number) => number) | undefined-mesh2d_setGeometry: ((registry: CppRegistry, entity: number, posUvPtr: number, vertexCount: number, colorsPtr: number, indicesPtr: number, indexCount: number) => void) | undefined-mesh2d_setMaterialAll: ((registry: CppRegistry, materialId: number) => number) | undefined-mesh2d_setMesh: ((registry: CppRegistry, entity: number, meshHandle: number) => void) | undefined-mesh2d_setMeshAll: ((registry: CppRegistry, meshHandle: number) => number) | undefined+meshRenderer_localBounds: ((registry: CppRegistry, entity: number) => { minX: number; minY: number; maxX: number; maxY: number; } | null) | undefined+meshRenderer_makeAllResident: ((registry: CppRegistry) => number) | undefined+meshRenderer_makeResident: ((registry: CppRegistry, entity: number) => number) | undefined+meshRenderer_setGeometry: ((registry: CppRegistry, entity: number, posUvPtr: number, vertexCount: number, colorsPtr: number, indicesPtr: number, indexCount: number) => void) | undefined+meshRenderer_setMaterialAll: ((registry: CppRegistry, materialId: number) => number) | undefined+meshRenderer_setMesh: ((registry: CppRegistry, entity: number, meshHandle: number) => void) | undefined+meshRenderer_setMeshAll: ((registry: CppRegistry, meshHandle: number) => number) | undefinedmesh_create: ((posUvPtr: number, vertexCount: number, colorsPtr: number, indicesPtr: number, indexCount: number) => number) | undefinedmesh_createFromChannels: ((channelsPtr: number, channelCount: number, vertexStride: number, vertexPtr: number, vertexBytes: number, indexPtr: number, indexCount: number, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number, bindPtr: number, bindFloats: number) => number) | undefinedmesh_release: ((meshHandle: number) => void) | undefineddiff --git a/sdk/etc/wechat.api.md b/sdk/etc/wechat.api.mdindex 0229bcde1..be9750522 100644--- a/sdk/etc/wechat.api.md+++ b/sdk/etc/wechat.api.md@@ -4034,12 +4034,12 @@ static prototype: LifecyclePluginautoPause: boolean | undefined```-## Light2D — const @experimental+## Light — const @experimental```-BuiltinComponentDef<Light2DData>+BuiltinComponentDef<LightData>```-## Light2DData — interface @experimental+## LightData — interface @experimental```color: ColordrawEnvironment: boolean@@ -4057,7 +4057,7 @@ sourceAngle: numbertype: number```-## Light2DType — enum @experimental+## LightType — enum @experimental```Ambient = 2Directional = 1@@ -4470,54 +4470,6 @@ static pair: (options?: MemoryTransportOptions) => [MemoryTransport, MemoryTransstatic prototype: MemoryTransport```-## Mesh2D — const @experimental-```-BuiltinComponentDef<Mesh2DData>-```--## Mesh2DAPI — class @experimental-```-clearGeometry: (entity: Entity) => void-getGeometry: (entity: Entity) => Mesh2DGeometry | undefined-setGeometry: (entity: Entity, geometry: Mesh2DGeometry) => void-static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): Mesh2DAPI-static prototype: Mesh2DAPI-```--## Mesh2DData — interface @experimental-```-color: Color-cullBackfaces: boolean-enabled: boolean-geometry: Mesh2DGeometry-layer: number-lit: boolean-material: number-mesh: number-normalMap: number-opaque: boolean-parallax: Vec2-texture: number-```--## Mesh2DGeometry — interface @experimental-```-colors: number[] | undefined-indices: number[]-positions: number[]-uvs: number[] | undefined-```--## Mesh2DPlugin — class @experimental-```-build: (app: App) => void-cleanup: () => void-name: string-profileDomain: "render"-static new (): Mesh2DPlugin-static prototype: Mesh2DPlugin-```-## MeshChannel — const @experimental```{ readonly Position: 0; readonly Color: 1; readonly TexCoord0: 2; readonly Normal: 3; readonly Tangent: 4; readonly Joints: 5; readonly Weights: 6; }@@ -4562,14 +4514,62 @@ vertexStride: numbervertices: Uint8Array<ArrayBufferLike>```-## MeshResult — interface @experimental+## MeshRenderer — const @experimental```-handle: number+BuiltinComponentDef<MeshRendererData>+```++## MeshRendererAPI — class @experimental+```+clearGeometry: (entity: Entity) => void+getGeometry: (entity: Entity) => MeshRendererGeometry | undefined+setGeometry: (entity: Entity, geometry: MeshRendererGeometry) => void+static new (module_: NonNullable<EngineApi>, registry_: CppRegistry): MeshRendererAPI+static prototype: MeshRendererAPI+```++## MeshRendererData — interface @experimental+```+color: Color+cullBackfaces: boolean+enabled: boolean+geometry: MeshRendererGeometry+layer: number+lit: boolean+material: number+mesh: number+normalMap: number+opaque: boolean+parallax: Vec2+texture: number+```++## MeshRendererGeometry — interface @experimental+```+colors: number[] | undefined+indices: number[]+positions: number[]+uvs: number[] | undefined```-## Meshes2D — const @experimental+## MeshRendererPlugin — class @experimental```-ResourceDef<Mesh2DAPI>+build: (app: App) => void+cleanup: () => void+name: string+profileDomain: "render"+static new (): MeshRendererPlugin+static prototype: MeshRendererPlugin+```++## MeshRenderers — const @experimental+```+ResourceDef<MeshRendererAPI>+```++## MeshResult — interface @experimental+```+handle: number```## MessageHandler — type @experimental@@ -6606,7 +6606,7 @@ ComponentDef<{}>## SCENE_FORMAT_VERSION — const @experimental```-1+2```## SCREEN_FIT_OFF — const @experimental@@ -11044,9 +11044,9 @@ Logger(text: string, opts: MeasureTextOptions): TextMetrics```-## mesh2dPlugin — const @experimental+## meshRendererPlugin — const @experimental```-Mesh2DPlugin+MeshRendererPlugin```## meshWorldBox — function @experimentaldiff --git a/sdk/src/app/pluginSets.ts b/sdk/src/app/pluginSets.tsindex 3d940f16e..e04c10b00 100644--- a/sdk/src/app/pluginSets.ts+++ b/sdk/src/app/pluginSets.ts@@ -26,7 +26,7 @@ import { audioPlugin } from '../audio';import { videoPlugin } from '../video';import { particlePlugin } from '../particle';import { trailPlugin } from '../trail';-import { mesh2dPlugin } from '../render/mesh2d';+import { meshRendererPlugin } from '../render/meshRenderer';import { tilemapPlugin } from '../tilemap';import { postProcessPlugin } from '../postprocess';import { timelinePlugin } from '../timeline';@@ -59,7 +59,7 @@ export const simulationBasePlugins = (): Plugin[] => [/** What exists to be seen. Every entry drives the engine through `engineApi`. */export const presentationBasePlugins = (): Plugin[] => [- animationPlugin, videoPlugin, particlePlugin, trailPlugin, mesh2dPlugin,+ animationPlugin, videoPlugin, particlePlugin, trailPlugin, meshRendererPlugin,tilemapPlugin, postProcessPlugin, timelinePlugin,];@@ -71,7 +71,7 @@ export const presentationBasePlugins = (): Plugin[] => [export const webBasePlugins = (): Plugin[] => [diagnosticsPlugin,timerPlugin, velocityPlugin, lifecyclePlugin, animationPlugin, audioPlugin, videoPlugin,- particlePlugin, trailPlugin, mesh2dPlugin, tilemapPlugin, postProcessPlugin, timelinePlugin,+ particlePlugin, trailPlugin, meshRendererPlugin, tilemapPlugin, postProcessPlugin, timelinePlugin,perceptionPlugin, fsmPlugin, btPlugin, navPlugin, eventBindingPlugin, replicationPlugin,servicesPlugin,];diff --git a/sdk/src/asset/loaders/EnvironmentAssetLoader.ts b/sdk/src/asset/loaders/EnvironmentAssetLoader.tsindex 2a400c399..92250780b 100644--- a/sdk/src/asset/loaders/EnvironmentAssetLoader.ts+++ b/sdk/src/asset/loaders/EnvironmentAssetLoader.ts@@ -18,7 +18,7 @@ interface EnvironmentAssetData {maxRange?: number;}-/** A baked environment, named by the handle a Light2D references. */+/** A baked environment, named by the handle a Light references. */export interface EnvironmentResult {handle: number;/** The atlas path, so unload releases the texture ref this load took. */diff --git a/sdk/src/core-content.ts b/sdk/src/core-content.tsindex 420f6b665..5b5c0c695 100644--- a/sdk/src/core-content.ts+++ b/sdk/src/core-content.ts@@ -520,15 +520,15 @@ export {} from './trail';// =============================================================================-// Mesh2D+// MeshRenderer// =============================================================================export {- Mesh2DAPI,- Meshes2D,- Mesh2DPlugin,- mesh2dPlugin,-} from './render/mesh2d';+ MeshRendererAPI,+ MeshRenderers,+ MeshRendererPlugin,+ meshRendererPlugin,+} from './render/meshRenderer';// =============================================================================// Tilemapdiff --git a/sdk/src/core-runtime.ts b/sdk/src/core-runtime.tsindex 09948a244..f23021caf 100644--- a/sdk/src/core-runtime.ts+++ b/sdk/src/core-runtime.ts@@ -92,13 +92,13 @@ export {Sprite,ShapeRenderer,ShapeType,- Light2D,- Light2DType,+ Light,+ LightType,ShadowCaster2D,TrailRenderer,- Mesh2D,- type Mesh2DData,- type Mesh2DGeometry,+ MeshRenderer,+ type MeshRendererData,+ type MeshRendererGeometry,Camera,Canvas,Velocity,@@ -120,7 +120,7 @@ export {type WorldTransformData,type SpriteData,type ShapeRendererData,- type Light2DData,+ type LightData,type ShadowCaster2DData,type CameraData,type CanvasData,diff --git a/sdk/src/ecs/bridge/nativeEngineApi.generated.ts b/sdk/src/ecs/bridge/nativeEngineApi.generated.tsindex a64fed944..f186e1510 100644--- a/sdk/src/ecs/bridge/nativeEngineApi.generated.ts+++ b/sdk/src/ecs/bridge/nativeEngineApi.generated.ts@@ -68,12 +68,12 @@ export interface NativeEngineApi {material_setTexture?(materialId: number, name: string, textureHandle: number): void;material_setUniform?(materialId: number, name: string, arity: number, v0: number, v1: number, v2: number, v3: number): void;material_undefine?(materialId: number): void;- mesh2d_makeAllResident?(registry: unknown): number;- mesh2d_makeResident?(registry: unknown, entity: number): number;- mesh2d_setGeometry?(registry: unknown, entity: number, posUvPtr: number, vertexCount: number, colorsPtr: number, indicesPtr: number, indexCount: number): void;- mesh2d_setMaterialAll?(registry: unknown, materialId: number): number;- mesh2d_setMesh?(registry: unknown, entity: number, meshHandle: number): void;- mesh2d_setMeshAll?(registry: unknown, meshHandle: number): number;+ meshRenderer_makeAllResident?(registry: unknown): number;+ meshRenderer_makeResident?(registry: unknown, entity: number): number;+ meshRenderer_setGeometry?(registry: unknown, entity: number, posUvPtr: number, vertexCount: number, colorsPtr: number, indicesPtr: number, indexCount: number): void;+ meshRenderer_setMaterialAll?(registry: unknown, materialId: number): number;+ meshRenderer_setMesh?(registry: unknown, entity: number, meshHandle: number): void;+ meshRenderer_setMeshAll?(registry: unknown, meshHandle: number): number;mesh_create?(posUvPtr: number, vertexCount: number, colorsPtr: number, indicesPtr: number, indexCount: number): number;mesh_createFromChannels?(channelsPtr: number, channelCount: number, vertexStride: number, vertexPtr: number, vertexBytes: number, indexPtr: number, indexCount: number, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number, bindPtr: number, bindFloats: number): number;mesh_release?(meshHandle: number): void;@@ -320,12 +320,12 @@ export function createNativeEngineApi(bind('material_setTexture', 'es_material_setTexture', false);bind('material_setUniform', 'es_material_setUniform', false);bind('material_undefine', 'es_material_undefine', false);- bind('mesh2d_makeAllResident', 'es_mesh2d_makeAllResident', true);- bind('mesh2d_makeResident', 'es_mesh2d_makeResident', true);- bind('mesh2d_setGeometry', 'es_mesh2d_setGeometry', true);- bind('mesh2d_setMaterialAll', 'es_mesh2d_setMaterialAll', true);- bind('mesh2d_setMesh', 'es_mesh2d_setMesh', true);- bind('mesh2d_setMeshAll', 'es_mesh2d_setMeshAll', true);+ bind('meshRenderer_makeAllResident', 'es_meshRenderer_makeAllResident', true);+ bind('meshRenderer_makeResident', 'es_meshRenderer_makeResident', true);+ bind('meshRenderer_setGeometry', 'es_meshRenderer_setGeometry', true);+ bind('meshRenderer_setMaterialAll', 'es_meshRenderer_setMaterialAll', true);+ bind('meshRenderer_setMesh', 'es_meshRenderer_setMesh', true);+ bind('meshRenderer_setMeshAll', 'es_meshRenderer_setMeshAll', true);bind('mesh_create', 'es_mesh_create', false);bind('mesh_createFromChannels', 'es_mesh_createFromChannels', false);bind('mesh_release', 'es_mesh_release', false);diff --git a/sdk/src/ecs/bridge/ptrAccessors.generated.ts b/sdk/src/ecs/bridge/ptrAccessors.generated.tsindex d999624e5..327b7c24b 100644--- a/sdk/src/ecs/bridge/ptrAccessors.generated.ts+++ b/sdk/src/ecs/bridge/ptrAccessors.generated.ts@@ -737,7 +737,7 @@ export function createInteractableData(): InteractablePtrData {};}-export interface Light2DPtrData {+export interface LightPtrData {type: number;color: Color;intensity: number;@@ -754,9 +754,9 @@ export interface Light2DPtrData {enabled: boolean;}-export function fillLight2D(+export function fillLight(f32: Float32Array, u32: Uint32Array, u8: Uint8Array,- ptr: number, out: Light2DPtrData,+ ptr: number, out: LightPtrData,): void {out.type = u32[ptr >> 2] | 0;const color_ = out.color; color_.r = f32[(ptr + 4) >> 2]; color_.g = f32[((ptr + 4) >> 2) + 1]; color_.b = f32[((ptr + 4) >> 2) + 2]; color_.a = f32[((ptr + 4) >> 2) + 3];@@ -774,9 +774,9 @@ export function fillLight2D(out.enabled = u8[ptr + 61] !== 0;}-export function writeLight2D(+export function writeLight(f32: Float32Array, u32: Uint32Array, u8: Uint8Array,- ptr: number, data: Light2DPtrData,+ ptr: number, data: LightPtrData,): void {u32[ptr >> 2] = data.type | 0;f32[(ptr + 4) >> 2] = data.color.r; f32[((ptr + 4) >> 2) + 1] = data.color.g; f32[((ptr + 4) >> 2) + 2] = data.color.b; f32[((ptr + 4) >> 2) + 3] = data.color.a;@@ -794,7 +794,7 @@ export function writeLight2D(u8[ptr + 61] = data.enabled ? 1 : 0;}-export function createLight2DData(): Light2DPtrData {+export function createLightData(): LightPtrData {return {type: 0,color: { r: 0, g: 0, b: 0, a: 0 },@@ -813,7 +813,47 @@ export function createLight2DData(): Light2DPtrData {};}-export interface Mesh2DPtrData {+export interface MeshCollider3DPtrData {+ mesh: number;+ friction: number;+ restitution: number;+ layer: number;+ enabled: boolean;+}++export function fillMeshCollider3D(+ f32: Float32Array, u32: Uint32Array, u8: Uint8Array,+ ptr: number, out: MeshCollider3DPtrData,+): void {+ out.mesh = u32[ptr >> 2];+ out.friction = f32[(ptr + 4) >> 2];+ out.restitution = f32[(ptr + 8) >> 2];+ out.layer = u32[(ptr + 12) >> 2];+ out.enabled = u8[ptr + 16] !== 0;+}++export function writeMeshCollider3D(+ f32: Float32Array, u32: Uint32Array, u8: Uint8Array,+ ptr: number, data: MeshCollider3DPtrData,+): void {+ u32[ptr >> 2] = data.mesh;+ f32[(ptr + 4) >> 2] = data.friction;+ f32[(ptr + 8) >> 2] = data.restitution;+ u32[(ptr + 12) >> 2] = data.layer;+ u8[ptr + 16] = data.enabled ? 1 : 0;+}++export function createMeshCollider3DData(): MeshCollider3DPtrData {+ return {+ mesh: 0,+ friction: 0,+ restitution: 0,+ layer: 0,+ enabled: false,+ };+}++export interface MeshRendererPtrData {texture: number;normalMap: number;color: Color;@@ -827,9 +867,9 @@ export interface Mesh2DPtrData {mesh: number;}-export function fillMesh2D(+export function fillMeshRenderer(f32: Float32Array, u32: Uint32Array, u8: Uint8Array,- ptr: number, out: Mesh2DPtrData,+ ptr: number, out: MeshRendererPtrData,): void {out.texture = u32[ptr >> 2];out.normalMap = u32[(ptr + 4) >> 2];@@ -844,9 +884,9 @@ export function fillMesh2D(out.mesh = u32[(ptr + 48) >> 2];}-export function writeMesh2D(+export function writeMeshRenderer(f32: Float32Array, u32: Uint32Array, u8: Uint8Array,- ptr: number, data: Mesh2DPtrData,+ ptr: number, data: MeshRendererPtrData,): void {u32[ptr >> 2] = data.texture;u32[(ptr + 4) >> 2] = data.normalMap;@@ -861,7 +901,7 @@ export function writeMesh2D(u32[(ptr + 48) >> 2] = data.mesh;}-export function createMesh2DData(): Mesh2DPtrData {+export function createMeshRendererData(): MeshRendererPtrData {return {texture: 0,normalMap: 0,@@ -877,46 +917,6 @@ export function createMesh2DData(): Mesh2DPtrData {};}-export interface MeshCollider3DPtrData {- mesh: number;- friction: number;- restitution: number;- layer: number;- enabled: boolean;-}--export function fillMeshCollider3D(- f32: Float32Array, u32: Uint32Array, u8: Uint8Array,- ptr: number, out: MeshCollider3DPtrData,-): void {- out.mesh = u32[ptr >> 2];- out.friction = f32[(ptr + 4) >> 2];- out.restitution = f32[(ptr + 8) >> 2];- out.layer = u32[(ptr + 12) >> 2];- out.enabled = u8[ptr + 16] !== 0;-}--export function writeMeshCollider3D(- f32: Float32Array, u32: Uint32Array, u8: Uint8Array,- ptr: number, data: MeshCollider3DPtrData,-): void {- u32[ptr >> 2] = data.mesh;- f32[(ptr + 4) >> 2] = data.friction;- f32[(ptr + 8) >> 2] = data.restitution;- u32[(ptr + 12) >> 2] = data.layer;- u8[ptr + 16] = data.enabled ? 1 : 0;-}--export function createMeshCollider3DData(): MeshCollider3DPtrData {- return {- mesh: 0,- friction: 0,- restitution: 0,- layer: 0,- enabled: false,- };-}-export interface ParticleEmitterPtrData {rate: number;burstCount: number;@@ -2158,9 +2158,9 @@ export const PTR_ACCESSORS: Record<string, PtrAccessor<any>> = {DragonBonesAnimation: { fill: fillDragonBonesAnimation, write: writeDragonBonesAnimation, create: createDragonBonesAnimationData },FlexContainer: { fill: fillFlexContainer, write: writeFlexContainer, create: createFlexContainerData },Interactable: { fill: fillInteractable, write: writeInteractable, create: createInteractableData },- Light2D: { fill: fillLight2D, write: writeLight2D, create: createLight2DData },- Mesh2D: { fill: fillMesh2D, write: writeMesh2D, create: createMesh2DData },+ Light: { fill: fillLight, write: writeLight, create: createLightData },MeshCollider3D: { fill: fillMeshCollider3D, write: writeMeshCollider3D, create: createMeshCollider3DData },+ MeshRenderer: { fill: fillMeshRenderer, write: writeMeshRenderer, create: createMeshRendererData },ParticleEmitter: { fill: fillParticleEmitter, write: writeParticleEmitter, create: createParticleEmitterData },ParticleForceField: { fill: fillParticleForceField, write: writeParticleForceField, create: createParticleForceFieldData },RigidBody: { fill: fillRigidBody, write: writeRigidBody, create: createRigidBodyData },diff --git a/sdk/src/ecs/component.generated.ts b/sdk/src/ecs/component.generated.tsindex ae7d40cef..f12fb5e08 100644--- a/sdk/src/ecs/component.generated.ts+++ b/sdk/src/ecs/component.generated.ts@@ -15,7 +15,7 @@ import type { Dimension, Padding } from '../wasm/wasm.generated';* getAbiLayoutHash(); BuiltinBridge.connect() compares them and refuses to* run on mismatch, because mismatched offsets read the wrong heap bytes.*/-export const ABI_LAYOUT_HASH = 'dc813d9c5d77b235';+export const ABI_LAYOUT_HASH = '43f91684e5f3d3fb';/*** One asset-valued field of a component: which field, and what kind of@@ -412,7 +412,7 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {colorFields: [],animatableFields: [],},- Light2D: {+ Light: {defaults: {type: 0,color: { r: 1, g: 1, b: 1, a: 1 },@@ -449,7 +449,26 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {drawEnvironment: { tooltip: "Draw this environment as the sky behind the scene.", shownWhen: { field: "type", values: [2] } },},},- Mesh2D: {+ MeshCollider3D: {+ defaults: {+ mesh: 0,+ friction: 0.3,+ restitution: 0,+ layer: 0,+ enabled: true,+ },+ assetFields: [{ field: 'mesh', type: 'mesh' as AssetFieldType }],+ entityFields: [],+ colorFields: [],+ animatableFields: [],+ fields: {+ mesh: { tooltip: "Geometry (.esmesh) to collide against." },+ friction: { min: 0 },+ restitution: { min: 0, max: 1 },+ layer: { min: 0, max: 15, advanced: true },+ },+ },+ MeshRenderer: {defaults: {texture: 0,normalMap: 0,@@ -474,30 +493,11 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {layer: { step: 1, tooltip: "Sorting layer — controls draw order across renderables.", enumSource: "sortingLayers" },opaque: { tooltip: "Opaque: no blending; writes and tests depth, so meshes occlude each other." },cullBackfaces: { tooltip: "Cull back faces: triangles facing away from the camera are skipped." },- lit: { tooltip: "Receive 2D lights: Light2D entities light this mesh (flat normal). A custom material overrides this." },+ lit: { tooltip: "Receive 2D lights: Light entities light this mesh (flat normal). A custom material overrides this." },parallax: { tooltip: "Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).", advanced: true },material: { advanced: true },},},- MeshCollider3D: {- defaults: {- mesh: 0,- friction: 0.3,- restitution: 0,- layer: 0,- enabled: true,- },- assetFields: [{ field: 'mesh', type: 'mesh' as AssetFieldType }],- entityFields: [],- colorFields: [],- animatableFields: [],- fields: {- mesh: { tooltip: "Geometry (.esmesh) to collide against." },- friction: { min: 0 },- restitution: { min: 0, max: 1 },- layer: { min: 0, max: 15, advanced: true },- },- },MeshSkin: {defaults: {joints: [],@@ -842,7 +842,7 @@ export const COMPONENT_META: Record<string, ComponentMetaEntry> = {uvOffset: { advanced: true },uvScale: { advanced: true },layer: { step: 1, tooltip: "Sorting layer — controls draw order across sprites.", enumSource: "sortingLayers" },- lit: { tooltip: "Receive 2D lights: Light2D entities light this sprite (flat normal). A custom material overrides this." },+ lit: { tooltip: "Receive 2D lights: Light entities light this sprite (flat normal). A custom material overrides this." },tileSize: { advanced: true },tileSpacing: { advanced: true },parallax: { tooltip: "Parallax scroll factor (1 = with world, <1 = slower, 0 = locked to camera).", advanced: true },@@ -1236,7 +1236,7 @@ export interface InteractableData {raycastTarget: boolean;}-export interface Light2DData {+export interface LightData {type: number;color: Color;intensity: number;@@ -1253,7 +1253,15 @@ export interface Light2DData {enabled: boolean;}-export interface Mesh2DData {+export interface MeshCollider3DData {+ mesh: number;+ friction: number;+ restitution: number;+ layer: number;+ enabled: boolean;+}++export interface MeshRendererData {texture: number;normalMap: number;color: Color;@@ -1267,14 +1275,6 @@ export interface Mesh2DData {mesh: number;}-export interface MeshCollider3DData {- mesh: number;- friction: number;- restitution: number;- layer: number;- enabled: boolean;-}-export interface MeshSkinData {joints: Entity[];}diff --git a/sdk/src/ecs/component.ts b/sdk/src/ecs/component.tsindex 7f97356c5..02da3641c 100644--- a/sdk/src/ecs/component.ts+++ b/sdk/src/ecs/component.ts@@ -14,18 +14,18 @@ export type { AssetFieldMeta, SkeletalFieldMeta };// `esengine` import site is unchanged; Camera/ParticleEmitter add TS-only fields by// extending the generated base.import type {- TransformData, SpriteData, ShapeRendererData, Light2DData, ShadowCaster2DData, DraggableData,+ TransformData, SpriteData, ShapeRendererData, LightData, ShadowCaster2DData, DraggableData,CanvasData, VelocityData, ParentData, ChildrenData, SpineAnimationData, DragonBonesAnimationData,TilemapLayerData, BitmapTextData, TrailRendererData, ParticleForceFieldData,CameraData as CameraDataCpp, ParticleEmitterData as ParticleEmitterDataCpp,- Mesh2DData as Mesh2DDataCpp,+ MeshRendererData as MeshRendererDataCpp,} from './component.generated';// Builtin enums whose values come from C++ ES_ENUMs — imported from the generated// module (single source) and re-exported below, so a TS const cannot drift from the// C++ enum and the editor dropdowns derive from the same values. ScaleMode's// canonical values come from CanvasScaleMode (only its Cocos-compat aliases// ShowAll/NoBorder are TS-side).-import { ProjectionType, ClearFlags, EmitterShape, SimulationSpace, SubEmitterTrigger, ForceFieldType, Light2DType, CanvasScaleMode, ShapeType, ParticleEasing } from '../wasm/wasm.generated';+import { ProjectionType, ClearFlags, EmitterShape, SimulationSpace, SubEmitterTrigger, ForceFieldType, LightType, CanvasScaleMode, ShapeType, ParticleEasing } from '../wasm/wasm.generated';import { BlendMode } from '../render/blend';import { getDefaultContext } from './context';import type {@@ -751,10 +751,10 @@ export function ensureBuiltinComponentsRegistered(): void {// =============================================================================// Single-sourced from C++ ES_ENUMs (see import above). ProjectionType, ClearFlags,-// EmitterShape, SimulationSpace, Light2DType and ShapeType are re-exported from the+// EmitterShape, SimulationSpace, LightType and ShapeType are re-exported from the// generated module; their values and the editor dropdowns built from them now have// one source.-export { ProjectionType, ClearFlags, EmitterShape, SimulationSpace, SubEmitterTrigger, ForceFieldType, Light2DType, ShapeType };+export { ProjectionType, ClearFlags, EmitterShape, SimulationSpace, SubEmitterTrigger, ForceFieldType, LightType, ShapeType };// Canonical values single-sourced from the C++ CanvasScaleMode enum (generated);// ShowAll/NoBorder are Cocos-compat aliases with no C++ member.@@ -778,7 +778,7 @@ export type ScaleMode = (typeof ScaleMode)[keyof typeof ScaleMode];// the generated module (the single source). Adding/removing a C++ field flows here// automatically; tsc then enforces every consumer matches.export type {- TransformData, SpriteData, ShapeRendererData, Light2DData, ShadowCaster2DData, DraggableData,+ TransformData, SpriteData, ShapeRendererData, LightData, ShadowCaster2DData, DraggableData,CanvasData, VelocityData, ParentData, ChildrenData, SpineAnimationData, DragonBonesAnimationData,TilemapLayerData, BitmapTextData, TrailRendererData, ParticleForceFieldData,};@@ -885,9 +885,9 @@ export const ShapeRenderer = defineBuiltin<ShapeRendererData>('ShapeRenderer',metaDefaults<ShapeRendererData>('ShapeRenderer'));-// type's dropdown is generated from the C++ Light2DType enum (ES_PROPERTY enum=).-export const Light2D = defineBuiltin<Light2DData>('Light2D',- metaDefaults<Light2DData>('Light2D')+// type's dropdown is generated from the C++ LightType enum (ES_PROPERTY enum=).+export const Light = defineBuiltin<LightData>('Light',+ metaDefaults<LightData>('Light'));export const ShadowCaster2D = defineBuiltin<ShadowCaster2DData>('ShadowCaster2D',@@ -982,28 +982,28 @@ export const DragonBonesAnimation = defineBuiltin<DragonBonesAnimationData>('Dra);/**- * Local-space geometry of a Mesh2D renderable (triangle list, indexed).+ * Local-space geometry of a MeshRenderer renderable (triangle list, indexed).* `positions` is x,y pairs; `uvs` is u,v pairs (default 0,0); `colors` is r,g,b,a- * floats (0-1) per vertex (default white). Uploaded via mesh2d_setGeometry, which+ * floats (0-1) per vertex (default white). Uploaded via meshRenderer_setGeometry, which* validates indices engine-side.*/-export interface Mesh2DGeometry {+export interface MeshRendererGeometry {positions: number[];uvs?: number[];colors?: number[];indices: number[];}-// Mesh2D = the generated C++ field shape + one out-of-band TS-only field: the+// MeshRenderer = the generated C++ field shape + one out-of-band TS-only field: the// variable-size geometry payload has no fixed ABI offset, so it never crosses as a-// component field — it is uploaded through mesh2d_setGeometry (see mesh2dPlugin's+// component field — it is uploaded through meshRenderer_setGeometry (see meshRendererPlugin's// scene codec).-export interface Mesh2DData extends Mesh2DDataCpp {- geometry: Mesh2DGeometry;+export interface MeshRendererData extends MeshRendererDataCpp {+ geometry: MeshRendererGeometry;}-export const Mesh2D = defineBuiltin<Mesh2DData>('Mesh2D',- metaDefaults<Mesh2DData>('Mesh2D', { geometry: { positions: [], indices: [] } })+export const MeshRenderer = defineBuiltin<MeshRendererData>('MeshRenderer',+ metaDefaults<MeshRendererData>('MeshRenderer', { geometry: { positions: [], indices: [] } }));// Motion trail. Pure config — the point history is owned by the C++ TrailSystem anddiff --git a/sdk/src/ecs/entityBox.ts b/sdk/src/ecs/entityBox.tsindex 00b5ea1db..89b0cc692 100644--- a/sdk/src/ecs/entityBox.ts+++ b/sdk/src/ecs/entityBox.ts@@ -11,7 +11,7 @@*/import type { Entity, Quat, Vec3 } from '../types';import type { World } from './world';-import { Transform, Sprite, Mesh2D } from './component';+import { Transform, Sprite, MeshRenderer } from './component';import { UINode } from '../ui/core/ui-node';import { q } from '../math/quat';import { worldEngineApi } from './bridge/engineApi';@@ -156,7 +156,7 @@ interface LocalBounds {}/**- * The world box of a Mesh2D's geometry — {@link entityWorldBox} for a mesh,+ * The world box of a MeshRenderer's geometry — {@link entityWorldBox} for a mesh,* whose extent is in its vertices rather than in a size field. The engine* answers: only it knows whether the live geometry is the resident one or the* inline payload. Null for anything else, and for a mesh that draws nothing.@@ -164,16 +164,16 @@ interface LocalBounds {* @experimental*/export function meshWorldBox(world: LayoutWorld, entity: Entity): EntityBox | null {- if (!world.valid(entity) || !world.has(entity, Mesh2D) || !world.has(entity, Transform)) return null;+ if (!world.valid(entity) || !world.has(entity, MeshRenderer) || !world.has(entity, Transform)) return null;if (world.has(entity, UINode)) return null;// The wasm module, not the shared engine api: this answer is a small object,// which is a shape only that binding surface carries.const module = world.getWasmModule() as {- mesh2d_localBounds?(registry: unknown, entity: number): LocalBounds | null;+ meshRenderer_localBounds?(registry: unknown, entity: number): LocalBounds | null;} | null;const registry = world.getCppRegistry();- if (!registry || !module?.mesh2d_localBounds) return null;- const b = module.mesh2d_localBounds(registry, entity);+ if (!registry || !module?.meshRenderer_localBounds) return null;+ const b = module.meshRenderer_localBounds(registry, entity);if (!b) return null;const t = world.get(entity, Transform);diff --git a/sdk/src/hotUpdateRebind.ts b/sdk/src/hotUpdateRebind.tsindex 4156b7046..f413bf8c5 100644--- a/sdk/src/hotUpdateRebind.ts+++ b/sdk/src/hotUpdateRebind.ts@@ -15,7 +15,7 @@import type { App } from './app/app';import { Schedule, defineSystem } from './ecs/system';import { Query, Mut } from './ecs/query';-import { Sprite, Mesh2D } from './ecs/component';+import { Sprite, MeshRenderer } from './ecs/component';import type { Assets } from './asset/Assets';export function installHotUpdateRebind(app: App, assets: Assets): void {@@ -29,7 +29,7 @@ export function installHotUpdateRebind(app: App, assets: Assets): void {});app.addSystemToSchedule(Schedule.Update, defineSystem(- [Query(Mut(Sprite)), Query(Mut(Mesh2D))],+ [Query(Mut(Sprite)), Query(Mut(MeshRenderer))],(sprites, meshes) => {// Kick a reload for each newly-invalidated ref; the async result (the// new handle) lands in `swaps` a frame or two later.diff --git a/sdk/src/render/builtinShaders.ts b/sdk/src/render/builtinShaders.tsindex ecab38f69..2e00ed2f0 100644--- a/sdk/src/render/builtinShaders.ts+++ b/sdk/src/render/builtinShaders.ts@@ -326,7 +326,7 @@ void main() {// The shading a glTF material says beyond its base colour. Those channels are// per-material constants and per-material samplers, which is what a material has-// and a component does not — a Mesh2D's per-object attributes are full.+// and a component does not — a MeshRenderer's per-object attributes are full.const MODEL = `#pragma shader "Model"#pragma version 300 es#pragma domain Lit2D@@ -357,7 +357,7 @@ uniform sampler2D u_textures[8];out vec4 fragColor;// Base colour rides the draw itself (slot 0 x vertex colour) — glTF's baseColor-// is what a Mesh2D already carries. Emission is added AFTER lighting (it is light+// is what a MeshRenderer already carries. Emission is added AFTER lighting (it is light// this surface makes) and occlusion scales only the ambient term.// Metal-roughness packing is glTF's: roughness in green, metal in blue.void main() {diff --git a/sdk/src/render/mesh2d.ts b/sdk/src/render/meshRenderer.tssimilarity index 79%rename from sdk/src/render/mesh2d.tsrename to sdk/src/render/meshRenderer.tsindex b7e5cbbd6..70613a8d2 100644--- a/sdk/src/render/mesh2d.ts+++ b/sdk/src/render/meshRenderer.ts@@ -1,8 +1,8 @@// SPDX-License-Identifier: Apache-2.0// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team/**- * Mesh2D geometry API — uploads a Mesh2D component's local-space geometry to the- * engine (mesh2d_setGeometry) and carries it through scene save/load as an+ * MeshRenderer geometry API — uploads a MeshRenderer component's local-space geometry to the+ * engine (meshRenderer_setGeometry) and carries it through scene save/load as an* out-of-band field (variable-size payloads are not C++ component fields).*/import type { App, Plugin } from '../app/app';@@ -10,7 +10,7 @@ import type { Entity } from '../types';import type { CppRegistry } from '../wasm';import type { EngineApi } from '../ecs/bridge/engineApi';import { engineApi } from '../ecs/bridge/engineApi';-import type { Mesh2DGeometry } from '../ecs/component';+import type { MeshRendererGeometry } from '../ecs/component';import { defineResource } from '../ecs/resource';import { registerSceneComponentCodec } from '../scene/scene';import { withScratch } from '../wasm/wasmScratch';@@ -23,9 +23,9 @@ function packRgba(colors: number[], v: number): number {| (clamp(colors[v * 4 + 3] ?? 1) << 24)) >>> 0;}-export class Mesh2DAPI {+export class MeshRendererAPI {/** Entity → authored geometry, so scene save round-trips what was uploaded. */- private readonly authored_ = new Map<number, Mesh2DGeometry>();+ private readonly authored_ = new Map<number, MeshRendererGeometry>();constructor(/** Whichever engine core is present (see ecs/engineApi.ts). */@@ -34,14 +34,14 @@ export class Mesh2DAPI {) {}/**- * Upload geometry for an entity's Mesh2D component. Positions are x,y pairs in+ * Upload geometry for an entity's MeshRenderer component. Positions are x,y pairs in* component-local space; uvs default to 0,0 (untextured meshes render vertex* colors on the white texture); colors are r,g,b,a floats per vertex.*/- setGeometry(entity: Entity, geometry: Mesh2DGeometry): void {+ setGeometry(entity: Entity, geometry: MeshRendererGeometry): void {const m = this.module_;- const upload = m.mesh2d_setGeometry;- // A core that compiles no mesh2d, or marshals no buffers, uploads nothing.+ const upload = m.meshRenderer_setGeometry;+ // A core that compiles no mesh renderer, or marshals no buffers, uploads nothing.// The heap is wasm linear memory on the web and the host's arena on a// device — the writes below are identical either way.if (!upload || !m._malloc || !m._free || !m.HEAPU8) return;@@ -84,20 +84,20 @@ export class Mesh2DAPI {/** Clear an entity's mesh geometry (a valid state: the mesh renders nothing). */clearGeometry(entity: Entity): void {- this.module_.mesh2d_setGeometry?.(this.registry_, entity, 0, 0, 0, 0, 0);+ this.module_.meshRenderer_setGeometry?.(this.registry_, entity, 0, 0, 0, 0, 0);this.authored_.delete(entity);}/** The last geometry uploaded for this entity (scene-export source). */- getGeometry(entity: Entity): Mesh2DGeometry | undefined {+ getGeometry(entity: Entity): MeshRendererGeometry | undefined {return this.authored_.get(entity);}}-export const Meshes2D = defineResource<Mesh2DAPI>(null!, 'Meshes2D');+export const MeshRenderers = defineResource<MeshRendererAPI>(null!, 'MeshRenderers');-export class Mesh2DPlugin implements Plugin {- name = 'mesh2d';+export class MeshRendererPlugin implements Plugin {+ name = 'meshRenderer';readonly profileDomain = 'render';private offDespawn_: (() => void) | null = null;@@ -106,8 +106,8 @@ export class Mesh2DPlugin implements Plugin {// the resource, and every call through it no-ops.const engine = engineApi(app) ?? {};const registry = app.world.getCppRegistry() as CppRegistry;- const api = new Mesh2DAPI(engine, registry);- app.insertResource(Meshes2D, api);+ const api = new MeshRendererAPI(engine, registry);+ app.insertResource(MeshRenderers, api);this.offDespawn_ = app.world.onDespawn((entity: Entity) => {if (api.getGeometry(entity)) api.clearGeometry(entity);@@ -116,10 +116,10 @@ export class Mesh2DPlugin implements Plugin {// The geometry payload is authored in the component data but isn't a C++// field — carry it out-of-band and upload it through the validated entry// point on load (the same pattern as particle gradients / tilemap chunks).- registerSceneComponentCodec('Mesh2D', {+ registerSceneComponentCodec('MeshRenderer', {outOfBandFields: ['geometry'],importData: (entity, outOfBand) => {- const g = outOfBand.geometry as Mesh2DGeometry | undefined;+ const g = outOfBand.geometry as MeshRendererGeometry | undefined;if (g && g.positions?.length && g.indices?.length) {api.setGeometry(entity, g);} else {@@ -139,4 +139,4 @@ export class Mesh2DPlugin implements Plugin {}}-export const mesh2dPlugin = new Mesh2DPlugin();+export const meshRendererPlugin = new MeshRendererPlugin();diff --git a/sdk/src/scene/legacyComponents.ts b/sdk/src/scene/legacyComponents.tsindex 461158793..16b277f60 100644--- a/sdk/src/scene/legacyComponents.ts+++ b/sdk/src/scene/legacyComponents.ts@@ -31,6 +31,20 @@ export interface UpgradableEntity {*/export const RETIRED_COMPONENT_TYPES: ReadonlySet<string> = new Set(['StateMachine', 'StateVisuals']);+/**+ * Components an engine upgrade renamed, old name to new. A name is the key a file+ * stores a component under, so a rename is a migration: without one the loader+ * reads the old name as a component it has never heard of.+ */+export const RENAMED_COMPONENT_TYPES: ReadonlyMap<string, string> = new Map([+ ['LocalTransform', 'Transform'],+ ['WorldTransform', 'Transform'],+ // The engine's only light and mesh components; their names said 2D while 3D+ // models, PBR, IBL and shadow maps all went through them.+ ['Light2D', 'Light'],+ ['Mesh2D', 'MeshRenderer'],+]);+/** Light kinds that aim: Directional (1) and Spot (3). Point and Ambient never did. */const AIMED_LIGHT_TYPES = new Set([1, 3]);@@ -43,10 +57,9 @@ const IDENTITY = { w: 1, x: 0, y: 0, z: 0 };*/export function needsComponentUpgrade(entity: UpgradableEntity): boolean {return entity.components.some((c) => RETIRED_COMPONENT_TYPES.has(c.type)- || c.type === 'LocalTransform'- || c.type === 'WorldTransform'+ || RENAMED_COMPONENT_TYPES.has(c.type)|| (c.type === 'UIMask' && typeof c.data['mode'] === 'string')- || (c.type === 'Light2D' && ('direction' in c.data || 'directionZ' in c.data)));+ || (c.type === 'Light' && ('direction' in c.data || 'directionZ' in c.data)));}/**@@ -56,7 +69,7 @@ export function needsComponentUpgrade(entity: UpgradableEntity): boolean {* Point and Ambient do not aim; their fields go and their rotation is left alone.*/function upgradeLightAim(entity: UpgradableEntity): boolean {- const light = entity.components.find((c) => c.type === 'Light2D');+ const light = entity.components.find((c) => c.type === 'Light');if (!light) return false;const data = light.data;if (!('direction' in data) && !('directionZ' in data)) return false;@@ -90,8 +103,9 @@ function upgradeLightAim(entity: UpgradableEntity): boolean {/** Legacy spellings inside one component. */function upgradeComponent(component: UpgradableComponent): boolean {let changed = false;- if (component.type === 'LocalTransform' || component.type === 'WorldTransform') {- component.type = 'Transform';+ const renamed = RENAMED_COMPONENT_TYPES.get(component.type);+ if (renamed !== undefined) {+ component.type = renamed;changed = true;}if (component.type === 'UIMask') {diff --git a/sdk/src/scene/scene.ts b/sdk/src/scene/scene.tsindex bf09f1fd2..6591a0890 100644--- a/sdk/src/scene/scene.ts+++ b/sdk/src/scene/scene.ts@@ -301,8 +301,13 @@ export async function expandScenePrefabs(** An integer, not semver: this number only has to answer "older, current, or* newer", and dotted ones cannot. `parseFloat` sorts "1.10" below "1.2".+ *+ * 2: `Light2D` and `Mesh2D` renamed to `Light` and `MeshRenderer`. An engine+ * from before the rename reads the new names as components it has never+ * heard of and drops them, which is a scene that loads and has no lights —+ * so it must refuse the file instead, and the version is what tells it to.*/-export const SCENE_FORMAT_VERSION = 1;+export const SCENE_FORMAT_VERSION = 2;export interface SceneMigrationResult {/** A migrated *copy* — the input is never mutated. */diff --git a/sdk/src/video/VideoPlugin.ts b/sdk/src/video/VideoPlugin.tsindex 3801b940d..b96a52fef 100644--- a/sdk/src/video/VideoPlugin.ts+++ b/sdk/src/video/VideoPlugin.ts@@ -9,7 +9,7 @@ import { defineSystem, Schedule } from '../ecs/system';import { Res, Time, type TimeData } from '../ecs/resource';import { VideoPlayer, VideoAPI } from './VideoAPI';import { Video, type VideoData } from './VideoComponents';-import { Sprite, Mesh2D, type SpriteData, type Mesh2DData } from '../ecs/component';+import { Sprite, MeshRenderer, type SpriteData, type MeshRendererData } from '../ecs/component';import type { UIVisualData } from '../ecs/component.generated';import { UIVisual } from '../ui/core/ui-visual';import type { VideoStreamHandle } from './PlatformVideoBackend';@@ -21,7 +21,7 @@ import { log } from '../util/logger';const UI_VISUAL_IMAGE = 2; // UIVisualType.Image — samples the texture-// Drive the entity's renderable sibling (Sprite / UIVisual / Mesh2D) from the+// Drive the entity's renderable sibling (Sprite / UIVisual / MeshRenderer) from the// current frame. Builtin get() is a snapshot copy, so mutations need world.insert;// the handle is stable, so we write back only on change. Returns false if the// entity has no renderable to show the video on.@@ -50,9 +50,9 @@ function driveRenderable(world: World, entity: Entity, handle: VideoStreamHandlereturn true;}- const mesh = world.tryGet(entity, Mesh2D) as Mesh2DData | null;+ const mesh = world.tryGet(entity, MeshRenderer) as MeshRendererData | null;if (mesh) {- if (mesh.texture !== tex) { mesh.texture = tex; world.insert(entity, Mesh2D, mesh); }+ if (mesh.texture !== tex) { mesh.texture = tex; world.insert(entity, MeshRenderer, mesh); }return true;}@@ -133,7 +133,7 @@ export class VideoPlugin implements Plugin {const v = world.get(entity, Video) as VideoData;if (!driveRenderable(world, entity, handle, v) && !warnedNoSprite.has(id)) {- log.warn('video', `entity ${id} has a Video but no renderable (Sprite/UIVisual/Mesh2D) to show it on`);+ log.warn('video', `entity ${id} has a Video but no renderable (Sprite/UIVisual/MeshRenderer) to show it on`);warnedNoSprite.add(id);}}diff --git a/sdk/src/wasm.ts b/sdk/src/wasm.tsindex b8775ad9a..5fb725c87 100644--- a/sdk/src/wasm.ts+++ b/sdk/src/wasm.ts@@ -227,7 +227,7 @@ export interface ESEngineModule {* Upload geometry that STAYS on the GPU: interleaved f32 [x,y,z,u,v] per* vertex, optional RGBA8 colors, u32 triangle indices. Any number of entities* can draw the result, each with its own transform. Where the inline- * `mesh2d_setGeometry` payload is rewritten per frame, this is uploaded once.+ * `meshRenderer_setGeometry` payload is rewritten per frame, this is uploaded once.*/mesh_create?(posUvPtr: number, vertexCount: number, colorsPtr: number,indicesPtr: number, indexCount: number): number;@@ -254,27 +254,27 @@ export interface ESEngineModule {mipCount: number, maxRange: number): number;/** Release an environment; its atlas is an ordinary texture and outlives it. */environment_release?(environmentHandle: number): void;- /** Point a Mesh2D at a resident mesh; 0 returns it to its inline payload. */- mesh2d_setMesh?(registry: CppRegistry, entity: number, meshHandle: number): void;+ /** Point a MeshRenderer at a resident mesh; 0 returns it to its inline payload. */+ meshRenderer_setMesh?(registry: CppRegistry, entity: number, meshHandle: number): void;/**- * Freeze a Mesh2D's inline geometry onto the GPU — the same vertices, uploaded+ * Freeze a MeshRenderer's inline geometry onto the GPU — the same vertices, uploaded* once and drawn with a per-object transform. Returns the mesh handle, 0 if* the entity had no geometry to freeze.*/- mesh2d_makeResident?(registry: CppRegistry, entity: number): number;- /** The same for every Mesh2D in the world; returns how many were frozen. */- mesh2d_makeAllResident?(registry: CppRegistry): number;+ meshRenderer_makeResident?(registry: CppRegistry, entity: number): number;+ /** The same for every MeshRenderer in the world; returns how many were frozen. */+ meshRenderer_makeAllResident?(registry: CppRegistry): number;/**- * Point every Mesh2D in the world at one resident mesh, clearing their+ * Point every MeshRenderer in the world at one resident mesh, clearing their* inline payloads. Returns how many were pointed.*/- mesh2d_setMeshAll?(registry: CppRegistry, meshHandle: number): number;- /** Local XY bounds of what a Mesh2D draws — resident geometry, else its+ meshRenderer_setMeshAll?(registry: CppRegistry, meshHandle: number): number;+ /** Local XY bounds of what a MeshRenderer draws — resident geometry, else its* inline payload. Null when it draws nothing. */- mesh2d_localBounds?(registry: CppRegistry, entity: number):+ meshRenderer_localBounds?(registry: CppRegistry, entity: number):{ minX: number; minY: number; maxX: number; maxY: number } | null;- /** Point every Mesh2D in the world at one material; returns how many. */- mesh2d_setMaterialAll?(registry: CppRegistry, materialId: number): number;+ /** Point every MeshRenderer in the world at one material; returns how many. */+ meshRenderer_setMaterialAll?(registry: CppRegistry, materialId: number): number;recoverDevice?(): boolean;/*** Take up the replacement device left on `Module.pendingWebGPUDevice`. A@@ -321,11 +321,11 @@ export interface ESEngineModule {entity: number, layer: number, depth: number, sdf: number, cullBit: number): void;/**- * Upload a Mesh2D component's geometry: interleaved f32 [x,y,u,v] per vertex,+ * Upload a MeshRenderer component's geometry: interleaved f32 [x,y,u,v] per vertex,* optional RGBA8 colors (colorsPtr 0 = all white), u32 triangle-list indices.* Validated engine-side: out-of-range indices reject the whole upload.*/- mesh2d_setGeometry?(+ meshRenderer_setGeometry?(registry: CppRegistry, entity: number,posUvPtr: number, vertexCount: number,colorsPtr: number,diff --git a/sdk/src/wasm/ptrLayouts.generated.ts b/sdk/src/wasm/ptrLayouts.generated.tsindex 635b96958..42a5bd877 100644--- a/sdk/src/wasm/ptrLayouts.generated.ts+++ b/sdk/src/wasm/ptrLayouts.generated.ts@@ -209,8 +209,8 @@ export const PTR_LAYOUTS: Record<string, PtrLayout> = {{ name: 'raycastTarget', type: 'bool', offset: 2 },],},- Light2D: {- ptrFn: 'getLight2DPtr',+ Light: {+ ptrFn: 'getLightPtr',fields: [{ name: 'type', type: 'i32', offset: 0 },{ name: 'color', type: 'color', offset: 4 },@@ -228,8 +228,18 @@ export const PTR_LAYOUTS: Record<string, PtrLayout> = {{ name: 'enabled', type: 'bool', offset: 61 },],},- Mesh2D: {- ptrFn: 'getMesh2DPtr',+ MeshCollider3D: {+ ptrFn: 'getMeshCollider3DPtr',+ fields: [+ { name: 'mesh', type: 'u32', offset: 0 },+ { name: 'friction', type: 'f32', offset: 4 },+ { name: 'restitution', type: 'f32', offset: 8 },+ { name: 'layer', type: 'u32', offset: 12 },+ { name: 'enabled', type: 'bool', offset: 16 },+ ],+ },+ MeshRenderer: {+ ptrFn: 'getMeshRendererPtr',fields: [{ name: 'texture', type: 'u32', offset: 0 },{ name: 'normalMap', type: 'u32', offset: 4 },@@ -244,16 +254,6 @@ export const PTR_LAYOUTS: Record<string, PtrLayout> = {{ name: 'mesh', type: 'u32', offset: 48 },],},- MeshCollider3D: {- ptrFn: 'getMeshCollider3DPtr',- fields: [- { name: 'mesh', type: 'u32', offset: 0 },- { name: 'friction', type: 'f32', offset: 4 },- { name: 'restitution', type: 'f32', offset: 8 },- { name: 'layer', type: 'u32', offset: 12 },- { name: 'enabled', type: 'bool', offset: 16 },- ],- },ParticleEmitter: {ptrFn: 'getParticleEmitterPtr',fields: [diff --git a/sdk/src/wasm/wasm.generated.ts b/sdk/src/wasm/wasm.generated.tsindex 52a40b79b..7c070b3cb 100644--- a/sdk/src/wasm/wasm.generated.ts+++ b/sdk/src/wasm/wasm.generated.ts@@ -103,7 +103,7 @@ export enum JustifyContent {SpaceEvenly = 5,}-export enum Light2DType {+export enum LightType {Point = 0,Directional = 1,Ambient = 2,@@ -381,7 +381,7 @@ export interface Interactable {raycastTarget: boolean;}-export interface Light2D {+export interface Light {type: number;color: Vec4;intensity: number;@@ -398,7 +398,15 @@ export interface Light2D {enabled: boolean;}-export interface Mesh2D {+export interface MeshCollider3D {+ mesh: number;+ friction: number;+ restitution: number;+ layer: number;+ enabled: boolean;+}++export interface MeshRenderer {texture: number;normalMap: number;color: Vec4;@@ -412,14 +420,6 @@ export interface Mesh2D {mesh: number;}-export interface MeshCollider3D {- mesh: number;- friction: number;- restitution: number;- layer: number;- enabled: boolean;-}-export interface MeshSkin {joints: VectorEntity;}@@ -766,18 +766,18 @@ export interface Registry {getInteractable(entity: Entity): Interactable;addInteractable(entity: Entity, component: Interactable): void;removeInteractable(entity: Entity): void;- hasLight2D(entity: Entity): boolean;- getLight2D(entity: Entity): Light2D;- addLight2D(entity: Entity, component: Light2D): void;- removeLight2D(entity: Entity): void;- hasMesh2D(entity: Entity): boolean;- getMesh2D(entity: Entity): Mesh2D;- addMesh2D(entity: Entity, component: Mesh2D): void;- removeMesh2D(entity: Entity): void;+ hasLight(entity: Entity): boolean;+ getLight(entity: Entity): Light;+ addLight(entity: Entity, component: Light): void;+ removeLight(entity: Entity): void;hasMeshCollider3D(entity: Entity): boolean;getMeshCollider3D(entity: Entity): MeshCollider3D;addMeshCollider3D(entity: Entity, component: MeshCollider3D): void;removeMeshCollider3D(entity: Entity): void;+ hasMeshRenderer(entity: Entity): boolean;+ getMeshRenderer(entity: Entity): MeshRenderer;+ addMeshRenderer(entity: Entity, component: MeshRenderer): void;+ removeMeshRenderer(entity: Entity): void;hasMeshSkin(entity: Entity): boolean;getMeshSkin(entity: Entity): MeshSkin;addMeshSkin(entity: Entity, component: MeshSkin): void;@@ -891,9 +891,9 @@ export interface ESEngineModule {DragonBonesAnimation: new () => DragonBonesAnimation;FlexContainer: new () => FlexContainer;Interactable: new () => Interactable;- Light2D: new () => Light2D;- Mesh2D: new () => Mesh2D;+ Light: new () => Light;MeshCollider3D: new () => MeshCollider3D;+ MeshRenderer: new () => MeshRenderer;MeshSkin: new () => MeshSkin;Parent: new () => Parent;ParticleEmitter: new () => ParticleEmitter;diff --git a/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap b/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snapindex c68035153..081bb1b19 100644--- a/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap+++ b/sdk/tests/__snapshots__/component-fieldmeta-golden.test.ts.snap@@ -212,7 +212,7 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho"min": 0,},},- "Light2D": {+ "Light": {"drawEnvironment": {"shownWhen": {"field": "type",@@ -350,7 +350,7 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho"tooltip": "Point, Directional, Ambient, or Spot.",},},- "Mesh2D": {+ "MeshRenderer": {"color": {"tooltip": "Tint multiplied into the vertex colors (white = unchanged).",},@@ -363,7 +363,7 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho"tooltip": "Sorting layer — controls draw order across renderables.",},"lit": {- "tooltip": "Receive 2D lights: Light2D entities light this mesh (flat normal). A custom material overrides this.",+ "tooltip": "Receive 2D lights: Light entities light this mesh (flat normal). A custom material overrides this.",},"material": {"advanced": true,@@ -883,7 +883,7 @@ exports[`builtin FieldMeta (RC9-1 equivalence gate) > matches the golden snapsho"tooltip": "Sorting layer — controls draw order across sprites.",},"lit": {- "tooltip": "Receive 2D lights: Light2D entities light this sprite (flat normal). A custom material overrides this.",+ "tooltip": "Receive 2D lights: Light entities light this sprite (flat normal). A custom material overrides this.",},"material": {"advanced": true,diff --git a/sdk/tests/assets.test.ts b/sdk/tests/assets.test.tsindex 41dbe00b5..752cddcc1 100644--- a/sdk/tests/assets.test.ts+++ b/sdk/tests/assets.test.ts@@ -167,7 +167,7 @@ describe('Assets: mesh references in a scene', () => {version: '1.0', name: 'meshscene',entities: [{id: 1, name: 'e1', parent: null, children: [],- components: [{ type: 'Mesh2D', data: { mesh: 'ship.esmesh' } }],+ components: [{ type: 'MeshRenderer', data: { mesh: 'ship.esmesh' } }],}],} as unknown as SceneData;diff --git a/sdk/tests/component-rename-upgrade.test.ts b/sdk/tests/component-rename-upgrade.test.tsnew file mode 100644index 000000000..a82ce9985--- /dev/null+++ b/sdk/tests/component-rename-upgrade.test.ts@@ -0,0 +1,81 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+/**+ * @file component-rename-upgrade.test.ts+ * @brief A file written under a component's old name loads under its new one.+ *+ * A component's name is the key its data is stored under, so renaming+ * one is a change to every file that holds it. A scene and a prefab go+ * through the same door, and both are checked here: an upgrade that ran+ * on only one of the two leaves the other naming a component the engine+ * no longer has, which loads as a scene with no lights in it.+ */+import { describe, it, expect } from 'vitest';+import { migrateSceneData, SCENE_FORMAT_VERSION, type SceneData } from '../src/scene/scene';+import { migratePrefabData } from '../src/prefab/migrate';+import { needsComponentUpgrade, RENAMED_COMPONENT_TYPES } from '../src/scene/legacyComponents';++const sceneWith = (components: { type: string; data: Record<string, unknown> }[]): SceneData =>+ ({+ version: 1,+ name: 'test',+ entities: [{ id: 0, name: 'Entity', parent: null, children: [], components }],+ } as unknown as SceneData);++const componentsOf = (scene: SceneData) => scene.entities[0]!.components;++describe('a component renamed by an engine upgrade', () => {+ it('arrives under its new name with its data intact', () => {+ const { data, migrated } = migrateSceneData(sceneWith([+ { type: 'Light2D', data: { type: 2, intensity: 0.7 } },+ { type: 'Mesh2D', data: { lit: true, layer: 3 } },+ ]));+ expect(migrated).toBe(true);+ const types = componentsOf(data).map((c) => c.type);+ expect(types).toEqual(['Light', 'MeshRenderer']);+ // The rename must not be a drop-and-recreate: what the file said is what+ // the component holds.+ expect(componentsOf(data)[0]!.data).toEqual({ type: 2, intensity: 0.7 });+ expect(componentsOf(data)[1]!.data).toEqual({ lit: true, layer: 3 });+ });++ it('is idempotent — a file already using the new name is left alone', () => {+ const { migrated } = migrateSceneData(sceneWith([+ { type: 'Light', data: { type: 2 } },+ { type: 'MeshRenderer', data: { lit: true } },+ ]));+ expect(migrated).toBe(false);+ });++ it('is answered by needsComponentUpgrade, which callers ask before copying', () => {+ for (const [before, after] of RENAMED_COMPONENT_TYPES) {+ expect(needsComponentUpgrade({ components: [{ type: before, data: {} }] })).toBe(true);+ expect(needsComponentUpgrade({ components: [{ type: after, data: {} }] })).toBe(false);+ }+ });++ it('upgrades a prefab through the same door', () => {+ const { data, migrated } = migratePrefabData({+ version: '2',+ rootEntityId: 'root',+ entities: [{+ prefabEntityId: 'root',+ name: 'Lamp',+ parent: null,+ children: [],+ visible: true,+ components: [{ type: 'Light2D', data: { intensity: 2 } }],+ }],+ });+ expect(migrated).toBe(true);+ expect(data.entities[0]!.components[0]!.type).toBe('Light');+ expect(data.entities[0]!.components[0]!.data['intensity']).toBe(2);+ });++ it('stamps the format version that tells an older engine to refuse the file', () => {+ const { data } = migrateSceneData(sceneWith([{ type: 'Light2D', data: {} }]));+ expect(data.version).toBe(SCENE_FORMAT_VERSION);+ expect(() => migrateSceneData({ ...data, version: SCENE_FORMAT_VERSION + 1 } as SceneData))+ .toThrow(/newer than this engine supports/);+ });+});diff --git a/sdk/tests/entity-box.test.ts b/sdk/tests/entity-box.test.tsindex 685733207..c47603001 100644--- a/sdk/tests/entity-box.test.ts+++ b/sdk/tests/entity-box.test.ts@@ -9,7 +9,7 @@*/import { describe, expect, it } from 'vitest';import { entityWorldBox, entityBoxCorners, entityBoxRayHit, uiNodeWorldBox, meshWorldBox } from '../src/ecs/entityBox';-import { Transform, Sprite, Mesh2D } from '../src/ecs/component';+import { Transform, Sprite, MeshRenderer } from '../src/ecs/component';import { UINode } from '../src/ui/core/ui-node';import type { Entity } from '../src/types';@@ -34,7 +34,7 @@ const T = (x: number, y: number, sx = 1, sy = 1, angle = 0) => ({/** The engine side of a mesh box: the bounds of whichever geometry is live. */const meshBounds = (b: { minX: number; minY: number; maxX: number; maxY: number; minZ?: number; maxZ?: number } | null) => ({getCppRegistry: () => ({}),- getWasmModule: () => ({ mesh2d_localBounds: () => b }),+ getWasmModule: () => ({ meshRenderer_localBounds: () => b }),});/** The engine side of a UI box: a resolved layout size, in the core's own tables. */@@ -135,10 +135,10 @@ describe('an entity world box', () => {describe('a mesh world box', () => {it('is the geometry the engine reports, through the world scale', () => {- // A Mesh2D has no size field: the extent lives in its vertices, and for+ // A MeshRenderer has no size field: the extent lives in its vertices, and for// resident geometry not even in the component. Only the engine can say.const world = {- ...fakeWorld({ 1: { [name(Transform)]: T(10, 20, 2, 3), [name(Mesh2D)]: {} } }),+ ...fakeWorld({ 1: { [name(Transform)]: T(10, 20, 2, 3), [name(MeshRenderer)]: {} } }),...meshBounds({ minX: -50, minY: -10, maxX: 50, maxY: 10 }),} as never;expect(meshWorldBox(world, ent(1))).toEqual({ cx: 10, cy: 20, cz: 0, hw: 100, hh: 30, hd: 0, rot: { x: 0, y: 0, z: 0, w: 1 } });@@ -146,7 +146,7 @@ describe('a mesh world box', () => {it('follows geometry authored off the origin', () => {const world = {- ...fakeWorld({ 1: { [name(Transform)]: T(0, 0), [name(Mesh2D)]: {} } }),+ ...fakeWorld({ 1: { [name(Transform)]: T(0, 0), [name(MeshRenderer)]: {} } }),...meshBounds({ minX: 100, minY: 0, maxX: 300, maxY: 40 }),} as never;expect(meshWorldBox(world, ent(1))).toEqual({ cx: 200, cy: 20, cz: 0, hw: 100, hh: 20, hd: 0, rot: { x: 0, y: 0, z: 0, w: 1 } });@@ -154,7 +154,7 @@ describe('a mesh world box', () => {it('has none when the mesh draws nothing, and none for a non-mesh', () => {const empty = {- ...fakeWorld({ 1: { [name(Transform)]: T(0, 0), [name(Mesh2D)]: {} } }),+ ...fakeWorld({ 1: { [name(Transform)]: T(0, 0), [name(MeshRenderer)]: {} } }),...meshBounds(null),} as never;expect(meshWorldBox(empty, ent(1))).toBeNull();@@ -219,7 +219,7 @@ describe('a ray against an entity box', () => {it('takes the depth a mesh reports, so a model is not a card', () => {const world = {- ...fakeWorld({ 1: { [name(Transform)]: T(0, 0), [name(Mesh2D)]: {} } }),+ ...fakeWorld({ 1: { [name(Transform)]: T(0, 0), [name(MeshRenderer)]: {} } }),...meshBounds({ minX: -50, minY: -50, maxX: 50, maxY: 50, minZ: -50, maxZ: 50 }),} as never;const box = meshWorldBox(world, ent(1))!;diff --git a/sdk/tests/entity-pick.test.ts b/sdk/tests/entity-pick.test.tsindex 3147bac1f..c94a4dd8b 100644--- a/sdk/tests/entity-pick.test.ts+++ b/sdk/tests/entity-pick.test.ts@@ -9,7 +9,7 @@*/import { describe, expect, it } from 'vitest';import { pickEntitiesByRay } from '../src/ecs/entityPick';-import { Transform, Sprite, Mesh2D } from '../src/ecs/component';+import { Transform, Sprite, MeshRenderer } from '../src/ecs/component';import type { Entity } from '../src/types';const name = (c: unknown): string => (c as { _name?: string })._name ?? (c as { name: string }).name;@@ -27,7 +27,7 @@ function fakeWorld(getAllEntities: () => Object.keys(rows).map((k) => ent(Number(k))),getCppRegistry: () => ({}),getWasmModule: () => ({- mesh2d_localBounds: (_r: unknown, e: number) => meshBounds[e] ?? null,+ meshRenderer_localBounds: (_r: unknown, e: number) => meshBounds[e] ?? null,}),} as never;}@@ -63,7 +63,7 @@ describe('picking entities by ray', () => {// an imported mesh landed on whatever was behind it.it('takes a mesh by its geometry, in a realm that draws no icons', () => {const world = fakeWorld(- { 1: { [name(Transform)]: T(0, 0), [name(Mesh2D)]: {} } },+ { 1: { [name(Transform)]: T(0, 0), [name(MeshRenderer)]: {} } },{ 1: { minX: -200, minY: -200, minZ: -200, maxX: 200, maxY: 200, maxZ: 200 } },);expect(pickEntitiesByRay(world, down(150, 150))).toEqual([ent(1)]);diff --git a/sdk/tests/entity-visibility.test.ts b/sdk/tests/entity-visibility.test.tsindex c830f5834..84b1ae114 100644--- a/sdk/tests/entity-visibility.test.ts+++ b/sdk/tests/entity-visibility.test.ts@@ -72,10 +72,10 @@ describe('Entity visibility helpers', () => {['DragonBonesAnimation', 'enabled'],['ParticleEmitter', 'enabled'],['UIVisual', 'enabled'],- ['Mesh2D', 'enabled'],+ ['MeshRenderer', 'enabled'],['TrailRenderer', 'enabled'],// Not drawn, but hiding an entity has to stop it lighting the scene.- ['Light2D', 'enabled'],+ ['Light', 'enabled'],['ShadowCaster2D', 'enabled'],// Its flag is `visible`, not `enabled` — which is why the declaration// names the field instead of assuming one.diff --git a/sdk/tests/fx-despawn-cleanup.test.ts b/sdk/tests/fx-despawn-cleanup.test.tsindex 40706fec9..c64281b91 100644--- a/sdk/tests/fx-despawn-cleanup.test.ts+++ b/sdk/tests/fx-despawn-cleanup.test.ts@@ -11,7 +11,7 @@ import { App } from '../src/app/app';import { AppContext, setDefaultContext } from '../src/ecs/context';import { setEditorMode, setPlayMode } from '../src/ecs/env';import { createMockModule } from './mocks/wasm';-import { Mesh2DPlugin, Meshes2D } from '../src/render/mesh2d';+import { MeshRendererPlugin, MeshRenderers } from '../src/render/meshRenderer';import { ParticlePlugin } from '../src/particle/ParticlePlugin';import { TrailPlugin } from '../src/trail/TrailPlugin';import { TrailRenderer } from '../src/ecs/component';@@ -38,13 +38,13 @@ function withAllocator(module: ESEngineModule): void {}describe('FX per-entity state on despawn', () => {- it('Mesh2D: despawn drops the authored geometry entry', () => {+ it('MeshRenderer: despawn drops the authored geometry entry', () => {const { app, module } = bootApp();withAllocator(module);- (module as unknown as Record<string, unknown>).mesh2d_setGeometry = vi.fn();+ (module as unknown as Record<string, unknown>).meshRenderer_setGeometry = vi.fn();- app.addPlugin(new Mesh2DPlugin());- const api = app.getResource(Meshes2D);+ app.addPlugin(new MeshRendererPlugin());+ const api = app.getResource(MeshRenderers);const e = app.world.spawn();api.setGeometry(e, { positions: [0, 0, 1, 0, 0, 1], indices: [0, 1, 2] });expect(api.getGeometry(e)).toBeDefined();diff --git a/sdk/tests/light-aim-upgrade.test.ts b/sdk/tests/light-aim-upgrade.test.tsindex cfb891c7a..53c70dbd7 100644--- a/sdk/tests/light-aim-upgrade.test.ts+++ b/sdk/tests/light-aim-upgrade.test.ts@@ -108,8 +108,8 @@ describe('a light aimed by fields becomes a light aimed by its entity', () => {{ type: 'Transform', data: { rotation: turned } },{ type: 'Light2D', data: { type: POINT, direction: { x: 1, y: 0 }, directionZ: -1 } },]));- expect(find(data, 'Light2D')!.data['direction']).toBeUndefined();- expect(find(data, 'Light2D')!.data['directionZ']).toBeUndefined();+ expect(find(data, 'Light')!.data['direction']).toBeUndefined();+ expect(find(data, 'Light')!.data['directionZ']).toBeUndefined();expect(find(data, 'Transform')!.data['rotation']).toEqual(turned);});diff --git a/sdk/tests/mesh-box-integration.test.ts b/sdk/tests/mesh-box-integration.test.tsindex 482bf7330..12d8e8d58 100644--- a/sdk/tests/mesh-box-integration.test.ts+++ b/sdk/tests/mesh-box-integration.test.ts@@ -3,7 +3,7 @@/*** @file A mesh's world box, against the real engine.*- * The extent of a Mesh2D lives in its vertices — and for GPU-resident geometry+ * The extent of a MeshRenderer lives in its vertices — and for GPU-resident geometry* not in the component at all — so the engine is what answers. An editor that* boxes a mesh by its component alone gets nothing to click.*@@ -11,8 +11,8 @@*/import { describe, it, expect, beforeAll } from 'vitest';import { App } from '../src/app/app';-import { Transform, Mesh2D } from '../src/ecs/component';-import { Mesh2DAPI } from '../src/render/mesh2d';+import { Transform, MeshRenderer } from '../src/ecs/component';+import { MeshRendererAPI } from '../src/render/meshRenderer';import { meshWorldBox } from '../src/ecs/entityBox';import type { ESEngineModule, CppRegistry } from '../src/wasm';import { loadWasmModule, HAS_WASM } from './helpers/loadWasm';@@ -53,10 +53,10 @@ describe.skipIf(!HAS_WASM)('a mesh world box (WASM integration)', () => {it('is the uploaded geometry, taken through the world scale', () => {const { app, registry } = createApp();try {- const mesh = new Mesh2DAPI(module as never, registry);+ const mesh = new MeshRendererAPI(module as never, registry);const e = app.world.spawn();app.world.insert(e, Transform, transform(10, 20, 2, 3));- app.world.insert(e, Mesh2D, {});+ app.world.insert(e, MeshRenderer, {});mesh.setGeometry(e, {positions: [-50, -10, 50, -10, 50, 10, -50, 10],indices: [0, 1, 2, 0, 2, 3],@@ -75,7 +75,7 @@ describe.skipIf(!HAS_WASM)('a mesh world box (WASM integration)', () => {try {const e = app.world.spawn();app.world.insert(e, Transform, transform());- app.world.insert(e, Mesh2D, {});+ app.world.insert(e, MeshRenderer, {});app.tick(1 / 60);expect(meshWorldBox(app.world, e)).toBeNull();} finally {diff --git a/sdk/tests/native-assets.test.ts b/sdk/tests/native-assets.test.tsindex cf89272b0..70ce759f3 100644--- a/sdk/tests/native-assets.test.ts+++ b/sdk/tests/native-assets.test.ts@@ -189,7 +189,7 @@ describe('native Assets mesh loading', () => {id: 0, name: 'Block', parent: null, children: [], visible: true,components: [{ type: 'Transform', data: {} },- { type: 'Mesh2D', data: { mesh: 'builtin:cube' } },+ { type: 'MeshRenderer', data: { mesh: 'builtin:cube' } },],}],};diff --git a/src/esengine/bindings/EditorAPI.generated.cpp b/src/esengine/bindings/EditorAPI.generated.cppindex 4b9dcd503..4ae44dfd8 100644--- a/src/esengine/bindings/EditorAPI.generated.cpp+++ b/src/esengine/bindings/EditorAPI.generated.cpp@@ -2,10 +2,10 @@* @file EditorAPI.generated.cpp* @brief Auto-generated editor API with string-dispatched component access* @details Generated by EHT - DO NOT EDIT- * @schema_hash 2ccf06ed7cc3721f+ * @schema_hash a430f15de6d510eb*/-#define ES_EDITOR_API_SCHEMA_HASH "2ccf06ed7cc3721f"+#define ES_EDITOR_API_SCHEMA_HASH "a430f15de6d510eb"#include <emscripten/bind.h>#include <string>@@ -20,8 +20,8 @@#include "../ecs/components/FlexContainer.hpp"#include "../ecs/components/Hierarchy.hpp"#include "../ecs/components/Interactable.hpp"-#include "../ecs/components/Light2D.hpp"-#include "../ecs/components/Mesh2D.hpp"+#include "../ecs/components/Light.hpp"+#include "../ecs/components/MeshRenderer.hpp"#include "../ecs/components/ParticleEmitter.hpp"#include "../ecs/components/ParticleForceField.hpp"#include "../ecs/components/RigidBody.hpp"@@ -74,9 +74,9 @@ std::vector<std::string> editor_getComponentNames() {"DragonBonesAnimation","FlexContainer","Interactable",- "Light2D",- "Mesh2D",+ "Light","MeshCollider3D",+ "MeshRenderer","MeshSkin","Parent","ParticleEmitter",@@ -299,43 +299,25 @@ std::string editor_getComponentSchema(const std::string& name) {{"key":"blockRaycast","type":"bool","group":"Interactable"},{"key":"raycastTarget","type":"bool","group":"Interactable"}])JSON";- } else if (name == "Light2D") {+ } else if (name == "Light") {return R"JSON([- {"key":"type","type":"int","group":"Light2D"},- {"key":"color.r","type":"color","group":"Light2D"},- {"key":"color.g","type":"color","group":"Light2D"},- {"key":"color.b","type":"color","group":"Light2D"},- {"key":"color.a","type":"color","group":"Light2D"},- {"key":"intensity","type":"float","group":"Light2D"},- {"key":"radius","type":"float","group":"Light2D"},- {"key":"innerAngle","type":"float","group":"Light2D"},- {"key":"outerAngle","type":"float","group":"Light2D"},- {"key":"shadowSoftness","type":"float","group":"Light2D"},- {"key":"sourceAngle","type":"float","group":"Light2D"},- {"key":"shadowDistance","type":"float","group":"Light2D"},- {"key":"meshShadows","type":"bool","group":"Light2D"},- {"key":"shadowExtent","type":"float","group":"Light2D"},- {"key":"environment","type":"asset","group":"Light2D"},- {"key":"drawEnvironment","type":"bool","group":"Light2D"},- {"key":"enabled","type":"bool","group":"Light2D"}- ])JSON";- } else if (name == "Mesh2D") {- return R"JSON([- {"key":"texture","type":"asset","group":"Mesh2D"},- {"key":"normalMap","type":"asset","group":"Mesh2D"},- {"key":"color.r","type":"color","group":"Mesh2D"},- {"key":"color.g","type":"color","group":"Mesh2D"},- {"key":"color.b","type":"color","group":"Mesh2D"},- {"key":"color.a","type":"color","group":"Mesh2D"},- {"key":"layer","type":"int","group":"Mesh2D"},- {"key":"opaque","type":"bool","group":"Mesh2D"},- {"key":"cullBackfaces","type":"bool","group":"Mesh2D"},- {"key":"lit","type":"bool","group":"Mesh2D"},- {"key":"parallax.x","type":"float","group":"Mesh2D"},- {"key":"parallax.y","type":"float","group":"Mesh2D"},- {"key":"material","type":"asset","group":"Mesh2D"},- {"key":"enabled","type":"bool","group":"Mesh2D"},- {"key":"mesh","type":"asset","group":"Mesh2D"}+ {"key":"type","type":"int","group":"Light"},+ {"key":"color.r","type":"color","group":"Light"},+ {"key":"color.g","type":"color","group":"Light"},+ {"key":"color.b","type":"color","group":"Light"},+ {"key":"color.a","type":"color","group":"Light"},+ {"key":"intensity","type":"float","group":"Light"},+ {"key":"radius","type":"float","group":"Light"},+ {"key":"innerAngle","type":"float","group":"Light"},+ {"key":"outerAngle","type":"float","group":"Light"},+ {"key":"shadowSoftness","type":"float","group":"Light"},+ {"key":"sourceAngle","type":"float","group":"Light"},+ {"key":"shadowDistance","type":"float","group":"Light"},+ {"key":"meshShadows","type":"bool","group":"Light"},+ {"key":"shadowExtent","type":"float","group":"Light"},+ {"key":"environment","type":"asset","group":"Light"},+ {"key":"drawEnvironment","type":"bool","group":"Light"},+ {"key":"enabled","type":"bool","group":"Light"}])JSON";} else if (name == "MeshCollider3D") {return R"JSON([@@ -345,6 +327,24 @@ std::string editor_getComponentSchema(const std::string& name) {{"key":"layer","type":"int","group":"MeshCollider3D"},{"key":"enabled","type":"bool","group":"MeshCollider3D"}])JSON";+ } else if (name == "MeshRenderer") {+ return R"JSON([+ {"key":"texture","type":"asset","group":"MeshRenderer"},+ {"key":"normalMap","type":"asset","group":"MeshRenderer"},+ {"key":"color.r","type":"color","group":"MeshRenderer"},+ {"key":"color.g","type":"color","group":"MeshRenderer"},+ {"key":"color.b","type":"color","group":"MeshRenderer"},+ {"key":"color.a","type":"color","group":"MeshRenderer"},+ {"key":"layer","type":"int","group":"MeshRenderer"},+ {"key":"opaque","type":"bool","group":"MeshRenderer"},+ {"key":"cullBackfaces","type":"bool","group":"MeshRenderer"},+ {"key":"lit","type":"bool","group":"MeshRenderer"},+ {"key":"parallax.x","type":"float","group":"MeshRenderer"},+ {"key":"parallax.y","type":"float","group":"MeshRenderer"},+ {"key":"material","type":"asset","group":"MeshRenderer"},+ {"key":"enabled","type":"bool","group":"MeshRenderer"},+ {"key":"mesh","type":"asset","group":"MeshRenderer"}+ ])JSON";} else if (name == "MeshSkin") {return R"JSON([{"key":"joints","type":"entity","group":"MeshSkin"}@@ -753,15 +753,15 @@ bool editor_addComponent(Registry& reg, u32 e, const std::string& name) {} else if (name == "Interactable") {if (!reg.has<esengine::ecs::Interactable>(entity)) reg.emplace<esengine::ecs::Interactable>(entity);return true;- } else if (name == "Light2D") {- if (!reg.has<esengine::ecs::Light2D>(entity)) reg.emplace<esengine::ecs::Light2D>(entity);- return true;- } else if (name == "Mesh2D") {- if (!reg.has<esengine::ecs::Mesh2D>(entity)) reg.emplace<esengine::ecs::Mesh2D>(entity);+ } else if (name == "Light") {+ if (!reg.has<esengine::ecs::Light>(entity)) reg.emplace<esengine::ecs::Light>(entity);return true;} else if (name == "MeshCollider3D") {if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) reg.emplace<esengine::ecs::MeshCollider3D>(entity);return true;+ } else if (name == "MeshRenderer") {+ if (!reg.has<esengine::ecs::MeshRenderer>(entity)) reg.emplace<esengine::ecs::MeshRenderer>(entity);+ return true;} else if (name == "MeshSkin") {if (!reg.has<esengine::ecs::MeshSkin>(entity)) reg.emplace<esengine::ecs::MeshSkin>(entity);return true;@@ -865,12 +865,12 @@ bool editor_removeComponent(Registry& reg, u32 e, const std::string& name) {if (reg.has<esengine::ecs::FlexContainer>(entity)) { reg.remove<esengine::ecs::FlexContainer>(entity); return true; }} else if (name == "Interactable") {if (reg.has<esengine::ecs::Interactable>(entity)) { reg.remove<esengine::ecs::Interactable>(entity); return true; }- } else if (name == "Light2D") {- if (reg.has<esengine::ecs::Light2D>(entity)) { reg.remove<esengine::ecs::Light2D>(entity); return true; }- } else if (name == "Mesh2D") {- if (reg.has<esengine::ecs::Mesh2D>(entity)) { reg.remove<esengine::ecs::Mesh2D>(entity); return true; }+ } else if (name == "Light") {+ if (reg.has<esengine::ecs::Light>(entity)) { reg.remove<esengine::ecs::Light>(entity); return true; }} else if (name == "MeshCollider3D") {if (reg.has<esengine::ecs::MeshCollider3D>(entity)) { reg.remove<esengine::ecs::MeshCollider3D>(entity); return true; }+ } else if (name == "MeshRenderer") {+ if (reg.has<esengine::ecs::MeshRenderer>(entity)) { reg.remove<esengine::ecs::MeshRenderer>(entity); return true; }} else if (name == "MeshSkin") {if (reg.has<esengine::ecs::MeshSkin>(entity)) { reg.remove<esengine::ecs::MeshSkin>(entity); return true; }} else if (name == "Parent") {@@ -935,9 +935,9 @@ bool editor_hasComponent(Registry& reg, u32 e, const std::string& name) {if (name == "DragonBonesAnimation") return reg.has<esengine::ecs::DragonBonesAnimation>(entity);if (name == "FlexContainer") return reg.has<esengine::ecs::FlexContainer>(entity);if (name == "Interactable") return reg.has<esengine::ecs::Interactable>(entity);- if (name == "Light2D") return reg.has<esengine::ecs::Light2D>(entity);- if (name == "Mesh2D") return reg.has<esengine::ecs::Mesh2D>(entity);+ if (name == "Light") return reg.has<esengine::ecs::Light>(entity);if (name == "MeshCollider3D") return reg.has<esengine::ecs::MeshCollider3D>(entity);+ if (name == "MeshRenderer") return reg.has<esengine::ecs::MeshRenderer>(entity);if (name == "MeshSkin") return reg.has<esengine::ecs::MeshSkin>(entity);if (name == "Parent") return reg.has<esengine::ecs::Parent>(entity);if (name == "ParticleEmitter") return reg.has<esengine::ecs::ParticleEmitter>(entity);@@ -983,9 +983,9 @@ std::vector<std::string> editor_getComponents(Registry& reg, u32 e) {if (reg.has<esengine::ecs::DragonBonesAnimation>(entity)) result.push_back("DragonBonesAnimation");if (reg.has<esengine::ecs::FlexContainer>(entity)) result.push_back("FlexContainer");if (reg.has<esengine::ecs::Interactable>(entity)) result.push_back("Interactable");- if (reg.has<esengine::ecs::Light2D>(entity)) result.push_back("Light2D");- if (reg.has<esengine::ecs::Mesh2D>(entity)) result.push_back("Mesh2D");+ if (reg.has<esengine::ecs::Light>(entity)) result.push_back("Light");if (reg.has<esengine::ecs::MeshCollider3D>(entity)) result.push_back("MeshCollider3D");+ if (reg.has<esengine::ecs::MeshRenderer>(entity)) result.push_back("MeshRenderer");if (reg.has<esengine::ecs::MeshSkin>(entity)) result.push_back("MeshSkin");if (reg.has<esengine::ecs::Parent>(entity)) result.push_back("Parent");if (reg.has<esengine::ecs::ParticleEmitter>(entity)) result.push_back("ParticleEmitter");@@ -1168,9 +1168,9 @@ bool editor_setFloat(Registry& reg, u32 e, const std::string& comp, const std::selse if (field == "padding.bottom") { c.padding.bottom = value; }else { return false; }return true;- } else if (comp == "Light2D") {- if (!reg.has<esengine::ecs::Light2D>(entity)) return false;- auto& c = reg.get<esengine::ecs::Light2D>(entity);+ } else if (comp == "Light") {+ if (!reg.has<esengine::ecs::Light>(entity)) return false;+ auto& c = reg.get<esengine::ecs::Light>(entity);if (field == "color.r") { c.color.r = value; }else if (field == "color.g") { c.color.g = value; }else if (field == "color.b") { c.color.b = value; }@@ -1185,9 +1185,16 @@ bool editor_setFloat(Registry& reg, u32 e, const std::string& comp, const std::selse if (field == "shadowExtent") { c.shadowExtent = value; }else { return false; }return true;- } else if (comp == "Mesh2D") {- if (!reg.has<esengine::ecs::Mesh2D>(entity)) return false;- auto& c = reg.get<esengine::ecs::Mesh2D>(entity);+ } else if (comp == "MeshCollider3D") {+ if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) return false;+ auto& c = reg.get<esengine::ecs::MeshCollider3D>(entity);+ if (field == "friction") { c.friction = value; }+ else if (field == "restitution") { c.restitution = value; }+ else { return false; }+ return true;+ } else if (comp == "MeshRenderer") {+ if (!reg.has<esengine::ecs::MeshRenderer>(entity)) return false;+ auto& c = reg.get<esengine::ecs::MeshRenderer>(entity);if (field == "color.r") { c.color.r = value; }else if (field == "color.g") { c.color.g = value; }else if (field == "color.b") { c.color.b = value; }@@ -1196,13 +1203,6 @@ bool editor_setFloat(Registry& reg, u32 e, const std::string& comp, const std::selse if (field == "parallax.y") { c.parallax.y = value; }else { return false; }return true;- } else if (comp == "MeshCollider3D") {- if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) return false;- auto& c = reg.get<esengine::ecs::MeshCollider3D>(entity);- if (field == "friction") { c.friction = value; }- else if (field == "restitution") { c.restitution = value; }- else { return false; }- return true;} else if (comp == "ParticleEmitter") {if (!reg.has<esengine::ecs::ParticleEmitter>(entity)) return false;auto& c = reg.get<esengine::ecs::ParticleEmitter>(entity);@@ -1633,9 +1633,9 @@ f32 editor_getFloat(Registry& reg, u32 e, const std::string& comp, const std::stelse if (field == "padding.top") { return c.padding.top; }else if (field == "padding.right") { return c.padding.right; }else if (field == "padding.bottom") { return c.padding.bottom; }- } else if (comp == "Light2D") {- if (!reg.has<esengine::ecs::Light2D>(entity)) return 0.0f;- const auto& c = reg.get<esengine::ecs::Light2D>(entity);+ } else if (comp == "Light") {+ if (!reg.has<esengine::ecs::Light>(entity)) return 0.0f;+ const auto& c = reg.get<esengine::ecs::Light>(entity);if (field == "color.r") { return c.color.r; }else if (field == "color.g") { return c.color.g; }else if (field == "color.b") { return c.color.b; }@@ -1648,20 +1648,20 @@ f32 editor_getFloat(Registry& reg, u32 e, const std::string& comp, const std::stelse if (field == "sourceAngle") { return c.sourceAngle; }else if (field == "shadowDistance") { return c.shadowDistance; }else if (field == "shadowExtent") { return c.shadowExtent; }- } else if (comp == "Mesh2D") {- if (!reg.has<esengine::ecs::Mesh2D>(entity)) return 0.0f;- const auto& c = reg.get<esengine::ecs::Mesh2D>(entity);+ } else if (comp == "MeshCollider3D") {+ if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) return 0.0f;+ const auto& c = reg.get<esengine::ecs::MeshCollider3D>(entity);+ if (field == "friction") { return c.friction; }+ else if (field == "restitution") { return c.restitution; }+ } else if (comp == "MeshRenderer") {+ if (!reg.has<esengine::ecs::MeshRenderer>(entity)) return 0.0f;+ const auto& c = reg.get<esengine::ecs::MeshRenderer>(entity);if (field == "color.r") { return c.color.r; }else if (field == "color.g") { return c.color.g; }else if (field == "color.b") { return c.color.b; }else if (field == "color.a") { return c.color.a; }else if (field == "parallax.x") { return c.parallax.x; }else if (field == "parallax.y") { return c.parallax.y; }- } else if (comp == "MeshCollider3D") {- if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) return 0.0f;- const auto& c = reg.get<esengine::ecs::MeshCollider3D>(entity);- if (field == "friction") { return c.friction; }- else if (field == "restitution") { return c.restitution; }} else if (comp == "ParticleEmitter") {if (!reg.has<esengine::ecs::ParticleEmitter>(entity)) return 0.0f;const auto& c = reg.get<esengine::ecs::ParticleEmitter>(entity);@@ -1991,23 +1991,13 @@ bool editor_setInt(Registry& reg, u32 e, const std::string& comp, const std::strelse if (field == "alignContent") { c.alignContent = static_cast<AlignContent>(value); }else { return false; }return true;- } else if (comp == "Light2D") {- if (!reg.has<esengine::ecs::Light2D>(entity)) return false;- auto& c = reg.get<esengine::ecs::Light2D>(entity);+ } else if (comp == "Light") {+ if (!reg.has<esengine::ecs::Light>(entity)) return false;+ auto& c = reg.get<esengine::ecs::Light>(entity);if (field == "type") { c.type = static_cast<i32>(value); }else if (field == "environment") { c.environment = resource::EnvironmentHandle(static_cast<u32>(value)); }else { return false; }return true;- } else if (comp == "Mesh2D") {- if (!reg.has<esengine::ecs::Mesh2D>(entity)) return false;- auto& c = reg.get<esengine::ecs::Mesh2D>(entity);- if (field == "texture") { c.texture = resource::TextureHandle(static_cast<u32>(value)); }- else if (field == "normalMap") { c.normalMap = resource::TextureHandle(static_cast<u32>(value)); }- else if (field == "layer") { c.layer = static_cast<i32>(value); }- else if (field == "material") { c.material = static_cast<u32>(value); }- else if (field == "mesh") { c.mesh = resource::MeshHandle(static_cast<u32>(value)); }- else { return false; }- return true;} else if (comp == "MeshCollider3D") {if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) return false;auto& c = reg.get<esengine::ecs::MeshCollider3D>(entity);@@ -2015,6 +2005,16 @@ bool editor_setInt(Registry& reg, u32 e, const std::string& comp, const std::strelse if (field == "layer") { c.layer = static_cast<u32>(value); }else { return false; }return true;+ } else if (comp == "MeshRenderer") {+ if (!reg.has<esengine::ecs::MeshRenderer>(entity)) return false;+ auto& c = reg.get<esengine::ecs::MeshRenderer>(entity);+ if (field == "texture") { c.texture = resource::TextureHandle(static_cast<u32>(value)); }+ else if (field == "normalMap") { c.normalMap = resource::TextureHandle(static_cast<u32>(value)); }+ else if (field == "layer") { c.layer = static_cast<i32>(value); }+ else if (field == "material") { c.material = static_cast<u32>(value); }+ else if (field == "mesh") { c.mesh = resource::MeshHandle(static_cast<u32>(value)); }+ else { return false; }+ return true;} else if (comp == "Parent") {if (field != "entity") return false;esengine::ecs::setParent(reg, entity, static_cast<Entity>(value));@@ -2204,24 +2204,24 @@ i32 editor_getInt(Registry& reg, u32 e, const std::string& comp, const std::strielse if (field == "justifyContent") { return static_cast<i32>(c.justifyContent); }else if (field == "alignItems") { return static_cast<i32>(c.alignItems); }else if (field == "alignContent") { return static_cast<i32>(c.alignContent); }- } else if (comp == "Light2D") {- if (!reg.has<esengine::ecs::Light2D>(entity)) return 0;- const auto& c = reg.get<esengine::ecs::Light2D>(entity);+ } else if (comp == "Light") {+ if (!reg.has<esengine::ecs::Light>(entity)) return 0;+ const auto& c = reg.get<esengine::ecs::Light>(entity);if (field == "type") { return static_cast<i32>(c.type); }else if (field == "environment") { return static_cast<i32>(c.environment.id()); }- } else if (comp == "Mesh2D") {- if (!reg.has<esengine::ecs::Mesh2D>(entity)) return 0;- const auto& c = reg.get<esengine::ecs::Mesh2D>(entity);- if (field == "texture") { return static_cast<i32>(c.texture.id()); }- else if (field == "normalMap") { return static_cast<i32>(c.normalMap.id()); }- else if (field == "layer") { return static_cast<i32>(c.layer); }- else if (field == "material") { return static_cast<i32>(c.material); }- else if (field == "mesh") { return static_cast<i32>(c.mesh.id()); }} else if (comp == "MeshCollider3D") {if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) return 0;const auto& c = reg.get<esengine::ecs::MeshCollider3D>(entity);if (field == "mesh") { return static_cast<i32>(c.mesh.id()); }else if (field == "layer") { return static_cast<i32>(c.layer); }+ } else if (comp == "MeshRenderer") {+ if (!reg.has<esengine::ecs::MeshRenderer>(entity)) return 0;+ const auto& c = reg.get<esengine::ecs::MeshRenderer>(entity);+ if (field == "texture") { return static_cast<i32>(c.texture.id()); }+ else if (field == "normalMap") { return static_cast<i32>(c.normalMap.id()); }+ else if (field == "layer") { return static_cast<i32>(c.layer); }+ else if (field == "material") { return static_cast<i32>(c.material); }+ else if (field == "mesh") { return static_cast<i32>(c.mesh.id()); }} else if (comp == "Parent") {if (!reg.has<esengine::ecs::Parent>(entity)) return 0;const auto& c = reg.get<esengine::ecs::Parent>(entity);@@ -2419,29 +2419,29 @@ bool editor_setBool(Registry& reg, u32 e, const std::string& comp, const std::stelse if (field == "raycastTarget") { c.raycastTarget = value; }else { return false; }return true;- } else if (comp == "Light2D") {- if (!reg.has<esengine::ecs::Light2D>(entity)) return false;- auto& c = reg.get<esengine::ecs::Light2D>(entity);+ } else if (comp == "Light") {+ if (!reg.has<esengine::ecs::Light>(entity)) return false;+ auto& c = reg.get<esengine::ecs::Light>(entity);if (field == "meshShadows") { c.meshShadows = value; }else if (field == "drawEnvironment") { c.drawEnvironment = value; }else if (field == "enabled") { c.enabled = value; }else { return false; }return true;- } else if (comp == "Mesh2D") {- if (!reg.has<esengine::ecs::Mesh2D>(entity)) return false;- auto& c = reg.get<esengine::ecs::Mesh2D>(entity);- if (field == "opaque") { c.opaque = value; }- else if (field == "cullBackfaces") { c.cullBackfaces = value; }- else if (field == "lit") { c.lit = value; }- else if (field == "enabled") { c.enabled = value; }- else { return false; }- return true;} else if (comp == "MeshCollider3D") {if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) return false;auto& c = reg.get<esengine::ecs::MeshCollider3D>(entity);if (field == "enabled") { c.enabled = value; }else { return false; }return true;+ } else if (comp == "MeshRenderer") {+ if (!reg.has<esengine::ecs::MeshRenderer>(entity)) return false;+ auto& c = reg.get<esengine::ecs::MeshRenderer>(entity);+ if (field == "opaque") { c.opaque = value; }+ else if (field == "cullBackfaces") { c.cullBackfaces = value; }+ else if (field == "lit") { c.lit = value; }+ else if (field == "enabled") { c.enabled = value; }+ else { return false; }+ return true;} else if (comp == "ParticleEmitter") {if (!reg.has<esengine::ecs::ParticleEmitter>(entity)) return false;auto& c = reg.get<esengine::ecs::ParticleEmitter>(entity);@@ -2639,23 +2639,23 @@ bool editor_getBool(Registry& reg, u32 e, const std::string& comp, const std::stif (field == "enabled") { return c.enabled; }else if (field == "blockRaycast") { return c.blockRaycast; }else if (field == "raycastTarget") { return c.raycastTarget; }- } else if (comp == "Light2D") {- if (!reg.has<esengine::ecs::Light2D>(entity)) return false;- const auto& c = reg.get<esengine::ecs::Light2D>(entity);+ } else if (comp == "Light") {+ if (!reg.has<esengine::ecs::Light>(entity)) return false;+ const auto& c = reg.get<esengine::ecs::Light>(entity);if (field == "meshShadows") { return c.meshShadows; }else if (field == "drawEnvironment") { return c.drawEnvironment; }else if (field == "enabled") { return c.enabled; }- } else if (comp == "Mesh2D") {- if (!reg.has<esengine::ecs::Mesh2D>(entity)) return false;- const auto& c = reg.get<esengine::ecs::Mesh2D>(entity);- if (field == "opaque") { return c.opaque; }- else if (field == "cullBackfaces") { return c.cullBackfaces; }- else if (field == "lit") { return c.lit; }- else if (field == "enabled") { return c.enabled; }} else if (comp == "MeshCollider3D") {if (!reg.has<esengine::ecs::MeshCollider3D>(entity)) return false;const auto& c = reg.get<esengine::ecs::MeshCollider3D>(entity);if (field == "enabled") { return c.enabled; }+ } else if (comp == "MeshRenderer") {+ if (!reg.has<esengine::ecs::MeshRenderer>(entity)) return false;+ const auto& c = reg.get<esengine::ecs::MeshRenderer>(entity);+ if (field == "opaque") { return c.opaque; }+ else if (field == "cullBackfaces") { return c.cullBackfaces; }+ else if (field == "lit") { return c.lit; }+ else if (field == "enabled") { return c.enabled; }} else if (comp == "ParticleEmitter") {if (!reg.has<esengine::ecs::ParticleEmitter>(entity)) return false;const auto& c = reg.get<esengine::ecs::ParticleEmitter>(entity);diff --git a/src/esengine/bindings/RendererBindings.cpp b/src/esengine/bindings/RendererBindings.cppindex bbdd83fd8..cfbaaa02c 100644--- a/src/esengine/bindings/RendererBindings.cpp+++ b/src/esengine/bindings/RendererBindings.cpp@@ -20,8 +20,8 @@#include "../ecs/components/Canvas.hpp"#include "../ecs/components/Transform.hpp"#include "../ecs/components/Sprite.hpp"-#include "../ecs/components/Mesh2D.hpp"-#include "../ecs/components/Light2D.hpp"+#include "../ecs/components/MeshRenderer.hpp"+#include "../ecs/components/Light.hpp"#include "../ecs/components/Hierarchy.hpp"#include "../core/Log.hpp"#ifdef ES_ENABLE_PARTICLES@@ -155,18 +155,18 @@ void renderer_submitTextBatch(textureId, transform, Entity::fromRaw(entity), layer, depth, sdf != 0, cullBit);}-// Mesh2D geometry upload: interleaved f32 [x,y,u,v] per vertex, optional RGBA8+// MeshRenderer geometry upload: interleaved f32 [x,y,u,v] per vertex, optional RGBA8// colors (null = all white), u32 triangle-list indices. Validated here — the single// upload entry — so the render path can trust the payload: out-of-range indices or a// non-triangle count reject the whole upload instead of feeding the GPU garbage.-void mesh2d_setGeometry(ecs::Registry& registry, u32 entity,+void meshRenderer_setGeometry(ecs::Registry& registry, u32 entity,uintptr_t posUvPtr, u32 vertexCount,uintptr_t colorsPtr,uintptr_t indicesPtr, u32 indexCount) {const Entity ent = Entity::fromRaw(entity);- auto* mesh = registry.tryGet<ecs::Mesh2D>(ent);+ auto* mesh = registry.tryGet<ecs::MeshRenderer>(ent);if (!mesh) {- ES_LOG_WARN("mesh2d_setGeometry: entity {} has no Mesh2D component", entity);+ ES_LOG_WARN("meshRenderer_setGeometry: entity {} has no MeshRenderer component", entity);return;}@@ -178,18 +178,18 @@ void mesh2d_setGeometry(ecs::Registry& registry, u32 entity,return;}if (indexCount % 3 != 0) {- ES_LOG_WARN("mesh2d_setGeometry: indexCount {} is not a triangle list; rejected", indexCount);+ ES_LOG_WARN("meshRenderer_setGeometry: indexCount {} is not a triangle list; rejected", indexCount);return;}- const f32* posUv = boundarySpan<f32>(posUvPtr, static_cast<u64>(vertexCount) * 4, "mesh2d_setGeometry.posUv");- const u32* colors = colorsPtr ? boundarySpan<u32>(colorsPtr, vertexCount, "mesh2d_setGeometry.colors") : nullptr;- const u32* indices = boundarySpan<u32>(indicesPtr, indexCount, "mesh2d_setGeometry.indices");+ const f32* posUv = boundarySpan<f32>(posUvPtr, static_cast<u64>(vertexCount) * 4, "meshRenderer_setGeometry.posUv");+ const u32* colors = colorsPtr ? boundarySpan<u32>(colorsPtr, vertexCount, "meshRenderer_setGeometry.colors") : nullptr;+ const u32* indices = boundarySpan<u32>(indicesPtr, indexCount, "meshRenderer_setGeometry.indices");if (!posUv || !indices || (colorsPtr && !colors)) return;for (u32 i = 0; i < indexCount; ++i) {if (indices[i] >= vertexCount) {- ES_LOG_WARN("mesh2d_setGeometry: index {} out of range (vertexCount {}); rejected",+ ES_LOG_WARN("meshRenderer_setGeometry: index {} out of range (vertexCount {}); rejected",indices[i], vertexCount);return;}@@ -355,10 +355,10 @@ void environment_release(u32 environmentHandle) {}namespace {-// Freezes a Mesh2D's inline geometry onto the GPU: the same vertices, uploaded+// Freezes a MeshRenderer's inline geometry onto the GPU: the same vertices, uploaded// once and drawn with a per-object transform. The inline payload is cleared, so// the two can never disagree.-u32 freezeMeshGeometry(ecs::Mesh2D* mesh) {+u32 freezeMeshGeometry(ecs::MeshRenderer* mesh) {auto* rm = ctx().tryGet<resource::ResourceManager>();if (!mesh || !rm || mesh->vertices.empty() || mesh->indices.empty()) return 0;@@ -383,14 +383,14 @@ u32 freezeMeshGeometry(ecs::Mesh2D* mesh) {}} // namespace-u32 mesh2d_makeResident(ecs::Registry& registry, u32 entity) {- return freezeMeshGeometry(registry.tryGet<ecs::Mesh2D>(Entity::fromRaw(entity)));+u32 meshRenderer_makeResident(ecs::Registry& registry, u32 entity) {+ return freezeMeshGeometry(registry.tryGet<ecs::MeshRenderer>(Entity::fromRaw(entity)));}-u32 mesh2d_setMeshAll(ecs::Registry& registry, u32 meshHandle) {+u32 meshRenderer_setMeshAll(ecs::Registry& registry, u32 meshHandle) {u32 pointed = 0;- for (auto entity : registry.view<ecs::Mesh2D>()) {- auto* mesh = registry.tryGet<ecs::Mesh2D>(entity);+ for (auto entity : registry.view<ecs::MeshRenderer>()) {+ auto* mesh = registry.tryGet<ecs::MeshRenderer>(entity);if (!mesh) continue;mesh->mesh = resource::MeshHandle(meshHandle);// Cleared: an entity carrying both draws the resident geometry, so a@@ -402,10 +402,10 @@ u32 mesh2d_setMeshAll(ecs::Registry& registry, u32 meshHandle) {return pointed;}-u32 mesh2d_setMaterialAll(ecs::Registry& registry, u32 materialId) {+u32 meshRenderer_setMaterialAll(ecs::Registry& registry, u32 materialId) {u32 pointed = 0;- for (auto entity : registry.view<ecs::Mesh2D>()) {- if (auto* mesh = registry.tryGet<ecs::Mesh2D>(entity)) {+ for (auto entity : registry.view<ecs::MeshRenderer>()) {+ if (auto* mesh = registry.tryGet<ecs::MeshRenderer>(entity)) {mesh->material = materialId;++pointed;}@@ -413,20 +413,20 @@ u32 mesh2d_setMaterialAll(ecs::Registry& registry, u32 materialId) {return pointed;}-u32 mesh2d_makeAllResident(ecs::Registry& registry) {+u32 meshRenderer_makeAllResident(ecs::Registry& registry) {u32 frozen = 0;- for (auto entity : registry.view<ecs::Mesh2D>()) {- if (freezeMeshGeometry(registry.tryGet<ecs::Mesh2D>(entity)) != 0) ++frozen;+ for (auto entity : registry.view<ecs::MeshRenderer>()) {+ if (freezeMeshGeometry(registry.tryGet<ecs::MeshRenderer>(entity)) != 0) ++frozen;}return frozen;}-/** @brief Points a Mesh2D at resident geometry; 0 returns it to its inline payload. */-void mesh2d_setMesh(ecs::Registry& registry, u32 entity, u32 meshHandle) {+/** @brief Points a MeshRenderer at resident geometry; 0 returns it to its inline payload. */+void meshRenderer_setMesh(ecs::Registry& registry, u32 entity, u32 meshHandle) {const Entity ent = Entity::fromRaw(entity);- auto* mesh = registry.tryGet<ecs::Mesh2D>(ent);+ auto* mesh = registry.tryGet<ecs::MeshRenderer>(ent);if (!mesh) {- ES_LOG_WARN("mesh2d_setMesh: entity {} has no Mesh2D component", entity);+ ES_LOG_WARN("meshRenderer_setMesh: entity {} has no MeshRenderer component", entity);return;}mesh->mesh = resource::MeshHandle(meshHandle);@@ -676,14 +676,14 @@ u32 renderer_getDrawCalls() {#ifdef __EMSCRIPTEN__/**- * The local-space XY box of what a Mesh2D DRAWS — resident geometry when it has+ * The local-space XY box of what a MeshRenderer DRAWS — resident geometry when it has* some, else the inline payload. Which of the two is live is the engine's to* know: an editor asking the component alone boxes a resident mesh at zero, and* then it cannot be clicked.*/-emscripten::val mesh2d_localBounds(ecs::Registry& registry, u32 entity) {+emscripten::val meshRenderer_localBounds(ecs::Registry& registry, u32 entity) {const Entity ent = Entity::fromRaw(entity);- const auto* mesh = registry.tryGet<ecs::Mesh2D>(ent);+ const auto* mesh = registry.tryGet<ecs::MeshRenderer>(ent);if (!mesh) return emscripten::val::null();// The inline payload is authored as 2D positions and has no third dimension;@@ -1126,7 +1126,7 @@ void renderer_renderMaterialPreview(u32 materialId, i32 w, i32 h) {auto light = reg.create();reg.emplace<ecs::Transform>(light);- reg.emplace<ecs::Light2D>(light).type = static_cast<i32>(ecs::Light2DType::Directional);+ reg.emplace<ecs::Light>(light).type = static_cast<i32>(ecs::LightType::Directional);if (g_transformSystem) {esengine::World world{reg, ctx().services(), 0.0f};@@ -1152,7 +1152,7 @@ void renderer_renderMeshPreview(u32 meshId, i32 w, i32 h) {ecs::Registry reg;auto entity = reg.create();reg.emplace<ecs::Transform>(entity);- auto& mesh = reg.emplace<ecs::Mesh2D>(entity);+ auto& mesh = reg.emplace<ecs::MeshRenderer>(entity);mesh.mesh = resource::MeshHandle{meshId};mesh.lit = true;mesh.opaque = true;@@ -1160,7 +1160,7 @@ void renderer_renderMeshPreview(u32 meshId, i32 w, i32 h) {auto light = reg.create();auto& lightTransform = reg.emplace<ecs::Transform>(light);lightTransform.position = glm::vec3(0.0f, 0.0f, 1.0f);- reg.emplace<ecs::Light2D>(light).type = static_cast<i32>(ecs::Light2DType::Directional);+ reg.emplace<ecs::Light>(light).type = static_cast<i32>(ecs::LightType::Directional);if (g_transformSystem) {esengine::World world{reg, ctx().services(), 0.0f};diff --git a/src/esengine/bindings/RendererBindings.hpp b/src/esengine/bindings/RendererBindings.hppindex 87946fd43..37a79301b 100644--- a/src/esengine/bindings/RendererBindings.hpp+++ b/src/esengine/bindings/RendererBindings.hpp@@ -62,7 +62,7 @@ void renderer_submitTextBatch(u32 textureId, uintptr_t transformPtr,u32 entity, i32 layer, f32 depth, i32 sdf, u32 cullBit);-void mesh2d_setGeometry(+void meshRenderer_setGeometry(ecs::Registry& registry, u32 entity,uintptr_t posUvPtr, u32 vertexCount,uintptr_t colorsPtr,@@ -87,16 +87,16 @@ void environment_release(u32 environmentHandle);/** @brief Uploads geometry that stays on the GPU; returns its handle, 0 on failure. */u32 mesh_create(uintptr_t posUvPtr, u32 vertexCount, uintptr_t colorsPtr,uintptr_t indicesPtr, u32 indexCount);-/** @brief Points a Mesh2D at resident geometry; 0 returns it to its inline payload. */-void mesh2d_setMesh(ecs::Registry& registry, u32 entity, u32 meshHandle);-/** @brief Freezes a Mesh2D's inline geometry onto the GPU; returns its handle. */-u32 mesh2d_makeResident(ecs::Registry& registry, u32 entity);-/** @brief Freezes every Mesh2D in the world; returns how many were frozen. */-u32 mesh2d_makeAllResident(ecs::Registry& registry);-/** @brief Points every Mesh2D at one resident mesh; returns how many. */-u32 mesh2d_setMeshAll(ecs::Registry& registry, u32 meshHandle);-/** @brief Points every Mesh2D at one material; returns how many. */-u32 mesh2d_setMaterialAll(ecs::Registry& registry, u32 materialId);+/** @brief Points a MeshRenderer at resident geometry; 0 returns it to its inline payload. */+void meshRenderer_setMesh(ecs::Registry& registry, u32 entity, u32 meshHandle);+/** @brief Freezes a MeshRenderer's inline geometry onto the GPU; returns its handle. */+u32 meshRenderer_makeResident(ecs::Registry& registry, u32 entity);+/** @brief Freezes every MeshRenderer in the world; returns how many were frozen. */+u32 meshRenderer_makeAllResident(ecs::Registry& registry);+/** @brief Points every MeshRenderer at one resident mesh; returns how many. */+u32 meshRenderer_setMeshAll(ecs::Registry& registry, u32 meshHandle);+/** @brief Points every MeshRenderer at one material; returns how many. */+u32 meshRenderer_setMaterialAll(ecs::Registry& registry, u32 materialId);#ifdef ES_ENABLE_PARTICLESvoid renderer_submitParticles(ecs::Registry& registry);#endif@@ -124,9 +124,9 @@ u32 renderer_getDrawCalls();/// GPU objects the device has not destroyed, for the resource census. Null when/// no device is initialized — absent counters, not zeroed ones.emscripten::val renderer_getLiveObjects();-/// Local bounds of what a Mesh2D draws (resident geometry, else the inline+/// Local bounds of what a MeshRenderer draws (resident geometry, else the inline/// payload). Null when it draws nothing — an editor boxes it by its icon then.-emscripten::val mesh2d_localBounds(ecs::Registry& registry, u32 entity);+emscripten::val meshRenderer_localBounds(ecs::Registry& registry, u32 entity);#endifu32 renderer_getTriangles();u32 renderer_getSprites();diff --git a/src/esengine/bindings/WebBindings.generated.cpp b/src/esengine/bindings/WebBindings.generated.cppindex eacaced6a..e9f413f8b 100644--- a/src/esengine/bindings/WebBindings.generated.cpp+++ b/src/esengine/bindings/WebBindings.generated.cpp@@ -20,8 +20,8 @@#include "../ecs/components/FlexContainer.hpp"#include "../ecs/components/Hierarchy.hpp"#include "../ecs/components/Interactable.hpp"-#include "../ecs/components/Light2D.hpp"-#include "../ecs/components/Mesh2D.hpp"+#include "../ecs/components/Light.hpp"+#include "../ecs/components/MeshRenderer.hpp"#include "../ecs/components/ParticleEmitter.hpp"#include "../ecs/components/ParticleForceField.hpp"#include "../ecs/components/RigidBody.hpp"@@ -159,11 +159,11 @@ EMSCRIPTEN_BINDINGS(esengine_enums) {.value("SpaceAround", esengine::ecs::JustifyContent::SpaceAround).value("SpaceEvenly", esengine::ecs::JustifyContent::SpaceEvenly);- enum_<esengine::ecs::Light2DType>("Light2DType")- .value("Point", esengine::ecs::Light2DType::Point)- .value("Directional", esengine::ecs::Light2DType::Directional)- .value("Ambient", esengine::ecs::Light2DType::Ambient)- .value("Spot", esengine::ecs::Light2DType::Spot);+ enum_<esengine::ecs::LightType>("LightType")+ .value("Point", esengine::ecs::LightType::Point)+ .value("Directional", esengine::ecs::LightType::Directional)+ .value("Ambient", esengine::ecs::LightType::Ambient)+ .value("Spot", esengine::ecs::LightType::Spot);enum_<esengine::ecs::MaskMode>("MaskMode").value("Scissor", esengine::ecs::MaskMode::Scissor)@@ -472,7 +472,7 @@ FlexContainerJS flexcontainerToJS(const esengine::ecs::FlexContainer& c) {return js;}-struct Light2DJS {+struct LightJS {i32 type;glm::vec4 color;f32 intensity;@@ -489,7 +489,7 @@ struct Light2DJS {bool enabled;};-void light2dApplyJS(esengine::ecs::Light2D& c, const Light2DJS& js) {+void lightApplyJS(esengine::ecs::Light& c, const LightJS& js) {c.type = js.type;c.color = js.color;c.intensity = js.intensity;@@ -506,14 +506,14 @@ void light2dApplyJS(esengine::ecs::Light2D& c, const Light2DJS& js) {c.enabled = js.enabled;}-esengine::ecs::Light2D light2dFromJS(const Light2DJS& js) {- esengine::ecs::Light2D c;- light2dApplyJS(c, js);+esengine::ecs::Light lightFromJS(const LightJS& js) {+ esengine::ecs::Light c;+ lightApplyJS(c, js);return c;}-Light2DJS light2dToJS(const esengine::ecs::Light2D& c) {- Light2DJS js;+LightJS lightToJS(const esengine::ecs::Light& c) {+ LightJS js;js.type = c.type;js.color = c.color;js.intensity = c.intensity;@@ -531,7 +531,39 @@ Light2DJS light2dToJS(const esengine::ecs::Light2D& c) {return js;}-struct Mesh2DJS {+struct MeshCollider3DJS {+ u32 mesh;+ f32 friction;+ f32 restitution;+ u32 layer;+ bool enabled;+};++void meshcollider3dApplyJS(esengine::ecs::MeshCollider3D& c, const MeshCollider3DJS& js) {+ c.mesh = resource::MeshHandle(js.mesh);+ c.friction = js.friction;+ c.restitution = js.restitution;+ c.layer = js.layer;+ c.enabled = js.enabled;+}++esengine::ecs::MeshCollider3D meshcollider3dFromJS(const MeshCollider3DJS& js) {+ esengine::ecs::MeshCollider3D c;+ meshcollider3dApplyJS(c, js);+ return c;+}++MeshCollider3DJS meshcollider3dToJS(const esengine::ecs::MeshCollider3D& c) {+ MeshCollider3DJS js;+ js.mesh = c.mesh.id();+ js.friction = c.friction;+ js.restitution = c.restitution;+ js.layer = c.layer;+ js.enabled = c.enabled;+ return js;+}++struct MeshRendererJS {u32 texture;u32 normalMap;glm::vec4 color;@@ -545,7 +577,7 @@ struct Mesh2DJS {u32 mesh;};-void mesh2dApplyJS(esengine::ecs::Mesh2D& c, const Mesh2DJS& js) {+void meshrendererApplyJS(esengine::ecs::MeshRenderer& c, const MeshRendererJS& js) {c.texture = resource::TextureHandle(js.texture);c.normalMap = resource::TextureHandle(js.normalMap);c.color = js.color;@@ -559,14 +591,14 @@ void mesh2dApplyJS(esengine::ecs::Mesh2D& c, const Mesh2DJS& js) {c.mesh = resource::MeshHandle(js.mesh);}-esengine::ecs::Mesh2D mesh2dFromJS(const Mesh2DJS& js) {- esengine::ecs::Mesh2D c;- mesh2dApplyJS(c, js);+esengine::ecs::MeshRenderer meshrendererFromJS(const MeshRendererJS& js) {+ esengine::ecs::MeshRenderer c;+ meshrendererApplyJS(c, js);return c;}-Mesh2DJS mesh2dToJS(const esengine::ecs::Mesh2D& c) {- Mesh2DJS js;+MeshRendererJS meshrendererToJS(const esengine::ecs::MeshRenderer& c) {+ MeshRendererJS js;js.texture = c.texture.id();js.normalMap = c.normalMap.id();js.color = c.color;@@ -581,38 +613,6 @@ Mesh2DJS mesh2dToJS(const esengine::ecs::Mesh2D& c) {return js;}-struct MeshCollider3DJS {- u32 mesh;- f32 friction;- f32 restitution;- u32 layer;- bool enabled;-};--void meshcollider3dApplyJS(esengine::ecs::MeshCollider3D& c, const MeshCollider3DJS& js) {- c.mesh = resource::MeshHandle(js.mesh);- c.friction = js.friction;- c.restitution = js.restitution;- c.layer = js.layer;- c.enabled = js.enabled;-}--esengine::ecs::MeshCollider3D meshcollider3dFromJS(const MeshCollider3DJS& js) {- esengine::ecs::MeshCollider3D c;- meshcollider3dApplyJS(c, js);- return c;-}--MeshCollider3DJS meshcollider3dToJS(const esengine::ecs::MeshCollider3D& c) {- MeshCollider3DJS js;- js.mesh = c.mesh.id();- js.friction = c.friction;- js.restitution = c.restitution;- js.layer = c.layer;- js.enabled = c.enabled;- return js;-}-struct MeshSkinJS {std::vector<u32> joints;};@@ -1443,34 +1443,21 @@ EMSCRIPTEN_BINDINGS(esengine_components) {.field("blockRaycast", &esengine::ecs::Interactable::blockRaycast).field("raycastTarget", &esengine::ecs::Interactable::raycastTarget);- value_object<Light2DJS>("Light2D")- .field("type", &Light2DJS::type)- .field("color", &Light2DJS::color)- .field("intensity", &Light2DJS::intensity)- .field("radius", &Light2DJS::radius)- .field("innerAngle", &Light2DJS::innerAngle)- .field("outerAngle", &Light2DJS::outerAngle)- .field("shadowSoftness", &Light2DJS::shadowSoftness)- .field("sourceAngle", &Light2DJS::sourceAngle)- .field("shadowDistance", &Light2DJS::shadowDistance)- .field("meshShadows", &Light2DJS::meshShadows)- .field("shadowExtent", &Light2DJS::shadowExtent)- .field("environment", &Light2DJS::environment)- .field("drawEnvironment", &Light2DJS::drawEnvironment)- .field("enabled", &Light2DJS::enabled);-- value_object<Mesh2DJS>("Mesh2D")- .field("texture", &Mesh2DJS::texture)- .field("normalMap", &Mesh2DJS::normalMap)- .field("color", &Mesh2DJS::color)- .field("layer", &Mesh2DJS::layer)- .field("opaque", &Mesh2DJS::opaque)- .field("cullBackfaces", &Mesh2DJS::cullBackfaces)- .field("lit", &Mesh2DJS::lit)- .field("parallax", &Mesh2DJS::parallax)- .field("material", &Mesh2DJS::material)- .field("enabled", &Mesh2DJS::enabled)- .field("mesh", &Mesh2DJS::mesh);+ value_object<LightJS>("Light")+ .field("type", &LightJS::type)+ .field("color", &LightJS::color)+ .field("intensity", &LightJS::intensity)+ .field("radius", &LightJS::radius)+ .field("innerAngle", &LightJS::innerAngle)+ .field("outerAngle", &LightJS::outerAngle)+ .field("shadowSoftness", &LightJS::shadowSoftness)+ .field("sourceAngle", &LightJS::sourceAngle)+ .field("shadowDistance", &LightJS::shadowDistance)+ .field("meshShadows", &LightJS::meshShadows)+ .field("shadowExtent", &LightJS::shadowExtent)+ .field("environment", &LightJS::environment)+ .field("drawEnvironment", &LightJS::drawEnvironment)+ .field("enabled", &LightJS::enabled);value_object<MeshCollider3DJS>("MeshCollider3D").field("mesh", &MeshCollider3DJS::mesh)@@ -1479,6 +1466,19 @@ EMSCRIPTEN_BINDINGS(esengine_components) {.field("layer", &MeshCollider3DJS::layer).field("enabled", &MeshCollider3DJS::enabled);+ value_object<MeshRendererJS>("MeshRenderer")+ .field("texture", &MeshRendererJS::texture)+ .field("normalMap", &MeshRendererJS::normalMap)+ .field("color", &MeshRendererJS::color)+ .field("layer", &MeshRendererJS::layer)+ .field("opaque", &MeshRendererJS::opaque)+ .field("cullBackfaces", &MeshRendererJS::cullBackfaces)+ .field("lit", &MeshRendererJS::lit)+ .field("parallax", &MeshRendererJS::parallax)+ .field("material", &MeshRendererJS::material)+ .field("enabled", &MeshRendererJS::enabled)+ .field("mesh", &MeshRendererJS::mesh);+value_object<MeshSkinJS>("MeshSkin").field("joints", &MeshSkinJS::joints);@@ -2091,52 +2091,28 @@ EMSCRIPTEN_BINDINGS(esengine_registry) {r.remove<esengine::ecs::Interactable>(entity);}))- // Light2D- .function("hasLight2D", optional_override([](Registry& r, u32 e) {- return r.has<esengine::ecs::Light2D>(static_cast<Entity>(e));+ // Light+ .function("hasLight", optional_override([](Registry& r, u32 e) {+ return r.has<esengine::ecs::Light>(static_cast<Entity>(e));}))- .function("getLight2D", optional_override([](Registry& r, u32 e) {+ .function("getLight", optional_override([](Registry& r, u32 e) {auto entity = static_cast<Entity>(e);- if (!r.valid(entity) || !r.has<esengine::ecs::Light2D>(entity)) return Light2DJS{};- return light2dToJS(r.get<esengine::ecs::Light2D>(entity));+ if (!r.valid(entity) || !r.has<esengine::ecs::Light>(entity)) return LightJS{};+ return lightToJS(r.get<esengine::ecs::Light>(entity));}))- .function("addLight2D", optional_override([](Registry& r, u32 e, const Light2DJS& js) {+ .function("addLight", optional_override([](Registry& r, u32 e, const LightJS& js) {auto entity = static_cast<Entity>(e);if (!r.valid(entity)) return;- if (auto* existing = r.tryGet<esengine::ecs::Light2D>(entity)) {- light2dApplyJS(*existing, js);+ if (auto* existing = r.tryGet<esengine::ecs::Light>(entity)) {+ lightApplyJS(*existing, js);return;}- r.emplaceOrReplace<esengine::ecs::Light2D>(entity, light2dFromJS(js));+ r.emplaceOrReplace<esengine::ecs::Light>(entity, lightFromJS(js));}))- .function("removeLight2D", optional_override([](Registry& r, u32 e) {+ .function("removeLight", optional_override([](Registry& r, u32 e) {auto entity = static_cast<Entity>(e);- if (!r.valid(entity) || !r.has<esengine::ecs::Light2D>(entity)) return;- r.remove<esengine::ecs::Light2D>(entity);- }))-- // Mesh2D- .function("hasMesh2D", optional_override([](Registry& r, u32 e) {- return r.has<esengine::ecs::Mesh2D>(static_cast<Entity>(e));- }))- .function("getMesh2D", optional_override([](Registry& r, u32 e) {- auto entity = static_cast<Entity>(e);- if (!r.valid(entity) || !r.has<esengine::ecs::Mesh2D>(entity)) return Mesh2DJS{};- return mesh2dToJS(r.get<esengine::ecs::Mesh2D>(entity));- }))- .function("addMesh2D", optional_override([](Registry& r, u32 e, const Mesh2DJS& js) {- auto entity = static_cast<Entity>(e);- if (!r.valid(entity)) return;- if (auto* existing = r.tryGet<esengine::ecs::Mesh2D>(entity)) {- mesh2dApplyJS(*existing, js);- return;- }- r.emplaceOrReplace<esengine::ecs::Mesh2D>(entity, mesh2dFromJS(js));- }))- .function("removeMesh2D", optional_override([](Registry& r, u32 e) {- auto entity = static_cast<Entity>(e);- if (!r.valid(entity) || !r.has<esengine::ecs::Mesh2D>(entity)) return;- r.remove<esengine::ecs::Mesh2D>(entity);+ if (!r.valid(entity) || !r.has<esengine::ecs::Light>(entity)) return;+ r.remove<esengine::ecs::Light>(entity);}))// MeshCollider3D@@ -2163,6 +2139,30 @@ EMSCRIPTEN_BINDINGS(esengine_registry) {r.remove<esengine::ecs::MeshCollider3D>(entity);}))+ // MeshRenderer+ .function("hasMeshRenderer", optional_override([](Registry& r, u32 e) {+ return r.has<esengine::ecs::MeshRenderer>(static_cast<Entity>(e));+ }))+ .function("getMeshRenderer", optional_override([](Registry& r, u32 e) {+ auto entity = static_cast<Entity>(e);+ if (!r.valid(entity) || !r.has<esengine::ecs::MeshRenderer>(entity)) return MeshRendererJS{};+ return meshrendererToJS(r.get<esengine::ecs::MeshRenderer>(entity));+ }))+ .function("addMeshRenderer", optional_override([](Registry& r, u32 e, const MeshRendererJS& js) {+ auto entity = static_cast<Entity>(e);+ if (!r.valid(entity)) return;+ if (auto* existing = r.tryGet<esengine::ecs::MeshRenderer>(entity)) {+ meshrendererApplyJS(*existing, js);+ return;+ }+ r.emplaceOrReplace<esengine::ecs::MeshRenderer>(entity, meshrendererFromJS(js));+ }))+ .function("removeMeshRenderer", optional_override([](Registry& r, u32 e) {+ auto entity = static_cast<Entity>(e);+ if (!r.valid(entity) || !r.has<esengine::ecs::MeshRenderer>(entity)) return;+ r.remove<esengine::ecs::MeshRenderer>(entity);+ }))+// MeshSkin.function("hasMeshSkin", optional_override([](Registry& r, u32 e) {return r.has<esengine::ecs::MeshSkin>(static_cast<Entity>(e));@@ -2669,9 +2669,9 @@ emscripten::val esengineGetBuiltinComponentNames() {arr.set(i++, val(std::string("DragonBonesAnimation")));arr.set(i++, val(std::string("FlexContainer")));arr.set(i++, val(std::string("Interactable")));- arr.set(i++, val(std::string("Light2D")));- arr.set(i++, val(std::string("Mesh2D")));+ arr.set(i++, val(std::string("Light")));arr.set(i++, val(std::string("MeshCollider3D")));+ arr.set(i++, val(std::string("MeshRenderer")));arr.set(i++, val(std::string("MeshSkin")));arr.set(i++, val(std::string("Parent")));arr.set(i++, val(std::string("ParticleEmitter")));@@ -2819,36 +2819,36 @@ static_assert(offsetof(esengine::ecs::FlexContainer, padding) == 16, "ABI offsetstatic_assert(offsetof(esengine::ecs::Interactable, enabled) == 0, "ABI offset drift: esengine::ecs::Interactable.enabled (EHT expected 0)");static_assert(offsetof(esengine::ecs::Interactable, blockRaycast) == 1, "ABI offset drift: esengine::ecs::Interactable.blockRaycast (EHT expected 1)");static_assert(offsetof(esengine::ecs::Interactable, raycastTarget) == 2, "ABI offset drift: esengine::ecs::Interactable.raycastTarget (EHT expected 2)");-static_assert(offsetof(esengine::ecs::Light2D, type) == 0, "ABI offset drift: esengine::ecs::Light2D.type (EHT expected 0)");-static_assert(offsetof(esengine::ecs::Light2D, color) == 4, "ABI offset drift: esengine::ecs::Light2D.color (EHT expected 4)");-static_assert(offsetof(esengine::ecs::Light2D, intensity) == 20, "ABI offset drift: esengine::ecs::Light2D.intensity (EHT expected 20)");-static_assert(offsetof(esengine::ecs::Light2D, radius) == 24, "ABI offset drift: esengine::ecs::Light2D.radius (EHT expected 24)");-static_assert(offsetof(esengine::ecs::Light2D, innerAngle) == 28, "ABI offset drift: esengine::ecs::Light2D.innerAngle (EHT expected 28)");-static_assert(offsetof(esengine::ecs::Light2D, outerAngle) == 32, "ABI offset drift: esengine::ecs::Light2D.outerAngle (EHT expected 32)");-static_assert(offsetof(esengine::ecs::Light2D, shadowSoftness) == 36, "ABI offset drift: esengine::ecs::Light2D.shadowSoftness (EHT expected 36)");-static_assert(offsetof(esengine::ecs::Light2D, sourceAngle) == 40, "ABI offset drift: esengine::ecs::Light2D.sourceAngle (EHT expected 40)");-static_assert(offsetof(esengine::ecs::Light2D, shadowDistance) == 44, "ABI offset drift: esengine::ecs::Light2D.shadowDistance (EHT expected 44)");-static_assert(offsetof(esengine::ecs::Light2D, meshShadows) == 48, "ABI offset drift: esengine::ecs::Light2D.meshShadows (EHT expected 48)");-static_assert(offsetof(esengine::ecs::Light2D, shadowExtent) == 52, "ABI offset drift: esengine::ecs::Light2D.shadowExtent (EHT expected 52)");-static_assert(offsetof(esengine::ecs::Light2D, environment) == 56, "ABI offset drift: esengine::ecs::Light2D.environment (EHT expected 56)");-static_assert(offsetof(esengine::ecs::Light2D, drawEnvironment) == 60, "ABI offset drift: esengine::ecs::Light2D.drawEnvironment (EHT expected 60)");-static_assert(offsetof(esengine::ecs::Light2D, enabled) == 61, "ABI offset drift: esengine::ecs::Light2D.enabled (EHT expected 61)");-static_assert(offsetof(esengine::ecs::Mesh2D, texture) == 0, "ABI offset drift: esengine::ecs::Mesh2D.texture (EHT expected 0)");-static_assert(offsetof(esengine::ecs::Mesh2D, normalMap) == 4, "ABI offset drift: esengine::ecs::Mesh2D.normalMap (EHT expected 4)");-static_assert(offsetof(esengine::ecs::Mesh2D, color) == 8, "ABI offset drift: esengine::ecs::Mesh2D.color (EHT expected 8)");-static_assert(offsetof(esengine::ecs::Mesh2D, layer) == 24, "ABI offset drift: esengine::ecs::Mesh2D.layer (EHT expected 24)");-static_assert(offsetof(esengine::ecs::Mesh2D, opaque) == 28, "ABI offset drift: esengine::ecs::Mesh2D.opaque (EHT expected 28)");-static_assert(offsetof(esengine::ecs::Mesh2D, cullBackfaces) == 29, "ABI offset drift: esengine::ecs::Mesh2D.cullBackfaces (EHT expected 29)");-static_assert(offsetof(esengine::ecs::Mesh2D, lit) == 30, "ABI offset drift: esengine::ecs::Mesh2D.lit (EHT expected 30)");-static_assert(offsetof(esengine::ecs::Mesh2D, parallax) == 32, "ABI offset drift: esengine::ecs::Mesh2D.parallax (EHT expected 32)");-static_assert(offsetof(esengine::ecs::Mesh2D, material) == 40, "ABI offset drift: esengine::ecs::Mesh2D.material (EHT expected 40)");-static_assert(offsetof(esengine::ecs::Mesh2D, enabled) == 44, "ABI offset drift: esengine::ecs::Mesh2D.enabled (EHT expected 44)");-static_assert(offsetof(esengine::ecs::Mesh2D, mesh) == 48, "ABI offset drift: esengine::ecs::Mesh2D.mesh (EHT expected 48)");+static_assert(offsetof(esengine::ecs::Light, type) == 0, "ABI offset drift: esengine::ecs::Light.type (EHT expected 0)");+static_assert(offsetof(esengine::ecs::Light, color) == 4, "ABI offset drift: esengine::ecs::Light.color (EHT expected 4)");+static_assert(offsetof(esengine::ecs::Light, intensity) == 20, "ABI offset drift: esengine::ecs::Light.intensity (EHT expected 20)");+static_assert(offsetof(esengine::ecs::Light, radius) == 24, "ABI offset drift: esengine::ecs::Light.radius (EHT expected 24)");+static_assert(offsetof(esengine::ecs::Light, innerAngle) == 28, "ABI offset drift: esengine::ecs::Light.innerAngle (EHT expected 28)");+static_assert(offsetof(esengine::ecs::Light, outerAngle) == 32, "ABI offset drift: esengine::ecs::Light.outerAngle (EHT expected 32)");+static_assert(offsetof(esengine::ecs::Light, shadowSoftness) == 36, "ABI offset drift: esengine::ecs::Light.shadowSoftness (EHT expected 36)");+static_assert(offsetof(esengine::ecs::Light, sourceAngle) == 40, "ABI offset drift: esengine::ecs::Light.sourceAngle (EHT expected 40)");+static_assert(offsetof(esengine::ecs::Light, shadowDistance) == 44, "ABI offset drift: esengine::ecs::Light.shadowDistance (EHT expected 44)");+static_assert(offsetof(esengine::ecs::Light, meshShadows) == 48, "ABI offset drift: esengine::ecs::Light.meshShadows (EHT expected 48)");+static_assert(offsetof(esengine::ecs::Light, shadowExtent) == 52, "ABI offset drift: esengine::ecs::Light.shadowExtent (EHT expected 52)");+static_assert(offsetof(esengine::ecs::Light, environment) == 56, "ABI offset drift: esengine::ecs::Light.environment (EHT expected 56)");+static_assert(offsetof(esengine::ecs::Light, drawEnvironment) == 60, "ABI offset drift: esengine::ecs::Light.drawEnvironment (EHT expected 60)");+static_assert(offsetof(esengine::ecs::Light, enabled) == 61, "ABI offset drift: esengine::ecs::Light.enabled (EHT expected 61)");static_assert(offsetof(esengine::ecs::MeshCollider3D, mesh) == 0, "ABI offset drift: esengine::ecs::MeshCollider3D.mesh (EHT expected 0)");static_assert(offsetof(esengine::ecs::MeshCollider3D, friction) == 4, "ABI offset drift: esengine::ecs::MeshCollider3D.friction (EHT expected 4)");static_assert(offsetof(esengine::ecs::MeshCollider3D, restitution) == 8, "ABI offset drift: esengine::ecs::MeshCollider3D.restitution (EHT expected 8)");static_assert(offsetof(esengine::ecs::MeshCollider3D, layer) == 12, "ABI offset drift: esengine::ecs::MeshCollider3D.layer (EHT expected 12)");static_assert(offsetof(esengine::ecs::MeshCollider3D, enabled) == 16, "ABI offset drift: esengine::ecs::MeshCollider3D.enabled (EHT expected 16)");+static_assert(offsetof(esengine::ecs::MeshRenderer, texture) == 0, "ABI offset drift: esengine::ecs::MeshRenderer.texture (EHT expected 0)");+static_assert(offsetof(esengine::ecs::MeshRenderer, normalMap) == 4, "ABI offset drift: esengine::ecs::MeshRenderer.normalMap (EHT expected 4)");+static_assert(offsetof(esengine::ecs::MeshRenderer, color) == 8, "ABI offset drift: esengine::ecs::MeshRenderer.color (EHT expected 8)");+static_assert(offsetof(esengine::ecs::MeshRenderer, layer) == 24, "ABI offset drift: esengine::ecs::MeshRenderer.layer (EHT expected 24)");+static_assert(offsetof(esengine::ecs::MeshRenderer, opaque) == 28, "ABI offset drift: esengine::ecs::MeshRenderer.opaque (EHT expected 28)");+static_assert(offsetof(esengine::ecs::MeshRenderer, cullBackfaces) == 29, "ABI offset drift: esengine::ecs::MeshRenderer.cullBackfaces (EHT expected 29)");+static_assert(offsetof(esengine::ecs::MeshRenderer, lit) == 30, "ABI offset drift: esengine::ecs::MeshRenderer.lit (EHT expected 30)");+static_assert(offsetof(esengine::ecs::MeshRenderer, parallax) == 32, "ABI offset drift: esengine::ecs::MeshRenderer.parallax (EHT expected 32)");+static_assert(offsetof(esengine::ecs::MeshRenderer, material) == 40, "ABI offset drift: esengine::ecs::MeshRenderer.material (EHT expected 40)");+static_assert(offsetof(esengine::ecs::MeshRenderer, enabled) == 44, "ABI offset drift: esengine::ecs::MeshRenderer.enabled (EHT expected 44)");+static_assert(offsetof(esengine::ecs::MeshRenderer, mesh) == 48, "ABI offset drift: esengine::ecs::MeshRenderer.mesh (EHT expected 48)");static_assert(offsetof(esengine::ecs::ParticleEmitter, rate) == 0, "ABI offset drift: esengine::ecs::ParticleEmitter.rate (EHT expected 0)");static_assert(offsetof(esengine::ecs::ParticleEmitter, burstCount) == 4, "ABI offset drift: esengine::ecs::ParticleEmitter.burstCount (EHT expected 4)");static_assert(offsetof(esengine::ecs::ParticleEmitter, burstInterval) == 8, "ABI offset drift: esengine::ecs::ParticleEmitter.burstInterval (EHT expected 8)");@@ -3065,7 +3065,7 @@ static_assert(offsetof(esengine::ecs::Velocity, angular) == 12, "ABI offset drif// ABI Hash -- runtime handshake against the SDK bundle// =============================================================================-static const char* kEsAbiLayoutHash = "dc813d9c5d77b235";+static const char* kEsAbiLayoutHash = "43f91684e5f3d3fb";std::string esengineGetAbiLayoutHash() {return std::string(kEsAbiLayoutHash);diff --git a/src/esengine/bindings/WebSDKEntry.cpp b/src/esengine/bindings/WebSDKEntry.cppindex c08d9225b..0ffd96ae4 100644--- a/src/esengine/bindings/WebSDKEntry.cpp+++ b/src/esengine/bindings/WebSDKEntry.cpp@@ -521,18 +521,18 @@ EMSCRIPTEN_BINDINGS(esengine_renderer) {emscripten::function("renderer_submitSkeletalBatchByEntity", &esengine::renderer_submitSkeletalBatchByEntity);#endifemscripten::function("renderer_submitTextBatch", &esengine::renderer_submitTextBatch);- emscripten::function("mesh2d_setGeometry", &esengine::mesh2d_setGeometry);+ emscripten::function("meshRenderer_setGeometry", &esengine::meshRenderer_setGeometry);emscripten::function("mesh_create", &esengine::mesh_create);emscripten::function("mesh_createFromChannels", &esengine::mesh_createFromChannels);emscripten::function("mesh_release", &esengine::mesh_release);emscripten::function("environment_create", &esengine::environment_create);emscripten::function("environment_release", &esengine::environment_release);- emscripten::function("mesh2d_setMesh", &esengine::mesh2d_setMesh);- emscripten::function("mesh2d_localBounds", &esengine::mesh2d_localBounds);- emscripten::function("mesh2d_makeResident", &esengine::mesh2d_makeResident);- emscripten::function("mesh2d_makeAllResident", &esengine::mesh2d_makeAllResident);- emscripten::function("mesh2d_setMeshAll", &esengine::mesh2d_setMeshAll);- emscripten::function("mesh2d_setMaterialAll", &esengine::mesh2d_setMaterialAll);+ emscripten::function("meshRenderer_setMesh", &esengine::meshRenderer_setMesh);+ emscripten::function("meshRenderer_localBounds", &esengine::meshRenderer_localBounds);+ emscripten::function("meshRenderer_makeResident", &esengine::meshRenderer_makeResident);+ emscripten::function("meshRenderer_makeAllResident", &esengine::meshRenderer_makeAllResident);+ emscripten::function("meshRenderer_setMeshAll", &esengine::meshRenderer_setMeshAll);+ emscripten::function("meshRenderer_setMaterialAll", &esengine::meshRenderer_setMaterialAll);emscripten::function("material_compileEsshader", &esengine::material_compileEsshader);emscripten::function("esshader_cookInfo", &esengine::esshader_cookInfo);diff --git a/src/esengine/ecs/components/Light2D.hpp b/src/esengine/ecs/components/Light.hppsimilarity index 94%rename from src/esengine/ecs/components/Light2D.hpprename to src/esengine/ecs/components/Light.hppindex 2b71df4b0..a79bc9b77 100644--- a/src/esengine/ecs/components/Light2D.hpp+++ b/src/esengine/ecs/components/Light.hpp@@ -1,9 +1,9 @@// SPDX-License-Identifier: Apache-2.0// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team/**- * @file Light2D.hpp+ * @file Light.hpp* @brief 2D light source component for the Lit2D material domain.- * @details A scene's Light2D components are gathered by the render collect path into the+ * @details A scene's Light components are gathered by the render collect path into the* per-frame LightConstants UBO (binding 2); Lit2D-domain material shaders read them* via the injected applyLighting2D() helper. Point/Directional/Spot lights occupy a* light slot; Ambient lights sum into the ambient term. This component carries only@@ -33,7 +33,7 @@ namespace esengine::ecs {* normal/position.*/ES_ENUM()-enum class Light2DType : i32 {+enum class LightType : i32 {Point = 0,Directional = 1,Ambient = 2,@@ -44,16 +44,16 @@ enum class Light2DType : i32 {* @brief A 2D light contributing to Lit2D-shaded materials.** @code- * auto& light = registry.emplace<Light2D>(e);- * light.type = static_cast<i32>(Light2DType::Directional);+ * auto& light = registry.emplace<Light>(e);+ * light.type = static_cast<i32>(LightType::Directional);* light.color = {0, 1, 0}; // green* light.intensity = 1.0f;* @endcode*/ES_COMPONENT(renderable=enabled)-struct Light2D {- /** @brief Light kind: 0 = Point, 1 = Directional, 2 = Ambient (see Light2DType). */- ES_PROPERTY(enum=Light2DType, tooltip="Point, Directional, Ambient, or Spot.")+struct Light {+ /** @brief Light kind: 0 = Point, 1 = Directional, 2 = Ambient (see LightType). */+ ES_PROPERTY(enum=LightType, tooltip="Point, Directional, Ambient, or Spot.")i32 type{0};/** @brief Light color, multiplied by intensity. RGBA for editor color-picker consistencydiff --git a/src/esengine/ecs/components/Mesh2D.hpp b/src/esengine/ecs/components/MeshRenderer.hppsimilarity index 89%rename from src/esengine/ecs/components/Mesh2D.hpprename to src/esengine/ecs/components/MeshRenderer.hppindex be32a69d1..2b70f8697 100644--- a/src/esengine/ecs/components/Mesh2D.hpp+++ b/src/esengine/ecs/components/MeshRenderer.hpp@@ -1,13 +1,13 @@// SPDX-License-Identifier: Apache-2.0// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team/**- * @file Mesh2D.hpp+ * @file MeshRenderer.hpp* @brief Arbitrary-geometry 2D mesh renderable (deformed sprites, polygons, water* surfaces, procedural shapes).* @details Vertices live in component-local space and stream through the unified* Batch face each frame (CPU-transformed like every 2D renderable), so a* mesh participates in sorting, clipping, and multi-texture merging exactly- * like a sprite. Geometry is set via mesh2d_setGeometry (bulk upload with+ * like a sprite. Geometry is set via meshRenderer_setGeometry (bulk upload with* index validation), not per-field reflection.** @author ESEngine Team@@ -39,11 +39,11 @@ struct MeshVertex2D {};// =============================================================================-// Mesh2D Component+// MeshRenderer Component// =============================================================================ES_COMPONENT(renderable=enabled)-struct Mesh2D {+struct MeshRenderer {/** @brief Texture sampled by the mesh UVs (invalid = untextured, vertex colors only) */ES_PROPERTY(asset = texture)resource::TextureHandle texture;@@ -73,8 +73,8 @@ struct Mesh2D {ES_PROPERTY(tooltip="Cull back faces: triangles facing away from the camera are skipped.")bool cullBackfaces{false};- /** @brief Lit by the scene's 2D lights (Light2D). A custom material overrides this. */- ES_PROPERTY(tooltip="Receive 2D lights: Light2D entities light this mesh (flat normal). A custom material overrides this.")+ /** @brief Lit by the scene's 2D lights (Light). A custom material overrides this. */+ ES_PROPERTY(tooltip="Receive 2D lights: Light entities light this mesh (flat normal). A custom material overrides this.")bool lit{false};/** @brief Parallax scroll factor per axis. 1 = moves with the world (default, no@@ -101,7 +101,7 @@ struct Mesh2D {resource::MeshHandle mesh;// -------------------------------------------------------------------------- // Geometry payload — set via mesh2d_setGeometry, streamed by MeshPlugin.+ // Geometry payload — set via meshRenderer_setGeometry, streamed by MeshPlugin.// Deliberately un-annotated: variable-size data has no fixed ABI offset, so it// stays out of the EHT reflection/pointer layout (all annotated fields above// keep their asserted offsets because these members come last).@@ -117,7 +117,7 @@ struct Mesh2D {glm::vec2 localMin{0.0f, 0.0f};glm::vec2 localMax{0.0f, 0.0f};- Mesh2D() = default;+ MeshRenderer() = default;};// =============================================================================@@ -125,9 +125,9 @@ struct Mesh2D {// =============================================================================/**- * @brief What deforms a @ref Mesh2D: the entities its Joints channel indexes.+ * @brief What deforms a @ref MeshRenderer: the entities its Joints channel indexes.*- * @details Its own component because Mesh2D says WHAT is drawn and this says+ * @details Its own component because MeshRenderer says WHAT is drawn and this says* what moves it; entry i drives joint i of the mesh's own bind* matrices. A skinned mesh's own transform is ignored (glTF requires* it) — the joints are placed in the world, so the vertices are too.diff --git a/src/esengine/ecs/components/Sprite.hpp b/src/esengine/ecs/components/Sprite.hppindex d8636fc13..1a33ec51b 100644--- a/src/esengine/ecs/components/Sprite.hpp+++ b/src/esengine/ecs/components/Sprite.hpp@@ -73,8 +73,8 @@ struct Sprite {ES_PROPERTY(step=1, enum_source=sortingLayers, tooltip="Sorting layer — controls draw order across sprites.")i32 layer{0};- /** @brief Lit by the scene's 2D lights (Light2D), no material needed. Off = unlit. */- ES_PROPERTY(tooltip="Receive 2D lights: Light2D entities light this sprite (flat normal). A custom material overrides this.")+ /** @brief Lit by the scene's 2D lights (Light), no material needed. Off = unlit. */+ ES_PROPERTY(tooltip="Receive 2D lights: Light entities light this sprite (flat normal). A custom material overrides this.")bool lit{false};/** @brief Flip sprite horizontally */diff --git a/src/esengine/ecs/components/TrailRenderer.hpp b/src/esengine/ecs/components/TrailRenderer.hppindex f2d372521..35a9d150a 100644--- a/src/esengine/ecs/components/TrailRenderer.hpp+++ b/src/esengine/ecs/components/TrailRenderer.hpp@@ -8,7 +8,7 @@* history owned by TrailSystem (per-frame gameplay sim, like the particle* system) — this component is PURE CONFIG. TrailPlugin turns that history* into a triangle-strip ribbon each frame and streams it through the unified- * Batch face (CPU-generated verts, exactly like Mesh2D), so a trail sorts,+ * Batch face (CPU-generated verts, exactly like MeshRenderer), so a trail sorts,* clips, and multi-texture-merges like every other 2D renderable. No new GPU* path, no line-strip topology — a ribbon is triangles.*diff --git a/src/esengine/renderer/frame/RenderContext.hpp b/src/esengine/renderer/frame/RenderContext.hppindex d3ea2325b..b5aa95bee 100644--- a/src/esengine/renderer/frame/RenderContext.hpp+++ b/src/esengine/renderer/frame/RenderContext.hpp@@ -181,7 +181,7 @@ public:/*** @brief The engine-side per-frame 2D light registry (binding 2 LightConstants UBO).- * @details Filled by the render collect path from the scene's Light2D components and uploaded+ * @details Filled by the render collect path from the scene's Light components and uploaded* once per frame; Lit2D material shaders read it. Lives here next to materials() so* the render path reaches one store / one UBO without a global lookup.*/diff --git a/src/esengine/renderer/frame/RenderFrame.cpp b/src/esengine/renderer/frame/RenderFrame.cppindex e5f910896..1c465ddbc 100644--- a/src/esengine/renderer/frame/RenderFrame.cpp+++ b/src/esengine/renderer/frame/RenderFrame.cpp@@ -6,9 +6,9 @@#include "../store/LightStore.hpp"#include "../draw/BatchBuilder.hpp"#include "../../ecs/components/Transform.hpp"-#include "../../ecs/components/Light2D.hpp"+#include "../../ecs/components/Light.hpp"#include "../../ecs/components/ShadowCaster2D.hpp"-#include "../../ecs/components/Mesh2D.hpp"+#include "../../ecs/components/MeshRenderer.hpp"#include "../../resource/ShaderParser.hpp"#include "../../core/Log.hpp"#include "../../core/FrameProfiler.hpp"@@ -687,17 +687,17 @@ void RenderFrame::collectLights(ecs::Registry& registry) {// A light's Transform need is type-dependent. Ambient is a flat scene-wide term and// reads none of it; Directional takes only the rotation, so it works without one and// aims into the screen; Point/Spot need a position and are skipped without one.- auto view = registry.view<ecs::Light2D>();+ auto view = registry.view<ecs::Light>();for (auto entity : view) {const auto& light = view.get(entity);if (!light.enabled || light.intensity <= 0.0f) continue;- const auto type = static_cast<ecs::Light2DType>(light.type);+ const auto type = static_cast<ecs::LightType>(light.type);// color.a is unused; intensity carries the strength. Authored sRGB ->// linear when the frame lights in linear space.const glm::vec3 rgb = linear_color_ ? srgbToLinearCpu(glm::vec3{light.color}): glm::vec3{light.color};- if (type == ecs::Light2DType::Ambient) {+ if (type == ecs::LightType::Ambient) {// An environment REPLACES this light's flat term rather than adding to// it: its coefficients already carry the same colour, and summing both// would light the scene twice from one source.@@ -714,7 +714,7 @@ void RenderFrame::collectLights(ecs::Registry& registry) {// directional branch of shadowFactor2D reads it; 0 keeps directional shadows off).gpu.shadow = glm::vec4(std::max(light.shadowSoftness, 0.0f),std::max(light.shadowDistance, 0.0f), 0.0f, 0.0f);- if (type == ecs::Light2DType::Directional) {+ if (type == ecs::LightType::Directional) {// z=1 flags directional (no attenuation) in the shader; w carries the aim's third// component, which only a directional light has a use for — point and spot spend// that slot on their falloff radius.@@ -739,13 +739,13 @@ void RenderFrame::collectLights(ecs::Registry& registry) {if (!transform) continue; // a positional light with no position casts nothingtransform->ensureDecomposed();const glm::vec3 p = transform->worldPosition;- const f32 typeId = (type == ecs::Light2DType::Spot) ? 2.0f : 0.0f;+ const f32 typeId = (type == ecs::LightType::Spot) ? 2.0f : 0.0f;gpu.posDir = glm::vec4(p.x, p.y, typeId, light.radius);// The height a surface with real geometry measures against. A sprite has no// depth of its own and keeps the plane's convention, so this reaches only the// MESH_NORMALS half of the lighting loop.gpu.shadow.z = p.z;- if (type == ecs::Light2DType::Spot) {+ if (type == ecs::LightType::Spot) {// Split across two slots because the two shading halves read different// parts: the plane's xy, and the whole of it in three.const glm::vec3 aim = lightForward(transform);@@ -763,7 +763,7 @@ void RenderFrame::collectLights(ecs::Registry& registry) {// six times.if (light.meshShadows) {castsMeshShadow = true;- caster.shape = type == ecs::Light2DType::Spot ? ShadowShape::Cone+ caster.shape = type == ecs::LightType::Spot ? ShadowShape::Cone: ShadowShape::Cube;caster.pos = p;caster.range = std::max(light.radius, 0.0f);@@ -807,7 +807,7 @@ void RenderFrame::collectLights(ecs::Registry& registry) {}}-bool RenderFrame::collectEnvironment(const ecs::Light2D& light, const glm::vec3& scale) {+bool RenderFrame::collectEnvironment(const ecs::Light& light, const glm::vec3& scale) {if (!light.environment.isValid()) return false;const Environment* environment = resource_manager_.getEnvironment(light.environment);if (!environment) return false;@@ -835,10 +835,10 @@ bool RenderFrame::collectEnvironment(const ecs::Light2D& light, const glm::vec3&/// a shadow map has to cover, casters and receivers alike. Rotation is ignored,/// the same approximation MeshPlugin's own cull uses.bool RenderFrame::meshWorldBounds(ecs::Registry& registry, glm::vec3& outMin, glm::vec3& outMax) {- auto meshes = registry.view<ecs::Transform, ecs::Mesh2D>();+ auto meshes = registry.view<ecs::Transform, ecs::MeshRenderer>();bool any = false;for (auto entity : meshes) {- const auto& mesh = meshes.get<ecs::Mesh2D>(entity);+ const auto& mesh = meshes.get<ecs::MeshRenderer>(entity);if (!mesh.enabled || !mesh.mesh.isValid()) continue;const Mesh* resident = resource_manager_.getMesh(mesh.mesh);if (!resident) continue;diff --git a/src/esengine/renderer/frame/RenderFrame.hpp b/src/esengine/renderer/frame/RenderFrame.hppindex e7a746695..152932684 100644--- a/src/esengine/renderer/frame/RenderFrame.hpp+++ b/src/esengine/renderer/frame/RenderFrame.hpp@@ -29,7 +29,7 @@namespace esengine {-namespace ecs { struct Light2D; }+namespace ecs { struct Light; }/// The one shadow texture every map a frame renders shares. One size for every/// scene: coverage adapts to the camera instead, so texel density is a property of@@ -340,7 +340,7 @@ private:* once anything does — culling would make a per-frame answer flap.*/void applySceneDepthNeed();- /// Gathers the scene's enabled Light2D components into the per-frame LightConstants UBO+ /// Gathers the scene's enabled Light components into the per-frame LightConstants UBO/// (point/directional into the light array, ambient summed). Run each frame in collectAll;/// flush() uploads + binds the result so Lit2D material shaders read it.void collectLights(ecs::Registry& registry);@@ -349,7 +349,7 @@ private:/// loaded. `scale` is the light's colour times its intensity, folded into the/// coefficients — an environment is what the light casts, not a second source./// @return false when it names none, leaving the caller to add a flat term.- bool collectEnvironment(const ecs::Light2D& light, const glm::vec3& scale);+ bool collectEnvironment(const ecs::Light& light, const glm::vec3& scale);/*** @brief Draws the scene's mesh occluders from the shadow-casting light, into a map* the main pass samples.diff --git a/src/esengine/renderer/plugins/MeshPlugin.cpp b/src/esengine/renderer/plugins/MeshPlugin.cppindex 37b7336b4..4f834da39 100644--- a/src/esengine/renderer/plugins/MeshPlugin.cpp+++ b/src/esengine/renderer/plugins/MeshPlugin.cpp@@ -7,7 +7,7 @@#include "../rhi/Texture.hpp"#include "../rhi/ShaderEmbeds.generated.hpp"#include "../../ecs/components/Transform.hpp"-#include "../../ecs/components/Mesh2D.hpp"+#include "../../ecs/components/MeshRenderer.hpp"#include "../../resource/Mesh.hpp"#include "../../resource/ShaderParser.hpp"#include "../../core/Log.hpp"@@ -167,12 +167,12 @@ void MeshPlugin::collect(RenderCollectContext& collect_ctx) {auto& buffers = collect_ctx.buffer_pool;auto& draw_list = collect_ctx.draw_list;auto& ctx = collect_ctx.frame_context;- auto meshView = registry.view<ecs::Transform, ecs::Mesh2D>();+ auto meshView = registry.view<ecs::Transform, ecs::MeshRenderer>();u32 litProgram = 0;for (auto entity : meshView) {- const auto& mesh = meshView.get<ecs::Mesh2D>(entity);+ const auto& mesh = meshView.get<ecs::MeshRenderer>(entity);// Empty indices no longer mean "nothing to draw": a resident mesh keeps// its geometry on the GPU and its inline payload deliberately empty.if (!mesh.enabled || (mesh.indices.empty() && !mesh.mesh.isValid())) continue;@@ -333,7 +333,7 @@ void MeshPlugin::collect(RenderCollectContext& collect_ctx) {if (materialProgram == 0) {if (!warned_material_) {warned_material_ = true;- ES_LOG_WARN("Mesh2D: material {} has no mesh variant; using the mesh shader",+ ES_LOG_WARN("MeshRenderer: material {} has no mesh variant; using the mesh shader",key.materialId);}key.materialId = 0;diff --git a/src/esengine/renderer/plugins/MeshPlugin.hpp b/src/esengine/renderer/plugins/MeshPlugin.hppindex 5f63692a8..83b91e6eb 100644--- a/src/esengine/renderer/plugins/MeshPlugin.hpp+++ b/src/esengine/renderer/plugins/MeshPlugin.hpp@@ -12,7 +12,7 @@namespace esengine {/**- * @brief Scene-level 2D mesh renderer (Mesh2D component).+ * @brief Scene-level 2D mesh renderer (MeshRenderer component).* @details Streams component-local geometry through the unified Batch face each* frame — CPU-transformed like every 2D renderable — so meshes sort, clip,* light, and multi-texture-merge exactly like sprites. The whole plugin isdiff --git a/src/esengine/renderer/plugins/TrailPlugin.hpp b/src/esengine/renderer/plugins/TrailPlugin.hppindex e70d8845c..279e082b8 100644--- a/src/esengine/renderer/plugins/TrailPlugin.hpp+++ b/src/esengine/renderer/plugins/TrailPlugin.hpp@@ -21,7 +21,7 @@ struct TrailCenter {* @brief Motion-trail renderer (TrailRenderer component).* @details Reads the per-entity point history from TrailSystem and turns it into a* tapered, fading triangle-strip ribbon streamed through the unified Batch- * face each frame — CPU-generated verts, exactly like Mesh2D, so trails sort,+ * face each frame — CPU-generated verts, exactly like MeshRenderer, so trails sort,* clip, and multi-texture-merge like sprites. The RHI is triangle-only, so a* ribbon (not a GPU line-strip) is the whole trick: no bottom-layer changes.*/diff --git a/src/esengine/renderer/store/LightConstants.hpp b/src/esengine/renderer/store/LightConstants.hppindex d1ca48c94..85c31da87 100644--- a/src/esengine/renderer/store/LightConstants.hpp+++ b/src/esengine/renderer/store/LightConstants.hpp@@ -7,7 +7,7 @@* @details A Lit2D-domain material shader (#pragma domain Lit2D) gets a `layout(std140) uniform* LightConstants { ... }` block auto-injected by ShaderParser, and Shader::compile links* it to LIGHT_CONSTANTS_BINDING. LightStore (owned by RenderContext) collects the scene's- * Light2D components into this CPU mirror each frame and uploads it once. The GLSL struct+ * Light components into this CPU mirror each frame and uploads it once. The GLSL struct* layout MUST match this std140 mirror exactly — a mismatch silently corrupts lighting.*/#pragma oncediff --git a/src/esengine/renderer/store/LightStore.hpp b/src/esengine/renderer/store/LightStore.hppindex 1ce4e5bf5..0a402b13c 100644--- a/src/esengine/renderer/store/LightStore.hpp+++ b/src/esengine/renderer/store/LightStore.hpp@@ -4,7 +4,7 @@* @file LightStore.hpp* @brief Engine-side 2D light registry — the per-frame LightConstants UBO and its CPU mirror.* @details The render collect path clears this each frame, then accumulates the scene's enabled- * Light2D components into it (point/directional into the lights array, ambient summed+ * Light components into it (point/directional into the lights array, ambient summed* into the ambient term). flush() uploads the mirror once and binds it at* LIGHT_CONSTANTS_BINDING, so every Lit2D shader reads the same lighting UBO. Owned by* RenderContext so both the render path and any future SDK push reach one store / one UBO.diff --git a/templates/2d-platformer/assets/scenes/main.esscene b/templates/2d-platformer/assets/scenes/main.essceneindex fc0aeb360..c98b5730f 100644--- a/templates/2d-platformer/assets/scenes/main.esscene+++ b/templates/2d-platformer/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","folders": ["Environment",diff --git a/templates/3d-starter/assets/scenes/main.esscene b/templates/3d-starter/assets/scenes/main.essceneindex b37eb7503..14bee6ab2 100644--- a/templates/3d-starter/assets/scenes/main.esscene+++ b/templates/3d-starter/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","folders": ["Lighting",@@ -71,7 +71,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 1,"intensity": 1.05,@@ -105,7 +105,7 @@}},{- "type": "Light2D",+ "type": "Light","data": {"type": 2,"intensity": 0.42,@@ -144,7 +144,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:plane","lit": true,@@ -221,7 +221,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -278,7 +278,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -335,7 +335,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:cube","lit": true,@@ -392,7 +392,7 @@}},{- "type": "Mesh2D",+ "type": "MeshRenderer","data": {"mesh": "builtin:capsule","lit": true,diff --git a/templates/blank/assets/scenes/main.esscene b/templates/blank/assets/scenes/main.essceneindex 5d8d274c7..929007828 100644--- a/templates/blank/assets/scenes/main.esscene+++ b/templates/blank/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/templates/pixel-rpg/assets/scenes/main.esscene b/templates/pixel-rpg/assets/scenes/main.essceneindex 5eb7bff17..2aac063f8 100644--- a/templates/pixel-rpg/assets/scenes/main.esscene+++ b/templates/pixel-rpg/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/templates/playable-ad/assets/scenes/main.esscene b/templates/playable-ad/assets/scenes/main.essceneindex 250ecd1a9..dfc00368f 100644--- a/templates/playable-ad/assets/scenes/main.esscene+++ b/templates/playable-ad/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/templates/top-down/assets/scenes/main.esscene b/templates/top-down/assets/scenes/main.essceneindex 760e27faf..ebe04181f 100644--- a/templates/top-down/assets/scenes/main.esscene+++ b/templates/top-down/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","folders": ["Level"diff --git a/templates/ui-game/assets/scenes/main.esscene b/templates/ui-game/assets/scenes/main.essceneindex 2cf3ed5ac..3c5ebd255 100644--- a/templates/ui-game/assets/scenes/main.esscene+++ b/templates/ui-game/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/templates/wechat-minigame/assets/scenes/main.esscene b/templates/wechat-minigame/assets/scenes/main.essceneindex d61d14d53..558970be6 100644--- a/templates/wechat-minigame/assets/scenes/main.esscene+++ b/templates/wechat-minigame/assets/scenes/main.esscene@@ -1,5 +1,5 @@{- "version": 1,+ "version": 2,"name": "Main","entities": [{diff --git a/tests/renderer/webgpu_engine_bringup.cpp b/tests/renderer/webgpu_engine_bringup.cppindex a790177a4..0ac58e625 100644--- a/tests/renderer/webgpu_engine_bringup.cpp+++ b/tests/renderer/webgpu_engine_bringup.cpp@@ -24,7 +24,7 @@#include "esengine/ecs/components/Transform.hpp"#include "esengine/ecs/components/Sprite.hpp"#include "esengine/ecs/components/ShapeRenderer.hpp"-#include "esengine/ecs/components/Light2D.hpp"+#include "esengine/ecs/components/Light.hpp"#include "esengine/renderer/frame/RenderContext.hpp"#include "esengine/renderer/frame/RenderFrame.hpp"#include "esengine/renderer/webgpu/WebGPUDevice.hpp"@@ -283,8 +283,8 @@ bool buildScene(EstellaContext& ctx, ecs::Registry& registry) {auto e = registry.create();auto& t = registry.emplace<ecs::Transform>(e);t.position = {64.0f, 80.0f, 0.0f}; // centered on the lit sprite: ndotl = 1, atten = 1- auto& l = registry.emplace<ecs::Light2D>(e);- l.type = static_cast<i32>(ecs::Light2DType::Point);+ auto& l = registry.emplace<ecs::Light>(e);+ l.type = static_cast<i32>(ecs::LightType::Point);l.color = {1.0f, 0.0f, 0.0f, 1.0f};l.intensity = 1.0f;l.radius = 200.0f;@@ -292,8 +292,8 @@ bool buildScene(EstellaContext& ctx, ecs::Registry& registry) {{auto e = registry.create();registry.emplace<ecs::Transform>(e);- auto& l = registry.emplace<ecs::Light2D>(e);- l.type = static_cast<i32>(ecs::Light2DType::Ambient);+ auto& l = registry.emplace<ecs::Light>(e);+ l.type = static_cast<i32>(ecs::LightType::Ambient);l.color = {1.0f, 1.0f, 1.0f, 1.0f};l.intensity = 0.2f;}diff --git a/tools/apiSubsystems.mjs b/tools/apiSubsystems.mjsindex 67e543dbd..a3bac78a0 100644--- a/tools/apiSubsystems.mjs+++ b/tools/apiSubsystems.mjs@@ -207,6 +207,6 @@ export const SUBSYSTEMS = [tier: 'experimental',why: 'as AI — and the render graph behind it is still moving',whyZh: '同 AI —— 而且它背后的 render graph 还在动',- entry: ['Material', 'Light2D', 'PostProcessStack'],+ entry: ['Material', 'Light', 'PostProcessStack'],},];diff --git a/tools/check-component-fields.mjs b/tools/check-component-fields.mjsindex 507222413..f95d3c92f 100644--- a/tools/check-component-fields.mjs+++ b/tools/check-component-fields.mjs@@ -4,7 +4,7 @@* @file check-component-fields.mjs — a declared field has a reader.** A component field is a knob in the inspector. One nothing reads is a knob that- * does nothing, and it looks exactly like one that works: `Mesh2D.lit` sat there+ * does nothing, and it looks exactly like one that works: `MeshRenderer.lit` sat there* for five bricks while the mesh path picked its shader from the geometry* instead, so imported models could not be drawn unlit and geometry without* normals could not be lit at all.diff --git a/tools/check-gizmo-coverage.mjs b/tools/check-gizmo-coverage.mjsindex eeb91e32c..019c84370 100644--- a/tools/check-gizmo-coverage.mjs+++ b/tools/check-gizmo-coverage.mjs@@ -33,7 +33,7 @@ const SPATIAL_FIELDS = new Set(['halfExtents', 'radius', 'shapeRadius', 'halfHei* needs no outline) and a post-process volume (drawn by nothing at all), and* dropping the name to avoid the first hid the second for as long as it existed.*/-const DRAWS_ITSELF = new Set(['Sprite', 'ShapeRenderer', 'Mesh2D', 'BitmapText', 'UIVisual', 'UINode']);+const DRAWS_ITSELF = new Set(['Sprite', 'ShapeRenderer', 'MeshRenderer', 'BitmapText', 'UIVisual', 'UINode']);/** Components whose extent is deliberately not drawn, and why. */const DECLARED_GAPS = {};diff --git a/tools/eht/parser.py b/tools/eht/parser.pyindex 75357ce39..51ca14e43 100644--- a/tools/eht/parser.py+++ b/tools/eht/parser.py@@ -64,7 +64,7 @@ class CppParser:# Enum::Member, or a braced vector `{100, 100}`.'editor_default',# `shown_when=<field>:<Name>|<Name>` scopes a field to the states of a sibling- # discriminator it means anything in — Light2D.radius to Point and Spot, a+ # discriminator it means anything in — Light.radius to Point and Spot, a# trail's tuning to trailEnabled:true. The states are named, never numbered,# and resolved against that field's own enum when the metadata is generated,# so reordering the enum moves every rule with it.diff --git a/tools/render-host/host.ts b/tools/render-host/host.tsindex 508fab98e..f817b7100 100644--- a/tools/render-host/host.ts+++ b/tools/render-host/host.ts@@ -473,31 +473,31 @@ window.__estellaHeadless = {// Nothing about the geometry changes — same entity, same vertices, the other// path — so the frame afterwards has to be the same frame.makeMeshesResident: () => {- const m = module as unknown as { mesh2d_makeAllResident?(registry: unknown): number } | null;+ const m = module as unknown as { meshRenderer_makeAllResident?(registry: unknown): number } | null;const registry = app?.world.getCppRegistry();- if (!m?.mesh2d_makeAllResident || !registry) return 0;- return m.mesh2d_makeAllResident(registry);+ if (!m?.meshRenderer_makeAllResident || !registry) return 0;+ return m.meshRenderer_makeAllResident(registry);},// Through the asset layer, not a side door: the file goes through the same// load() every other asset type does, so what this proves is the format// reaching the screen rather than a decoder wired straight to the engine.loadMeshAsset: async (path: string) => {const assets = app?.getResource(Assets);- const m = module as unknown as { mesh2d_setMeshAll?(registry: unknown, handle: number): number } | null;+ const m = module as unknown as { meshRenderer_setMeshAll?(registry: unknown, handle: number): number } | null;const registry = app?.world.getCppRegistry();- if (!assets || !m?.mesh2d_setMeshAll || !registry) return 0;+ if (!assets || !m?.meshRenderer_setMeshAll || !registry) return 0;const mesh = await assets.load<{ handle: number }>('mesh', path);if (!mesh?.handle) return 0;- return m.mesh2d_setMeshAll(registry, mesh.handle);+ return m.meshRenderer_setMeshAll(registry, mesh.handle);},loadMaterialAsset: async (path: string) => {const assets = app?.getResource(Assets);- const m = module as unknown as { mesh2d_setMaterialAll?(registry: unknown, id: number): number } | null;+ const m = module as unknown as { meshRenderer_setMaterialAll?(registry: unknown, id: number): number } | null;const registry = app?.world.getCppRegistry();- if (!assets || !m?.mesh2d_setMaterialAll || !registry) return 0;+ if (!assets || !m?.meshRenderer_setMaterialAll || !registry) return 0;const material = await assets.load<{ handle: number }>('material', path);if (!material?.handle) return 0;- return m.mesh2d_setMaterialAll(registry, material.handle);+ return m.meshRenderer_setMaterialAll(registry, material.handle);},// A prefab brings its own asset refs, so this hands the file to the engine's// own instantiation and asserts nothing about what it names: the claim isdiff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjsindex 45ba86074..9bc28a283 100644--- a/tools/renderScenes.mjs+++ b/tools/renderScenes.mjs@@ -52,7 +52,7 @@ export const SCENES = [// plane the eye most faces, which head-on is the 2D plane — so the grid covers the// frame instead of collapsing to the one stroke an edge-on plane draws.{ id: "editor-grid-head-on", tier: "pr", host: "editor", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mesh-instanced.esscene", ESTELLA_VERIFY_GRID: "64", ESTELLA_VERIFY_PERSPECTIVE: "1", ESTELLA_VERIFY_ORBIT: "0,0", ESTELLA_VERIFY_STEPS: "3" } },- { id: "mesh2d", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mesh2d.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh2d.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.40,\"rgb\":[255,0,0],\"tol\":40}]" } },+ { id: "mesh-renderer", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mesh-renderer.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-renderer.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.40,\"rgb\":[255,0,0],\"tol\":40}]" } },{ id: "parallax-shape", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/parallax-shape.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/parallax-shape.textures.json", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.25,\"y\":0.5,\"rgb\":[255,0,0],\"tol\":40}]" } },{ id: "tilemap-flip", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/tilemap-flip.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/tilemap-flip.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.40,\"y\":0.36,\"rgb\":[255,0,0]},{\"x\":0.60,\"y\":0.36,\"rgb\":[0,255,0]},{\"x\":0.40,\"y\":0.58,\"rgb\":[0,0,255]},{\"x\":0.60,\"y\":0.58,\"rgb\":[255,255,0]}]" } },// A layer's own offset, set through the inspector's door: 16 world units is one@@ -246,14 +246,14 @@ export const SCENES = [{ id: "material-preview", tier: "pr", host: "editor", webgpu: { ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[255,0,0],\"tol\":40}]" }, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-tint.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-tint.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_PREVIEW: "{\"w\":64,\"h\":64,\"rgb\":[255,0,0],\"tol\":45}" } },{ id: "tilemap-hex", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/tilemap-hex.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/tilemap-hex.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "6", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.40,\"y\":0.40,\"rgb\":[255,0,0]},{\"x\":0.60,\"y\":0.40,\"rgb\":[0,255,0]},{\"x\":0.50,\"y\":0.55,\"rgb\":[0,0,255]},{\"x\":0.70,\"y\":0.55,\"rgb\":[255,255,0]}]" } },{ id: "postprocess-lut", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_SCENE: "/scenes/lut-grade.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/lut-grade.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "10", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.292,\"y\":0.5,\"rgb\":[0,0,255],\"tol\":40},{\"x\":0.708,\"y\":0.5,\"rgb\":[255,0,0],\"tol\":40}]" } },- // mesh2d's scene and assertions, with its geometry frozen onto the GPU mid-run.+ // mesh-renderer's scene and assertions, with its geometry frozen onto the GPU mid-run.// Equal pixels IS the claim, so it borrows the assertions rather than restating// them; a run that froze nothing fails on its own count.// The same again, geometry arriving from a FILE: an .esmesh loaded through the// asset layer replaces the inline payload. Its fixture is written by the// engine's own encoder from this scene's vertices, so the assertions hold.- { id: "mesh-asset", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_MESH_ASSET: "/scenes/two-triangles.esmesh", ESTELLA_VERIFY_SCENE: "/scenes/mesh2d.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh2d.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.40,\"rgb\":[255,0,0],\"tol\":40}]" } },- { id: "mesh-resident", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_MESH_RESIDENT: "1", ESTELLA_VERIFY_SCENE: "/scenes/mesh2d.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh2d.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.40,\"rgb\":[255,0,0],\"tol\":40}]" } },+ { id: "mesh-asset", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_MESH_ASSET: "/scenes/two-triangles.esmesh", ESTELLA_VERIFY_SCENE: "/scenes/mesh-renderer.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-renderer.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.40,\"rgb\":[255,0,0],\"tol\":40}]" } },+ { id: "mesh-resident", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_MESH_RESIDENT: "1", ESTELLA_VERIFY_SCENE: "/scenes/mesh-renderer.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-renderer.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.40,\"rgb\":[255,0,0],\"tol\":40}]" } },// A material drawing GPU-resident geometry. Its shader writes only a fragment,// so the ENGINE owns the vertex stage and compiles a second variant for this// source; wrong placement or an ignored tint moves the probes.@@ -282,11 +282,11 @@ export const SCENES = [// NO normal channel, under a red light. Lit, its green half goes black off the// constant normal a 2D surface has; unlit, both halves are their vertex colours.{ id: "mesh-flat-lit", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mesh-flat-lit.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-flat-lit.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,0,0],\"tol\":30}]" } },- { id: "mesh-flat-lit-off", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SET_FIELD: "{\"entity\":2,\"component\":\"Mesh2D\",\"key\":\"lit\",\"value\":false}", ESTELLA_VERIFY_SCENE: "/scenes/mesh-flat-lit.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-flat-lit.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40}]" } },+ { id: "mesh-flat-lit-off", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SET_FIELD: "{\"entity\":2,\"component\":\"MeshRenderer\",\"key\":\"lit\",\"value\":false}", ESTELLA_VERIFY_SCENE: "/scenes/mesh-flat-lit.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-flat-lit.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40}]" } },// The other half of that word: geometry that DOES carry normals, told not to// take light. Its layout still declares the channel — the permutation a backend// is strictest about — and both halves come back their own colour.- { id: "mesh-lit-off", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SET_FIELD: "{\"entity\":2,\"component\":\"Mesh2D\",\"key\":\"lit\",\"value\":false}", ESTELLA_VERIFY_SCENE: "/scenes/mesh-lit.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-lit.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,255,255],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[255,255,255],\"tol\":40}]" } },+ { id: "mesh-lit-off", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SET_FIELD: "{\"entity\":2,\"component\":\"MeshRenderer\",\"key\":\"lit\",\"value\":false}", ESTELLA_VERIFY_SCENE: "/scenes/mesh-lit.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-lit.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.556,\"rgb\":[255,255,255],\"tol\":40},{\"x\":0.70,\"y\":0.556,\"rgb\":[255,255,255],\"tol\":40}]" } },// A thumbnail of the geometry itself, offscreen through the viewport's own// path. What it adds over a material ball is the FRAMING: the gate asks for a// clear border (nothing escaped) and an outer eighth reached (nothing shrank).@@ -299,11 +299,11 @@ export const SCENES = [// live loader + re-projection. The quad covers the gap between the scene's own// two triangles, so the frame says which geometry is drawn — and the hit test// lands 120 world units out, where only the mesh's own box reaches.- { id: "mesh-assign", tier: "pr", host: "editor", webgpu: true, env: { ESTELLA_VERIFY_SET_FIELD: "{\"entity\":1,\"component\":\"Mesh2D\",\"key\":\"mesh\",\"value\":\"/scenes/textured-quad.esmesh\"}", ESTELLA_VERIFY_PICK: "{\"x\":0.7,\"y\":0.3833,\"entity\":1}", ESTELLA_VERIFY_SCENE: "/scenes/mesh2d.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh2d.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[255,255,255],\"tol\":40},{\"x\":0.30,\"y\":0.556,\"rgb\":[255,255,255],\"tol\":40}]" } },+ { id: "mesh-assign", tier: "pr", host: "editor", webgpu: true, env: { ESTELLA_VERIFY_SET_FIELD: "{\"entity\":1,\"component\":\"MeshRenderer\",\"key\":\"mesh\",\"value\":\"/scenes/textured-quad.esmesh\"}", ESTELLA_VERIFY_PICK: "{\"x\":0.7,\"y\":0.3833,\"entity\":1}", ESTELLA_VERIFY_SCENE: "/scenes/mesh-renderer.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-renderer.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[255,255,255],\"tol\":40},{\"x\":0.30,\"y\":0.556,\"rgb\":[255,255,255],\"tol\":40}]" } },// The editor's eye turned 60° about Y. Where the triangles land is arithmetic:// centres at x = ±120 project to 0.40 / 0.60, with 0.30 empty. The hit test at// the new place proves screen→world followed the turn.- { id: "view-orbit", tier: "pr", host: "editor", webgpu: true, env: { ESTELLA_VERIFY_ORBIT: "60,0", ESTELLA_VERIFY_PICK: "{\"x\":0.40,\"y\":0.556,\"entity\":1}", ESTELLA_VERIFY_SCENE: "/scenes/mesh2d.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh2d.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.40,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.60,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.556,\"rgb\":[0,0,0],\"tol\":30}]" } },+ { id: "view-orbit", tier: "pr", host: "editor", webgpu: true, env: { ESTELLA_VERIFY_ORBIT: "60,0", ESTELLA_VERIFY_PICK: "{\"x\":0.40,\"y\":0.556,\"entity\":1}", ESTELLA_VERIFY_SCENE: "/scenes/mesh-renderer.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-renderer.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.40,\"y\":0.556,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.60,\"y\":0.556,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.556,\"rgb\":[0,0,0],\"tol\":30}]" } },// Two blended quads side by side in X at the SAME world z, the far one submitted// last, seen from an eye turned -60° about Y. Equal world z ties, and the tie puts// the FAR quad on top; only a viewer-measured depth puts the near (green) one there.@@ -316,7 +316,7 @@ export const SCENES = [// one side. Painter's order cannot draw that — with `opaque` the halves resolve// by depth (left green, right red), and without it the later draw takes both.{ id: "mesh-opaque", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mesh-depth.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-depth.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.42,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.58,\"y\":0.5,\"rgb\":[255,0,0],\"tol\":40}]" } },- { id: "mesh-opaque-off", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SET_FIELD: "{\"entity\":2,\"component\":\"Mesh2D\",\"key\":\"opaque\",\"value\":false}", ESTELLA_VERIFY_SCENE: "/scenes/mesh-depth.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-depth.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.42,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.58,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40}]" } },+ { id: "mesh-opaque-off", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SET_FIELD: "{\"entity\":2,\"component\":\"MeshRenderer\",\"key\":\"opaque\",\"value\":false}", ESTELLA_VERIFY_SCENE: "/scenes/mesh-depth.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mesh-depth.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.42,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.58,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40}]" } },// A normal map over FLAT normals: the quad faces the viewer, so without the map// both halves take the same light. Its texels point -X and +X, so the lit half// and the unlit one are the tangent frame, derived per pixel from derivatives.