-
-
Notifications
You must be signed in to change notification settings - Fork 406
[CI probe] SOL shader variants on GPU-less runner — do not review #3072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2ce412e
fix(particle): make size-over-lifetime TwoCurves random mode work
3447163
fix(particle): make size-over-lifetime work in mesh render mode
8e9560c
test(particle): add mesh + size-over-lifetime e2e baseline
94dc4fe
ci: exclude e2e sources from coverage accounting
12c2cfc
test(particle): drop separateAxes from the mesh SOL e2e case
8d27be3
test: probe sol macro variants on swiftshader ci (throwaway)
4e4c6b8
test: probe2 - proven skeleton with sol vs my skeleton without
7e488a0
test: probe3 instrumented create/load stages
2066c7d
test: probe4 - api-fixed sol cases (root cause: resizeByClientSize re…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ignore: | ||
| - "e2e/**" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /** | ||
| * @title Particle Emit Mesh Size Over Lifetime | ||
| * @category Particle | ||
| */ | ||
| import { | ||
| Burst, | ||
| Camera, | ||
| Color, | ||
| CurveKey, | ||
| Engine, | ||
| Entity, | ||
| Logger, | ||
| ParticleCompositeCurve, | ||
| ParticleCurve, | ||
| ParticleMaterial, | ||
| ParticleRenderer, | ||
| ParticleRenderMode, | ||
| PrimitiveMesh, | ||
| SphereShape, | ||
| Vector3, | ||
| WebGLEngine | ||
| } from "@galacean/engine"; | ||
| import { initScreenshot, updateForE2E } from "./.mockForE2E"; | ||
|
|
||
| // Create engine | ||
| WebGLEngine.create({ | ||
| canvas: "canvas" | ||
| }).then((engine) => { | ||
| Logger.enable(); | ||
| engine.canvas.resizeByClientSize(); | ||
|
|
||
| const rootEntity = engine.sceneManager.activeScene.createRootEntity("Root"); | ||
|
|
||
| // Create camera | ||
| const cameraEntity = rootEntity.createChild("Camera"); | ||
| cameraEntity.transform.position = new Vector3(0, 0, 12); | ||
| const camera = cameraEntity.addComponent(Camera); | ||
| camera.fieldOfView = 60; | ||
| camera.nearClipPlane = 0.3; | ||
| camera.farClipPlane = 1000; | ||
|
|
||
| const particleEntity = createSizeOverLifetimeParticle(engine); | ||
| rootEntity.addChild(particleEntity); | ||
|
|
||
| updateForE2E(engine, 300); | ||
| initScreenshot(engine, camera); | ||
| }); | ||
|
|
||
| function createSizeOverLifetimeParticle(engine: Engine): Entity { | ||
| const particleEntity = new Entity(engine, "MeshSizeOverLifetimeParticle"); | ||
|
|
||
| const particleRenderer = particleEntity.addComponent(ParticleRenderer); | ||
|
|
||
| const material = new ParticleMaterial(engine); | ||
| material.baseColor = new Color(1.0, 0.5, 0.2, 1.0); | ||
| particleRenderer.setMaterial(material); | ||
|
|
||
| particleRenderer.renderMode = ParticleRenderMode.Mesh; | ||
| particleRenderer.mesh = PrimitiveMesh.createCuboid(engine); | ||
|
|
||
| const generator = particleRenderer.generator; | ||
| generator.useAutoRandomSeed = false; | ||
| const { main, emission, sizeOverLifetime } = generator; | ||
|
|
||
| main.startLifetime.constant = 10; | ||
| main.startSpeed.constant = 0.5; | ||
| main.startSize.constant = 0.7; | ||
|
|
||
| emission.rateOverTime.constant = 0; | ||
| emission.addBurst(new Burst(0, new ParticleCompositeCurve(16))); | ||
| const shape = new SphereShape(); | ||
| shape.radius = 2.5; | ||
| emission.shape = shape; | ||
|
|
||
| // separateAxes + TwoCurves is kept out of e2e on purpose: that macro combo | ||
| // (RENDERER_SOL_IS_SEPARATE + RENDERER_SOL_IS_RANDOM_TWO) hangs SwiftShader's | ||
| // shader compiler on GPU-less CI runners; it is covered by unit tests instead. | ||
| sizeOverLifetime.enabled = true; | ||
| sizeOverLifetime.size = new ParticleCompositeCurve( | ||
| new ParticleCurve(new CurveKey(0, 0.3), new CurveKey(1, 0.5)), | ||
| new ParticleCurve(new CurveKey(0, 1.2), new CurveKey(1, 2.0)) | ||
| ); | ||
|
|
||
| return particleEntity; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| /** | ||
| * @title Particle Emit Mesh Size Over Lifetime | ||
| * @category Particle | ||
| */ | ||
| import { | ||
| Burst, | ||
| Camera, | ||
| Color, | ||
| CurveKey, | ||
| Engine, | ||
| Entity, | ||
| Logger, | ||
| ParticleCompositeCurve, | ||
| ParticleCurve, | ||
| ParticleMaterial, | ||
| ParticleRenderer, | ||
| ParticleRenderMode, | ||
| PrimitiveMesh, | ||
| SphereShape, | ||
| Vector3, | ||
| WebGLEngine | ||
| } from "@galacean/engine"; | ||
| import { initScreenshot, updateForE2E } from "./.mockForE2E"; | ||
|
|
||
| window.addEventListener("error", (e) => console.log("P-ERR", e.message)); | ||
| window.addEventListener("unhandledrejection", (e: any) => console.log("P-REJ", String(e.reason))); | ||
|
|
||
| // Create engine | ||
| WebGLEngine.create({ | ||
| canvas: "canvas" | ||
| }).then((engine) => { | ||
| Logger.enable(); | ||
|
|
||
| const rootEntity = engine.sceneManager.activeScene.createRootEntity("Root"); | ||
|
|
||
| // Create camera | ||
| const cameraEntity = rootEntity.createChild("Camera"); | ||
| cameraEntity.transform.position = new Vector3(0, 0, 12); | ||
| const camera = cameraEntity.addComponent(Camera); | ||
| camera.fieldOfView = 60; | ||
| camera.nearClipPlane = 0.3; | ||
| camera.farClipPlane = 1000; | ||
|
|
||
| const particleEntity = createSizeOverLifetimeParticle(engine); | ||
| rootEntity.addChild(particleEntity); | ||
|
|
||
| console.log("P5 before update"); | ||
| updateForE2E(engine, 300); | ||
| console.log("P6 updated"); | ||
| initScreenshot(engine, camera); | ||
| }); | ||
|
|
||
| function createSizeOverLifetimeParticle(engine: Engine): Entity { | ||
| const particleEntity = new Entity(engine, "MeshSizeOverLifetimeParticle"); | ||
|
|
||
| const particleRenderer = particleEntity.addComponent(ParticleRenderer); | ||
|
|
||
| const material = new ParticleMaterial(engine); | ||
| material.baseColor = new Color(1.0, 0.5, 0.2, 1.0); | ||
| particleRenderer.setMaterial(material); | ||
|
|
||
| particleRenderer.renderMode = ParticleRenderMode.Mesh; | ||
| particleRenderer.mesh = PrimitiveMesh.createCuboid(engine); | ||
|
|
||
| const generator = particleRenderer.generator; | ||
| generator.useAutoRandomSeed = false; | ||
| const { main, emission, sizeOverLifetime } = generator; | ||
|
|
||
| main.startLifetime.constant = 10; | ||
| main.startSpeed.constant = 0.5; | ||
| main.startSize.constant = 0.7; | ||
|
|
||
| emission.rateOverTime.constant = 0; | ||
| emission.addBurst(new Burst(0, new ParticleCompositeCurve(16))); | ||
| const shape = new SphereShape(); | ||
| shape.radius = 2.5; | ||
| emission.shape = shape; | ||
|
|
||
| // separateAxes + TwoCurves is kept out of e2e on purpose: that macro combo | ||
| // (RENDERER_SOL_IS_SEPARATE + RENDERER_SOL_IS_RANDOM_TWO) hangs SwiftShader's | ||
| // shader compiler on GPU-less CI runners; it is covered by unit tests instead. | ||
| sizeOverLifetime.enabled = true; | ||
| sizeOverLifetime.size = new ParticleCompositeCurve( | ||
| new ParticleCurve(new CurveKey(0, 0.3), new CurveKey(1, 0.5)), | ||
| new ParticleCurve(new CurveKey(0, 1.2), new CurveKey(1, 2.0)) | ||
| ); | ||
|
|
||
| return particleEntity; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| /** | ||
| * @title Particle Emit Mesh Size Over Lifetime | ||
| * @category Particle | ||
| */ | ||
| import { | ||
| Burst, | ||
| Camera, | ||
| Color, | ||
| CurveKey, | ||
| Engine, | ||
| Entity, | ||
| Logger, | ||
| ParticleCompositeCurve, | ||
| ParticleCurve, | ||
| ParticleMaterial, | ||
| ParticleRenderer, | ||
| ParticleRenderMode, | ||
| PrimitiveMesh, | ||
| SphereShape, | ||
| Vector3, | ||
| WebGLEngine | ||
| } from "@galacean/engine"; | ||
| import { initScreenshot, updateForE2E } from "./.mockForE2E"; | ||
|
|
||
| window.addEventListener("error", (e) => console.log("P-ERR", e.message)); | ||
| window.addEventListener("unhandledrejection", (e: any) => console.log("P-REJ", String(e.reason))); | ||
|
|
||
| // Create engine | ||
| WebGLEngine.create({ | ||
| canvas: "canvas" | ||
| }).then((engine) => { | ||
| Logger.enable(); | ||
|
|
||
| const rootEntity = engine.sceneManager.activeScene.createRootEntity("Root"); | ||
|
|
||
| // Create camera | ||
| const cameraEntity = rootEntity.createChild("Camera"); | ||
| cameraEntity.transform.position = new Vector3(0, 0, 12); | ||
| const camera = cameraEntity.addComponent(Camera); | ||
| camera.fieldOfView = 60; | ||
| camera.nearClipPlane = 0.3; | ||
| camera.farClipPlane = 1000; | ||
|
|
||
| const particleEntity = createSizeOverLifetimeParticle(engine); | ||
| rootEntity.addChild(particleEntity); | ||
|
|
||
| console.log("P5 before update"); | ||
| updateForE2E(engine, 300); | ||
| console.log("P6 updated"); | ||
| initScreenshot(engine, camera); | ||
| }); | ||
|
|
||
| function createSizeOverLifetimeParticle(engine: Engine): Entity { | ||
| const particleEntity = new Entity(engine, "MeshSizeOverLifetimeParticle"); | ||
|
|
||
| const particleRenderer = particleEntity.addComponent(ParticleRenderer); | ||
|
|
||
| const material = new ParticleMaterial(engine); | ||
| material.baseColor = new Color(1.0, 0.5, 0.2, 1.0); | ||
| particleRenderer.setMaterial(material); | ||
|
|
||
| particleRenderer.renderMode = ParticleRenderMode.Mesh; | ||
| particleRenderer.mesh = PrimitiveMesh.createCuboid(engine); | ||
|
|
||
| const generator = particleRenderer.generator; | ||
| generator.useAutoRandomSeed = false; | ||
| const { main, emission, sizeOverLifetime } = generator; | ||
|
|
||
| main.startLifetime.constant = 10; | ||
| main.startSpeed.constant = 0.5; | ||
| main.startSize.constant = 0.7; | ||
|
|
||
| emission.rateOverTime.constant = 0; | ||
| emission.addBurst(new Burst(0, new ParticleCompositeCurve(16))); | ||
| const shape = new SphereShape(); | ||
| shape.radius = 2.5; | ||
| emission.shape = shape; | ||
|
|
||
| sizeOverLifetime.enabled = true; | ||
| sizeOverLifetime.separateAxes = true; | ||
| sizeOverLifetime.sizeX = new ParticleCompositeCurve( | ||
| new ParticleCurve(new CurveKey(0, 0.3), new CurveKey(1, 0.5)), | ||
| new ParticleCurve(new CurveKey(0, 1.2), new CurveKey(1, 2.0)) | ||
| ); | ||
| sizeOverLifetime.sizeY = new ParticleCompositeCurve( | ||
| new ParticleCurve(new CurveKey(0, 0.35), new CurveKey(1, 0.2)), | ||
| new ParticleCurve(new CurveKey(0, 1.0), new CurveKey(1, 3.0)) | ||
| ); | ||
| sizeOverLifetime.sizeZ = new ParticleCompositeCurve( | ||
| new ParticleCurve(new CurveKey(0, 0.4), new CurveKey(1, 0.3)), | ||
| new ParticleCurve(new CurveKey(0, 0.9), new CurveKey(1, 1.5)) | ||
| ); | ||
|
|
||
| return particleEntity; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...fixtures/originImage/Particle_particleRenderer-emit-mesh-size-over-lifetime.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep the baseline-free probes out of screenshot comparison.
E2E_CONFIGroutes these cases throughscreenshotWithThreshold, which compares against an origin image after the screenshot button is clicked. Since these probes have no baseline and only button visibility is relevant, they will fail later on missing comparison data and obscure the compiler result. Run them through a probe-specific test path or add an explicit skip-comparison mode.🤖 Prompt for AI Agents