Skip to content
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

Add pbr document #2523

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add pbr document #2523

wants to merge 1 commit into from

Conversation

hhhhkrx
Copy link
Contributor

@hhhhkrx hhhhkrx commented Jan 21, 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

  • Documentation
    • Removed existing PBR documentation
    • Added new comprehensive PBR documentation with detailed explanations of rendering parameters, workflows, and material settings
    • Removed documentation on thin film interference shaders

Copy link

coderabbitai bot commented Jan 21, 2025

Walkthrough

This pull request involves documentation changes for Physically Based Rendering (PBR) in the graphics shader section. The existing pbr.md file was removed and replaced with a more comprehensive pbr.mdx document. The new documentation provides a detailed explanation of PBR principles, parameters, and their applications, offering more in-depth insights into rendering techniques and material properties.

Changes

File Change Summary
docs/en/graphics/shader/builtins/pbr.md Completely removed
docs/en/graphics/shader/builtins/pbr.mdx New comprehensive documentation added, explaining PBR principles, parameters, and rendering techniques
docs/en/graphics/shader/builtins/thin.mdx Removed documentation about thin film interference shaders

Sequence Diagram

sequenceDiagram
    participant User
    participant PBRMaterial
    participant Renderer
    
    User->>PBRMaterial: Configure material properties
    PBRMaterial->>PBRMaterial: Set metallic, roughness
    PBRMaterial->>PBRMaterial: Set base color, emissive
    PBRMaterial->>Renderer: Apply material settings
    Renderer->>Renderer: Render with PBR techniques
Loading

Possibly related PRs

Suggested labels

documentation, material

Suggested reviewers

  • zhuxudong

Poem

🐰 In the realm of pixels bright,
PBR shines with physical might,
Metallic gleams and roughness dance,
Rendering worlds with scientific glance,
A shader's magic, clear and light! 🎨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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. (Beta)
  • @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.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 21, 2025
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.56%. Comparing base (decdc46) to head (490e164).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2523      +/-   ##
==========================================
- Coverage   68.59%   68.56%   -0.04%     
==========================================
  Files         957      957              
  Lines      100068   100068              
  Branches     8562     8562              
==========================================
- Hits        68643    68612      -31     
- Misses      31169    31200      +31     
  Partials      256      256              
Flag Coverage Δ
unittests 68.56% <ø> (-0.04%) ⬇️

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.

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: 3

🧹 Nitpick comments (2)
docs/en/graphics/shader/builtins/pbr.mdx (2)

1-4: Consider providing full English translation

The document currently mixes Chinese and English content. Consider providing a complete English version or maintaining separate language files for better accessibility to international users.


8-24: Enhance parameter documentation with code examples

While the parameter documentation is comprehensive, adding code snippets demonstrating the usage of each parameter would make it more practical for developers. Consider adding examples like:

const material = new PBRMaterial();
material.metallic = 0.8;
material.roughness = 0.2;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between decdc46 and 490e164.

📒 Files selected for processing (3)
  • docs/en/graphics/shader/builtins/pbr.md (0 hunks)
  • docs/en/graphics/shader/builtins/pbr.mdx (1 hunks)
  • docs/en/graphics/shader/builtins/thin.mdx (0 hunks)
💤 Files with no reviewable changes (2)
  • docs/en/graphics/shader/builtins/thin.mdx
  • docs/en/graphics/shader/builtins/pbr.md


我们调节材质的金属度,可以发现,金属度越大,周围的环境越清晰,并且开始从白色纯色变成彩色。这是因为电介质(即金属度为 1 时)材质会将光线 100% 全部反射出物体表面,即反射出彩色的周边环境:

<img src="https://gw.alipayobjects.com/zos/OasisHub/711f8b97-247c-465e-8cf2-4896b0c78534/metal.gif" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance image accessibility

While the documentation includes helpful visual examples, consider:

  1. Adding alt text to all images for screen readers
  2. Ensuring images have appropriate contrast ratios
  3. Providing text descriptions of the visual changes shown in animations

Example improvement:

<Image
+ alt="Demonstration of metallic parameter effect showing increasing reflection of environment"
  src="https://gw.alipayobjects.com/zos/OasisHub/711f8b97-247c-465e-8cf2-4896b0c78534/metal.gif"
/>

Also applies to: 49-51, 67-69, 89-91, 106-109, 120-122, 126-128, 142-145, 151-153

| [glossiness](/apis/core/#PBRMaterial-glossiness) | 光泽度。模拟光滑程度,与粗糙度相反。(注,只有关闭金属粗糙工作流才生效)。 |
| [specularGlossinessTexture](/apis/core/#PBRMaterial-specularGlossinessTexture) | 高光光泽度纹理。搭配高光光泽度使用,是相乘的关系。 |

> **注**:PBR 必须开启[环境光](/docs/graphics-light-ambient)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Move critical requirements to the beginning

The note about PBR requiring ambient light is crucial for functionality but is currently placed at the end of the document. Consider moving this requirement to the beginning of the document and expanding it to explain why ambient light is necessary for PBR.

Comment on lines +118 to +122
- 首先需要分别打开 Camera 下和场景中的 Opaque Texture:

<Image
src="https://mdn.alipayobjects.com/huamei_9ahbho/afts/img/A*_tBbRYNaBPMAAAAAAAAAAAAADgDwAQ/original"
/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make prerequisites more prominent

The requirement to enable Opaque Texture in both Camera and scene settings is crucial for transmission to work. Consider moving these prerequisites to the beginning of the Transmission section and highlighting them in a warning callout, similar to how you've handled other important notes.

+<Callout type="warning">
+Prerequisites for Transmission:
+- Enable Opaque Texture in Camera settings
+- Enable Opaque Texture in scene settings
+</Callout>

Committable suggestion skipped: line range outside the PR's diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant