From 33e92e7e9dd097eb5e66d4b68573ba57c3b75472 Mon Sep 17 00:00:00 2001 From: zhuxudong Date: Tue, 27 Feb 2024 18:53:34 +0800 Subject: [PATCH] Adapter 1.2 api change of flipY (#956) --- playground/camera-depth-texture.ts | 3 +-- playground/mrt.ts | 1 - playground/screenshot.ts | 4 ++-- playground/transparent-shadow.ts | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/playground/camera-depth-texture.ts b/playground/camera-depth-texture.ts index af7dcaae1..6dd3ca813 100644 --- a/playground/camera-depth-texture.ts +++ b/playground/camera-depth-texture.ts @@ -82,13 +82,12 @@ async function main() { function showDepthPlane(engine: Engine, camera: Entity): void { const entity = camera.createChild("Plane"); entity.transform.setPosition(0, 0, -1); - entity.transform.rotate(new Vector3(-90, 0, 0)); + entity.transform.rotate(new Vector3(90, 0, 0)); const renderer = entity.addComponent(MeshRenderer); renderer.mesh = PrimitiveMesh.createPlane(engine,0.5,0.5); // Create material const material = new BaseMaterial(engine, Shader.find("RenderDepthTexture")); - material.renderFace = RenderFace.Double; renderer.setMaterial(material); } diff --git a/playground/mrt.ts b/playground/mrt.ts index 4a1ee4c47..4dab352c2 100644 --- a/playground/mrt.ts +++ b/playground/mrt.ts @@ -127,7 +127,6 @@ WebGLEngine.create({ canvas: "canvas" }).then((engine) => { worldPos = renderer_ModelMat * vec4(POSITION, 1.0); normal = renderer_ModelMat * vec4(NORMAL, 1.0); gl_Position = renderer_MVPMat * vec4(POSITION, 1.0); - gl_Position.y *= -1.0; }`; const frag = ` varying vec4 worldPos; diff --git a/playground/screenshot.ts b/playground/screenshot.ts index e807a81a0..4f1439b33 100644 --- a/playground/screenshot.ts +++ b/playground/screenshot.ts @@ -61,7 +61,7 @@ WebGLEngine.create({ canvas: "canvas" }).then((engine) => { camera: Camera, width: number, height: number, - flipY = true, + flipY = false, isPNG = true, jpgQuality = 1 ) { @@ -152,7 +152,7 @@ WebGLEngine.create({ canvas: "canvas" }).then((engine) => { const config = { width: 1024, height: 1024, - flipY: true, + flipY: false, isPNG: true, jpgQuality: 1, screenshot: () => { diff --git a/playground/transparent-shadow.ts b/playground/transparent-shadow.ts index 7c0fc5a62..e44ad47c7 100644 --- a/playground/transparent-shadow.ts +++ b/playground/transparent-shadow.ts @@ -48,6 +48,7 @@ void main() { #include #include #include +#include #include uniform vec4 material_BaseColor;