-
-
Notifications
You must be signed in to change notification settings - Fork 341
Fix particle ForceOverLifetime
bug when render mode is stretched
#2599
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
Fix particle ForceOverLifetime
bug when render mode is stretched
#2599
Conversation
WalkthroughThe changes introduce a dual-scene architecture in the Changes
Suggested reviewers
Possibly related PRs
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/1.5 #2599 +/- ##
===========================================
- Coverage 68.65% 68.63% -0.02%
===========================================
Files 964 964
Lines 101036 101076 +40
Branches 8679 8681 +2
===========================================
+ Hits 69367 69376 +9
- Misses 31407 31438 +31
Partials 262 262
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
packages/core/src/shaderlib/particle/force_over_lifetime_module.glsl
Outdated
Show resolved
Hide resolved
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
e2e/case/particleRenderer-force.ts (1)
181-181
: Force constants updated to 2.
Raising the maximum force on each axis may significantly affect particle behavior; tests should verify the new forces meet your intended velocity offset corrections.You could parameterize these force values to avoid hardcoding and facilitate future tuning.
Also applies to: 185-185, 189-189
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 181-181: e2e/case/particleRenderer-force.ts#L181
Added line #L181 was not covered by tests
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
e2e/fixtures/originImage/Particle_particleRenderer-dream.jpg
is excluded by!**/*.jpg
e2e/fixtures/originImage/Particle_particleRenderer-force.jpg
is excluded by!**/*.jpg
📒 Files selected for processing (2)
e2e/case/particleRenderer-force.ts
(7 hunks)e2e/config.ts
(2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
e2e/case/particleRenderer-force.ts (4)
packages/math/src/Color.ts (1)
Color
(8-359)packages/math/src/Vector3.ts (1)
Vector3
(11-612)packages/core/src/particle/ParticleRenderer.ts (1)
ParticleRenderer
(19-288)packages/core/src/particle/modules/ForceOverLifetimeModule.ts (6)
forceX
(53-55)forceX
(57-63)forceY
(68-70)forceY
(72-78)forceZ
(83-85)forceZ
(87-93)
🪛 GitHub Check: codecov/patch
e2e/case/particleRenderer-force.ts
[warning] 37-39: e2e/case/particleRenderer-force.ts#L37-L39
Added lines #L37 - L39 were not covered by tests
[warning] 41-44: e2e/case/particleRenderer-force.ts#L41-L44
Added lines #L41 - L44 were not covered by tests
[warning] 47-51: e2e/case/particleRenderer-force.ts#L47-L51
Added lines #L47 - L51 were not covered by tests
[warning] 53-58: e2e/case/particleRenderer-force.ts#L53-L58
Added lines #L53 - L58 were not covered by tests
[warning] 82-86: e2e/case/particleRenderer-force.ts#L82-L86
Added lines #L82 - L86 were not covered by tests
[warning] 88-92: e2e/case/particleRenderer-force.ts#L88-L92
Added lines #L88 - L92 were not covered by tests
[warning] 95-95: e2e/case/particleRenderer-force.ts#L95
Added line #L95 was not covered by tests
[warning] 99-104: e2e/case/particleRenderer-force.ts#L99-L104
Added lines #L99 - L104 were not covered by tests
[warning] 109-112: e2e/case/particleRenderer-force.ts#L109-L112
Added lines #L109 - L112 were not covered by tests
[warning] 181-181: e2e/case/particleRenderer-force.ts#L181
Added line #L181 was not covered by tests
[warning] 185-185: e2e/case/particleRenderer-force.ts#L185
Added line #L185 was not covered by tests
[warning] 189-189: e2e/case/particleRenderer-force.ts#L189
Added line #L189 was not covered by tests
[warning] 195-200: e2e/case/particleRenderer-force.ts#L195-L200
Added lines #L195 - L200 were not covered by tests
[warning] 205-208: e2e/case/particleRenderer-force.ts#L205-L208
Added lines #L205 - L208 were not covered by tests
[warning] 218-218: e2e/case/particleRenderer-force.ts#L218
Added line #L218 was not covered by tests
[warning] 280-280: e2e/case/particleRenderer-force.ts#L280
Added line #L280 was not covered by tests
[warning] 285-288: e2e/case/particleRenderer-force.ts#L285-L288
Added lines #L285 - L288 were not covered by tests
[warning] 355-355: e2e/case/particleRenderer-force.ts#L355
Added line #L355 was not covered by tests
[warning] 360-363: e2e/case/particleRenderer-force.ts#L360-L363
Added lines #L360 - L363 were not covered by tests
[warning] 370-370: e2e/case/particleRenderer-force.ts#L370
Added line #L370 was not covered by tests
e2e/config.ts
[war
8000
ning] 206-206: e2e/config.ts#L206
Added line #L206 was not covered by tests
[warning] 211-211: e2e/config.ts#L211
Added line #L211 was not covered by tests
[warning] 216-216: e2e/config.ts#L216
Added line #L216 was not covered by tests
[warning] 221-221: e2e/config.ts#L221
Added line #L221 was not covered by tests
[warning] 264-264: e2e/config.ts#L264
Added line #L264 was not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: e2e (22.x)
🔇 Additional comments (10)
e2e/config.ts (1)
206-206
: Lowered thresholds require proper coverage.
These threshold adjustments (from 0.3/0.4 down to 0.1) can significantly increase the sensitivity of end-to-end comparisons. Consider adding or updating relevant tests to ensure these changes are validated and won't introduce false positives or regressions, especially since codecov indicates these lines lack coverage.Would you like assistance drafting the corresponding tests?
Also applies to: 211-211, 216-216, 221-221, 264-264
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 206-206: e2e/config.ts#L206
Added line #L206 was not covered by testse2e/case/particleRenderer-force.ts (9)
37-39
: Consider testing multi-scene setup.
You’ve introduced a dual-scene architecture with separate cameras. This is a valuable feature, but codecov reports these lines are not covered by tests. Updating or adding tests to confirm correct scene management, background colors, and camera viewports will help catch potential regressions in multi-scene scenarios.Also applies to: 41-44, 47-51, 53-58
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 37-39: e2e/case/particleRenderer-force.ts#L37-L39
Added lines #L37 - L39 were not covered by tests
82-86
: Validate particle initialization in both scenes.
Creating distinct particle entities (“fireEntity”) for left and right scenes with varying parameters is a sensible approach. However, the new lines remain untested per codecov. Tests ensuring both scenes render the intended particle effects would increase confidence in these changes.Also applies to: 88-92
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 82-86: e2e/case/particleRenderer-force.ts#L82-L86
Added lines #L82 - L86 were not covered by tests
95-95
: No concerns - screenshot initialization.
Initializing screenshots for both cameras seems straightforward.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 95-95: e2e/case/particleRenderer-force.ts#L95
Added line #L95 was not covered by tests
99-112
: Optional parameters for debris particles.
You’ve addedstretch
andlengthScale
to support stretched billboards. This design looks fine, but consider unit or integration tests confirming that enablingstretch
toggles the expected mode and scale. Coverage is lacking per codecov.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 99-104: e2e/case/particleRenderer-force.ts#L99-L104
Added lines #L99 - L104 were not covered by tests
[warning] 109-112: e2e/case/particleRenderer-force.ts#L109-L112
Added lines #L109 - L112 were not covered by tests
195-208
: Highlight untested glow-particle parameters.
Similar to debris particles, addingstretch
andlengthScale
broadens usage. Ensure you have robust coverage verifying these new variations.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 195-200: e2e/case/particleRenderer-force.ts#L195-L200
Added lines #L195 - L200 were not covered by tests
[warning] 205-208: e2e/case/particleRenderer-force.ts#L205-L208
Added lines #L205 - L208 were not covered by tests
218-218
: Random seed usage changed.
useAutoRandomSeed = false
is beneficial for deterministic testing. Verify that existing tests or new tests confirm expected seeding behavior.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 218-218: e2e/case/particleRenderer-force.ts#L218
Added line #L218 was not covered by tests
280-289
: Sparks particle stretch parameters.
Again, you’ve introduced optional parameters for stretch mode. Be sure to add or update tests to confirm correct rendering and coverage.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 280-280: e2e/case/particleRenderer-force.ts#L280
Added line #L280 was not covered by tests
[warning] 285-288: e2e/case/particleRenderer-force.ts#L285-L288
Added lines #L285 - L288 were not covered by tests
355-363
: Highlights particle stretch parameters.
As with the other particle-creation functions, confirm coverage for stretched billboard logic.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 355-355: e2e/case/particleRenderer-force.ts#L355
Added line #L355 was not covered by tests
[warning] 360-363: e2e/case/particleRenderer-force.ts#L360-L363
Added lines #L360 - L363 were not covered by tests
370-370
: Random seed usage for highlights.
Turning off auto-seed is consistent. However, codecov indicates no direct coverage. Consider a test case verifying reproducible results for highlights.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 370-370: e2e/case/particleRenderer-force.ts#L370
Added line #L370 was not covered by tests
stretched
stretched
ForceOverLifetime
bug when render mode is stretched
Please check if the PR fulfills these requirements
Comparison with streched billboard render mode
Unity

Galacean before

Galacean current

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information:
Summary by CodeRabbit
New Features
Bug Fixes