Files
engine/e2e/case/material-blendMode.ts
zhuxudong ffad56b2fe Add material tests for e2e (#1918)
* test: add material e2e test

---------

Co-authored-by: luzhuang <364439895@qq.com>
2023-12-28 10:58:05 +08:00

32 lines
1.0 KiB
TypeScript

/**
* @title Blend Mode
* @category Material
*/
import { Camera, GLTFResource, Vector3, WebGLEngine } from "@galacean/engine";
import { initScreenshot, updateForE2E } from "./.mockForE2E";
// Create engine
WebGLEngine.create({ canvas: "canvas" }).then((engine) => {
engine.canvas.resizeByClientSize();
const scene = engine.sceneManager.activeScene;
const rootEntity = scene.createRootEntity();
// Create camera
const cameraEntity = rootEntity.createChild("Camera");
cameraEntity.transform.position = new Vector3(0, 1, 10);
const camera = cameraEntity.addComponent(Camera);
scene.ambientLight.diffuseSolidColor.set(1, 1, 1, 1);
engine.resourceManager
.load<GLTFResource>("https://gw.alipayobjects.com/os/bmw-prod/d099b30b-59a3-42e4-99eb-b158afa8e65d.glb")
.then((glTF) => {
rootEntity.addChild(glTF.defaultSceneRoot);
updateForE2E(engine);
const category = "Material";
const name = "material-blendMode";
initScreenshot(category, name, engine, camera);
});
});