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
fix(render): a render target hands out its picture the right way up on a device that stores rows top first
yhh45c7ddd20d49
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d5004bc3c..0dfe53d8e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -22,6 +22,7 @@ published separately; it ships inside the editor.### Fixed+- **A render target reads the right way up on WebGPU, Android and iOS.** A camera drawing into a `RenderTexture`, or anything painted into one, came out upside down wherever the engine draws with WebGPU (the web on WebGPU, Android, iOS): such a device keeps a target's rows top first, where a texture expects them bottom first, and nothing put them back. A target now hands out a copy with its rows in the order every backend samples, made at the end of each frame drawn into it. The 2D fog of war and the 2D rain's shelter, which had turned their masks back by hand in their WebGPU shaders, read them as they are. Pixel checks on both backends now hold the orientation of a target and of the fog.- **Building terrain no longer stalls a frame.** A page of ground made from the built-in noise was sampled and painted whole in the frame that asked for it; it is now made a slice at a time within the frame's budget, and starts over when the ground or its paint changes meanwhile.- **A moved or scattered model part keeps its texture mapping.** An explicit UV mapping on a face is now resolved before the face's vertices move, so transforming or scattering a modeled part no longer slides its texture across it.- **An iOS game opens on iOS 27.** Built with Xcode 27, every game closed 0.3 s after launch on an iOS 27 device: the host opened its window the way UIKit no longer allows, without a window scene. The host now adopts the scene lifecycle (one window scene; the game pauses and resumes with it). Its log also reaches the device console as text, where it read `<private>`. The simulator in CI runs an older iOS and could not see it; it was found on an iPhone.diff --git a/fixtures/scenes/camera-target-orientation.esscene b/fixtures/scenes/camera-target-orientation.esscenenew file mode 100644index 000000000..9a248a762--- /dev/null+++ b/fixtures/scenes/camera-target-orientation.esscene@@ -0,0 +1,171 @@+{+ "version": 4,+ "name": "CameraTarget",+ "entities": [+ {+ "id": 0,+ "name": "OffscreenCamera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 0,+ "z": 10+ }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 100,+ "isActive": true,+ "priority": 0,+ "clearFlags": 3,+ "cullingMask": 2+ }+ }+ ],+ "visible": true+ },+ {+ "id": 1,+ "name": "RedTop",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 50,+ "z": 0+ }+ }+ },+ {+ "type": "Sprite",+ "data": {+ "size": {+ "x": 400,+ "y": 100+ },+ "color": {+ "r": 1,+ "g": 0,+ "b": 0,+ "a": 1+ },+ "layer": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 2,+ "name": "ScreenCamera",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 0,+ "z": 10+ }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 1,+ "clearFlags": 3,+ "cullingMask": 1+ }+ }+ ],+ "visible": true+ },+ {+ "id": 3,+ "name": "Screen",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 0,+ "z": 0+ }+ }+ },+ {+ "type": "Sprite",+ "data": {+ "size": {+ "x": 300,+ "y": 300+ },+ "color": {+ "r": 1,+ "g": 1,+ "b": 1,+ "a": 1+ },+ "layer": 0+ }+ }+ ],+ "visible": true+ },+ {+ "id": 4,+ "name": "BlueBottom",+ "parent": null,+ "children": [],+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": -50,+ "z": 0+ }+ }+ },+ {+ "type": "Sprite",+ "data": {+ "size": {+ "x": 400,+ "y": 100+ },+ "color": {+ "r": 0,+ "g": 0,+ "b": 1,+ "a": 1+ },+ "layer": 1+ }+ }+ ],+ "visible": true+ }+ ]+}\ No newline at end of filediff --git a/fixtures/scenes/camera-target-orientation.textures.json b/fixtures/scenes/camera-target-orientation.textures.jsonnew file mode 100644index 000000000..0967ef424--- /dev/null+++ b/fixtures/scenes/camera-target-orientation.textures.json@@ -0,0 +1 @@+{}diff --git a/fixtures/scenes/fog2d-orientation.esscene b/fixtures/scenes/fog2d-orientation.esscenenew file mode 100644index 000000000..67b3b34bb--- /dev/null+++ b/fixtures/scenes/fog2d-orientation.esscene@@ -0,0 +1,140 @@+{+ "version": 4,+ "name": "Fog orientation",+ "entities": [+ {+ "id": 0,+ "name": "Camera",+ "parent": null,+ "children": [],+ "visible": true,+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 0,+ "z": 10+ }+ }+ },+ {+ "type": "Camera",+ "data": {+ "projectionType": 1,+ "orthoSize": 300,+ "isActive": true,+ "priority": 0,+ "clearFlags": 3+ }+ },+ {+ "type": "PostProcessVolume",+ "data": {+ "isGlobal": true,+ "priority": 0,+ "weight": 1,+ "effects": [+ {+ "type": "fog2d",+ "enabled": true,+ "uniforms": {}+ }+ ]+ }+ }+ ]+ },+ {+ "id": 1,+ "name": "Ground",+ "parent": null,+ "children": [],+ "visible": true,+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 0,+ "z": 0+ }+ }+ },+ {+ "type": "Sprite",+ "data": {+ "size": {+ "x": 2000,+ "y": 2000+ },+ "color": {+ "r": 1,+ "g": 1,+ "b": 1,+ "a": 1+ }+ }+ }+ ]+ },+ {+ "id": 2,+ "name": "Fog",+ "parent": null,+ "children": [],+ "visible": true,+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 0,+ "z": 0+ }+ }+ },+ {+ "type": "FogOfWar",+ "data": {+ "width": 1200,+ "height": 1200,+ "texels": 256,+ "viewRadius": 100,+ "rays": 128,+ "enabled": true+ }+ }+ ]+ },+ {+ "id": 3,+ "name": "Viewer",+ "parent": null,+ "children": [],+ "visible": true,+ "components": [+ {+ "type": "Transform",+ "data": {+ "position": {+ "x": 0,+ "y": 180,+ "z": 0+ }+ }+ },+ {+ "type": "SightViewer",+ "data": {+ "radius": 100,+ "enabled": true+ }+ }+ ]+ }+ ]+}\ No newline at end of filediff --git a/fixtures/scenes/fog2d-orientation.textures.json b/fixtures/scenes/fog2d-orientation.textures.jsonnew file mode 100644index 000000000..0967ef424--- /dev/null+++ b/fixtures/scenes/fog2d-orientation.textures.json@@ -0,0 +1 @@+{}diff --git a/sdk/src/postprocess/sources/fog2d.ts b/sdk/src/postprocess/sources/fog2d.tsindex 67c1f4d77..23dd898b0 100644--- a/sdk/src/postprocess/sources/fog2d.ts+++ b/sdk/src/postprocess/sources/fog2d.ts@@ -25,9 +25,7 @@ fn fogAt(w : vec2f) -> vec2f {if (mc.u_fogW <= 0.0 || mc.u_fogH <= 0.0) { return vec2f(0.0); }let uv = (w - vec2f(mc.u_fogL, mc.u_fogB)) / vec2f(mc.u_fogW, mc.u_fogH);if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) { return vec2f(0.0); }- // This device's texture rows run the other way from the clip space the maps were drawn in.- let p = vec2f(uv.x, 1.0 - uv.y);- return vec2f(textureSampleLevel(u_fogExplored, u_fogExplored_s, p, 0.0).r, textureSampleLevel(u_fogVisible, u_fogVisible_s, p, 0.0).r);+ return vec2f(textureSampleLevel(u_fogExplored, u_fogExplored_s, uv, 0.0).r, textureSampleLevel(u_fogVisible, u_fogVisible_s, uv, 0.0).r);}`;const SOURCE = `#pragma shader "PP Fog 2D"diff --git a/sdk/src/postprocess/sources/rain2d.ts b/sdk/src/postprocess/sources/rain2d.tsindex db2453ae3..c2cded841 100644--- a/sdk/src/postprocess/sources/rain2d.ts+++ b/sdk/src/postprocess/sources/rain2d.ts@@ -72,8 +72,7 @@ fn maskAt(w : vec2f) -> vec2f {if (mc.u_maskW <= 0.0 || mc.u_maskH <= 0.0) { return vec2f(0.0); }let uv = (w - vec2f(mc.u_maskL, mc.u_maskB)) / vec2f(mc.u_maskW, mc.u_maskH);if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) { return vec2f(0.0); }- // This device's texture rows run the other way from the clip space the mask was drawn in.- let m = textureSampleLevel(u_shelterMask, u_shelterMask_s, vec2f(uv.x, 1.0 - uv.y), 0.0);+ let m = textureSampleLevel(u_shelterMask, u_shelterMask_s, uv, 0.0);return vec2f(m.a, m.r);}fn streaks(uv : vec2f, aspect : f32, cols : f32, speed : f32, seed : f32, T : f32) -> f32 {diff --git a/src/esengine/renderer/frame/RenderFrame.cpp b/src/esengine/renderer/frame/RenderFrame.cppindex 9842dc183..76c3cd7f5 100644--- a/src/esengine/renderer/frame/RenderFrame.cpp+++ b/src/esengine/renderer/frame/RenderFrame.cpp@@ -947,6 +947,9 @@ void RenderFrame::end() {// not ride into the next one (the swapchain recycles it at task end). On// GL this is just the default-framebuffer rebind.device_.endRenderPass();+ if (current_target_ != RenderTargetManager::INVALID_HANDLE) {+ if (auto* rt = target_manager_.get(current_target_)) rt->publish();+ }runPendingReplay(view_projection_, scene_viewport_.w, scene_viewport_.h);in_frame_ = false;diff --git a/src/esengine/renderer/rhi/GfxDevice.hpp b/src/esengine/renderer/rhi/GfxDevice.hppindex 9398ccf22..fb30da858 100644--- a/src/esengine/renderer/rhi/GfxDevice.hpp+++ b/src/esengine/renderer/rhi/GfxDevice.hpp@@ -142,6 +142,9 @@ public:*/virtual ClipDepthRange clipDepthRange() const = 0;+ virtual bool storesTargetsTopDown() const { return false; }+ virtual void copyTextureFlippedY(TextureHandle src, TextureHandle dst) { (void)src; (void)dst; }+/*** @brief Declares the device lost from outside the backend.* @details The host observes losses the backend cannot: a browser firingdiff --git a/src/esengine/renderer/rhi/RenderTarget.cpp b/src/esengine/renderer/rhi/RenderTarget.cppindex 1f12b592b..64d953f8a 100644--- a/src/esengine/renderer/rhi/RenderTarget.cpp+++ b/src/esengine/renderer/rhi/RenderTarget.cpp@@ -1,6 +1,7 @@// SPDX-License-Identifier: Apache-2.0// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team#include "./RenderTarget.hpp"+#include "./GfxDevice.hpp"namespace esengine {@@ -17,9 +18,16 @@ void RenderTarget::init(GfxDevice& device, u32 width, u32 height, bool depth, bospec.linearFilter = linearFilter;framebuffer_ = Framebuffer::create(device, spec);+ device_ = &device;+ if (device.storesTargetsTopDown()) {+ FramebufferSpec shown = spec;+ shown.depthStencil = false;+ published_ = Framebuffer::create(device, shown);+ }}void RenderTarget::shutdown() {+ published_.reset();framebuffer_.reset();width_ = 0;height_ = 0;@@ -46,12 +54,21 @@ void RenderTarget::resize(u32 width, u32 height) {if (framebuffer_) {framebuffer_->resize(width, height);}+ if (published_) {+ published_->resize(width, height);+ }}TextureHandle RenderTarget::getColorTexture() const {+ if (published_) return published_->getColorAttachment();return framebuffer_ ? framebuffer_->getColorAttachment() : TextureHandle::Invalid;}+void RenderTarget::publish() {+ if (!device_ || !framebuffer_ || !published_) return;+ device_->copyTextureFlippedY(framebuffer_->getColorAttachment(), published_->getColorAttachment());+}+TextureHandle RenderTarget::getDepthTexture() const {return framebuffer_ ? framebuffer_->getDepthAttachment() : TextureHandle::Invalid;}diff --git a/src/esengine/renderer/rhi/RenderTarget.hpp b/src/esengine/renderer/rhi/RenderTarget.hppindex da5b8128a..bc4725c5c 100644--- a/src/esengine/renderer/rhi/RenderTarget.hpp+++ b/src/esengine/renderer/rhi/RenderTarget.hpp@@ -28,6 +28,7 @@ public:void resize(u32 width, u32 height);TextureHandle getColorTexture() const;+ void publish();TextureHandle getDepthTexture() const;glm::uvec2 getSize() const { return { width_, height_ }; }u32 getWidth() const { return width_; }@@ -37,7 +38,9 @@ public:FramebufferHandle getFramebuffer() const;private:+ GfxDevice* device_ = nullptr;Unique<Framebuffer> framebuffer_;+ Unique<Framebuffer> published_;u32 width_ = 0;u32 height_ = 0;bool has_depth_ = true;diff --git a/src/esengine/renderer/webgpu/WebGPUDevice.cpp b/src/esengine/renderer/webgpu/WebGPUDevice.cppindex 47828d8ab..6faac9312 100644--- a/src/esengine/renderer/webgpu/WebGPUDevice.cpp+++ b/src/esengine/renderer/webgpu/WebGPUDevice.cpp@@ -249,6 +249,12 @@ void WebGPUDevice::releaseDeviceObjects() {clear_pipelines_.clear();if (clear_layout_) { wgpuPipelineLayoutRelease(clear_layout_); clear_layout_ = nullptr; }if (clear_bgl_) { wgpuBindGroupLayoutRelease(clear_bgl_); clear_bgl_ = nullptr; }+ for (auto& [key, pipeline] : flip_pipelines_) {+ if (pipeline) wgpuRenderPipelineRelease(pipeline);+ }+ flip_pipelines_.clear();+ if (flip_layout_) { wgpuPipelineLayoutRelease(flip_layout_); flip_layout_ = nullptr; }+ if (flip_bgl_) { wgpuBindGroupLayoutRelease(flip_bgl_); flip_bgl_ = nullptr; }// The depth-resolve family, for the same reason: every one of these belongs to// the device that made it, and Dawn refuses one from the generation before.for (auto& [key, pipeline] : depth_resolve_pipelines_) {@@ -1886,6 +1892,118 @@ void WebGPUDevice::drawInternalClear(bool color, bool depth, bool stencil,bind_group_dirty_ = true;}+WGPURenderPipeline WebGPUDevice::ensureFlipPipeline(WGPUTextureFormat format) {+ const u32 key = static_cast<u32>(format);+ if (auto it = flip_pipelines_.find(key); it != flip_pipelines_.end()) return it->second;+ static const char* kFlipVS = R"(+@vertex fn vs_main(@builtin(vertex_index) i : u32) -> @builtin(position) vec4f {+ var p = array<vec2f, 3>(vec2f(-1.0, -3.0), vec2f(3.0, 1.0), vec2f(-1.0, 1.0));+ return vec4f(p[i], 0.0, 1.0);+}+)";+ static const char* kFlipFS = R"(+@group(0) @binding(0) var source : texture_2d<f32>;+@fragment fn fs_main(@builtin(position) at : vec4f) -> @location(0) vec4f {+ let size = vec2i(textureDimensions(source));+ return textureLoad(source, vec2i(i32(at.x), size.y - 1 - i32(at.y)), 0);+}+)";+ auto makeModule = [&](const char* code) {+ WGPUShaderSourceWGSL wgsl{};+ wgsl.chain.sType = WGPUSType_ShaderSourceWGSL;+ wgsl.code = sv(code);+ WGPUShaderModuleDescriptor md{};+ md.nextInChain = &wgsl.chain;+ return wgpuDeviceCreateShaderModule(device_, &md);+ };+ if (!flip_bgl_) {+ WGPUBindGroupLayoutEntry entry{};+ entry.binding = 0;+ entry.visibility = WGPUShaderStage_Fragment;+ entry.texture.sampleType = WGPUTextureSampleType_UnfilterableFloat;+ entry.texture.viewDimension = WGPUTextureViewDimension_2D;+ WGPUBindGroupLayoutDescriptor bld{};+ bld.entryCount = 1;+ bld.entries = &entry;+ flip_bgl_ = wgpuDeviceCreateBindGroupLayout(device_, &bld);+ WGPUPipelineLayoutDescriptor pld{};+ pld.bindGroupLayoutCount = 1;+ pld.bindGroupLayouts = &flip_bgl_;+ flip_layout_ = wgpuDeviceCreatePipelineLayout(device_, &pld);+ }+ WGPUShaderModule vs = makeModule(kFlipVS);+ WGPUShaderModule fs = makeModule(kFlipFS);+ WGPUColorTargetState target{};+ target.format = format;+ target.writeMask = WGPUColorWriteMask_All;+ WGPUFragmentState fragment{};+ fragment.module = fs;+ fragment.entryPoint = sv("fs_main");+ fragment.targetCount = 1;+ fragment.targets = ⌖+ WGPURenderPipelineDescriptor pd{};+ pd.layout = flip_layout_;+ pd.vertex.module = vs;+ pd.vertex.entryPoint = sv("vs_main");+ pd.primitive.topology = WGPUPrimitiveTopology_TriangleList;+ pd.primitive.frontFace = WGPUFrontFace_CCW;+ pd.primitive.cullMode = WGPUCullMode_None;+ pd.multisample.count = 1;+ pd.multisample.mask = 0xFFFFFFFFu;+ pd.fragment = &fragment;+ WGPURenderPipeline pipeline = wgpuDeviceCreateRenderPipeline(device_, &pd);+ wgpuShaderModuleRelease(vs);+ wgpuShaderModuleRelease(fs);+ flip_pipelines_[key] = pipeline;+ return pipeline;+}++void WebGPUDevice::copyTextureFlippedY(TextureHandle src, TextureHandle dst) {+ if (!device_ || !isDeviceUsable()) return;+ const auto from = textures_.find(static_cast<u32>(src));+ const auto to = textures_.find(static_cast<u32>(dst));+ if (from == textures_.end() || to == textures_.end()) return;+ if (from->second.samples > 1 || to->second.samples > 1+ || from->second.width != to->second.width || from->second.height != to->second.height) {+ ES_LOG_ERROR("WebGPUDevice::copyTextureFlippedY: the two textures must be single-sampled and the same size");+ return;+ }+ if (pass_) endRenderPass();+ WGPURenderPipeline pipeline = ensureFlipPipeline(to->second.format);+ if (!pipeline) return;++ WGPUBindGroupEntry entry{};+ entry.binding = 0;+ entry.textureView = from->second.sampleView ? from->second.sampleView : from->second.view;+ WGPUBindGroupDescriptor bgd{};+ bgd.layout = flip_bgl_;+ bgd.entryCount = 1;+ bgd.entries = &entry;+ WGPUBindGroup group = wgpuDeviceCreateBindGroup(device_, &bgd);++ WGPURenderPassColorAttachment color{};+ color.view = to->second.view;+ color.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED;+ color.loadOp = WGPULoadOp_Clear;+ color.storeOp = WGPUStoreOp_Store;+ WGPURenderPassDescriptor rp{};+ rp.colorAttachmentCount = 1;+ rp.colorAttachments = &color;++ WGPUCommandEncoder encoder = wgpuDeviceCreateCommandEncoder(device_, nullptr);+ WGPURenderPassEncoder pass = wgpuCommandEncoderBeginRenderPass(encoder, &rp);+ wgpuRenderPassEncoderSetPipeline(pass, pipeline);+ wgpuRenderPassEncoderSetBindGroup(pass, 0, group, 0, nullptr);+ wgpuRenderPassEncoderDraw(pass, 3, 1, 0, 0);+ wgpuRenderPassEncoderEnd(pass);+ wgpuRenderPassEncoderRelease(pass);+ WGPUCommandBuffer commands = wgpuCommandEncoderFinish(encoder, nullptr);+ wgpuQueueSubmit(queue_, 1, &commands);+ wgpuCommandBufferRelease(commands);+ wgpuCommandEncoderRelease(encoder);+ wgpuBindGroupRelease(group);+}+WGPUBindGroupLayout WebGPUDevice::groupLayoutFor(u32 group, u32 mask, u32 depthMask,u32 vertexMask, u32 arrayMask) {// Every mask is part of the key: the same bindings sampled as depth or as andiff --git a/src/esengine/renderer/webgpu/WebGPUDevice.hpp b/src/esengine/renderer/webgpu/WebGPUDevice.hppindex 4cfeb696e..07292dbfa 100644--- a/src/esengine/renderer/webgpu/WebGPUDevice.hpp+++ b/src/esengine/renderer/webgpu/WebGPUDevice.hpp@@ -479,6 +479,9 @@ private:/** @brief Draws the internal clear triangle mid-pass. Restores scissor (when* @p region is given), the user's stencil reference, and forces* pipeline + bind groups to re-establish on the next user draw. */+ bool storesTargetsTopDown() const override { return true; }+ void copyTextureFlippedY(TextureHandle src, TextureHandle dst) override;+ WGPURenderPipeline ensureFlipPipeline(WGPUTextureFormat format);void drawInternalClear(bool color, bool depth, bool stencil,const f32 rgba[4], i32 stencilValue, const RenderPassDesc* region);/** @brief True while inside beginRenderPass/endRenderPass. */@@ -541,6 +544,9 @@ private:// Internal clear family (region-scoped clears + mid-pass clearStencil).// Explicit layout so ONE bind group serves every write-mask variant.std::unordered_map<u32, WGPURenderPipeline> clear_pipelines_;+ std::unordered_map<u32, WGPURenderPipeline> flip_pipelines_;+ WGPUBindGroupLayout flip_bgl_ = nullptr;+ WGPUPipelineLayout flip_layout_ = nullptr;WGPUBindGroupLayout clear_bgl_ = nullptr;WGPUPipelineLayout clear_layout_ = nullptr;WGPUBindGroup clear_bind_group_ = nullptr;diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex 4245bbdca..979dbc9b2 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -4132,6 +4132,8 @@ export const NOTED = {{"note": "An iOS game opens on iOS 27."},"fix(native): the audio watchdog compiles under the min macro windows.h defines":{"internal": "The watchdog had not reached a release; the Windows host failed to build on master only."},+ "fix(render): a render target hands out its picture the right way up on a device that stores rows top first":+ {"note": "A render target reads the right way up on WebGPU, Android and iOS."},"fix: budget terrain page sampling and painting across frames":{"note": "Building terrain no longer stalls a frame."},"fix: preserve authored UVs through model transforms and scattering":diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjsindex 793a6fc6d..7297ba3bb 100644--- a/tools/renderScenes.mjs+++ b/tools/renderScenes.mjs@@ -649,6 +649,8 @@ export const SCENES = [// target. webgl2 only — on WebGPU the frame readback returns nothing when one// frame holds both an offscreen and a surface pass.{ id: "camera-render-target", tier: "pr", env: { ESTELLA_VERIFY_SCENE: "/scenes/camera-target.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/camera-target.textures.json", ESTELLA_VERIFY_CAMERA_TARGET: "{\"camera\":0,\"sprite\":3,\"width\":128,\"height\":128}", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[255,0,0],\"tol\":40}]" } },+ { id: "camera-render-target-orientation", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/camera-target-orientation.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/camera-target-orientation.textures.json", ESTELLA_VERIFY_CAMERA_TARGET: "{\"camera\":0,\"sprite\":3,\"width\":128,\"height\":128}", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.35,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.5,\"y\":0.65,\"rgb\":[0,0,255],\"tol\":40}]" } },+ { id: "fog2d-orientation", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_SCENE: "/scenes/fog2d-orientation.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/fog2d-orientation.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "6", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.2,\"rgb\":[255,255,255],\"tol\":40},{\"x\":0.5,\"y\":0.8,\"rgb\":[0,0,0],\"tol\":40}]" } },{ id: "material-lit", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":50}]" } },{ id: "material-lit-point", tier: "pr", webgpu: { ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,253,0],\"tol\":25},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,52,0],\"tol\":25}]" }, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit-point.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit-point.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":50},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,64,0],\"tol\":60}]" } },{ id: "material-lit-normal", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit-normal.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit-normal.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.333,\"y\":0.5,\"rgb\":[0,252,0],\"tol\":45},{\"x\":0.667,\"y\":0.5,\"rgb\":[0,36,0],\"tol\":50}]" } },