Skip to content

Comments

Fix linear threshold#2628

Merged
GuoLei1990 merged 2 commits intogalacean:mainfrom
zhuxudong:fix/linear-threshold
Apr 18, 2025
Merged

Fix linear threshold#2628
GuoLei1990 merged 2 commits intogalacean:mainfrom
zhuxudong:fix/linear-threshold

Conversation

@zhuxudong
Copy link
Member

@zhuxudong zhuxudong commented Apr 18, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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

  • Bug Fixes
    • Improved bloom effect rendering by adjusting the threshold calculation for more accurate visual results.
    • Enhanced bloom effect intensity and threshold settings for stronger and more noticeable visual impact.

@zhuxudong zhuxudong added the bug Something isn't working label Apr 18, 2025
@zhuxudong zhuxudong requested a review from GuoLei1990 April 18, 2025 03:36
@coderabbitai
Copy link

coderabbitai bot commented Apr 18, 2025

Walkthrough

The update changes the way the bloom threshold parameter is assigned within the _setupBloom method of the PostProcessUberPass class. Instead of using the gamma-space threshold value directly, the code now converts this value to linear space before assigning it to the shader data. Additionally, the bloom effect's threshold and intensity values were increased in the end-to-end test postProcess-HDR-bloom-ACES.ts. No other bloom parameters or method signatures are altered.

Changes

File(s) Change Summary
packages/core/src/postProcess/PostProcessUberPass.ts Changed bloom threshold assignment from gamma-space value to linear-space value in shader setup.
e2e/case/postProcess-HDR-bloom-ACES.ts Increased bloom threshold from 0.5 to 1.5 and intensity from 1 to 10 in bloom effect test case.

Suggested labels

ignore for release

Suggested reviewers

  • GuoLei1990

Poem

A tweak in the bloom, a shift in the light,
From gamma to linear, the threshold is right.
The shader now glows with more accurate flair,
As rabbits hop softly through luminous air.
🌸✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented Apr 18, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 69.03%. Comparing base (1737e2f) to head (aa7d499).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
e2e/case/postProcess-HDR-bloom-ACES.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2628      +/-   ##
==========================================
+ Coverage   69.00%   69.03%   +0.02%     
==========================================
  Files         961      961              
  Lines      100408   100408              
  Branches     8699     8707       +8     
==========================================
+ Hits        69291    69315      +24     
+ Misses      30857    30833      -24     
  Partials      260      260              
Flag Coverage Δ
unittests 69.03% <33.33%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GuoLei1990 GuoLei1990 added rendering Rendering related functions post processing Post processing labels Apr 18, 2025
Copy link

@coderabbitai coderabbitai bot left a 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/postProcess-HDR-bloom-ACES.ts (1)

21-22: Parameter changes align with the linear threshold conversion.

The significant increases in bloom threshold (from 0.5 to 1.5) and intensity (from 1 to 10) appear to compensate for the underlying implementation change, where bloom threshold calculations were converted from gamma space to linear space. These parameter adjustments help maintain similar visual results despite the space conversion.

Consider adding a code comment explaining why these values were increased to help future developers understand the relationship with the linear space conversion:

+  // Higher threshold and intensity values to compensate for gamma-to-linear space conversion
  bloomEffect.threshold.value = 1.5;
  bloomEffect.intensity.value = 10;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc6ef74 and aa7d499.

⛔ Files ignored due to path filters (1)
  • e2e/fixtures/originImage/PostProcess_postProcess-HDR-bloom-ACES.jpg is excluded by !**/*.jpg
📒 Files selected for processing (1)
  • e2e/case/postProcess-HDR-bloom-ACES.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: codecov
  • GitHub Check: build (22.x, windows-latest)
  • GitHub Check: e2e (22.x)

@GuoLei1990 GuoLei1990 merged commit f73d2e2 into galacean:main Apr 18, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working post processing Post processing rendering Rendering related functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants