refactor: move BRDFs to separate file#1161
Conversation
WalkthroughA new HLSL header file, Changes
Sequence Diagram(s)sequenceDiagram
participant Shader as PBR.hlsli
participant BRDF as BRDF.hlsli
Shader->>BRDF: Include BRDF.hlsli
Shader->>BRDF: Call BRDF::Diffuse_Lambert(...)
Shader->>BRDF: Call BRDF::F_Schlick(...)
Shader->>BRDF: Call BRDF::D_GGX(...)
Shader->>BRDF: Call BRDF::Vis_SmithJointApprox(...)
Shader->>BRDF: Call BRDF::EnvBRDFApproxLazarov(...)
BRDF-->>Shader: Return computed BRDF values
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
Documentation and Community
|
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the BRDF-related functions by moving them from PBR.hlsli into a new, centralized BRDF.hlsli file to simplify the PBR header and enable cross-feature reuse.
- Removed inline BRDF functions from PBR.hlsli and replaced them with calls to the BRDF namespace functions.
- Introduced a new BRDF.hlsli file containing all the refactored BRDF functions with associated documentation and source citations.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package/Shaders/Common/PBR.hlsli | Switched from inline BRDF implementations to BRDF namespace calls and added an include for BRDF.hlsli. |
| package/Shaders/Common/BRDF.hlsli | New file containing all the BRDF functions with detailed documentation and source references. |
|
✅ A pre-release build is available for this PR: |
move BRDFs to a separate hlsli file to simplify PBR.hlsli and allow them to be used by other features.
Summary by CodeRabbit
New Features
Refactor