chore: improve contrast function#1470
Conversation
WalkthroughIntroduces a two-path contrast mapping in ISHDR.hlsl: computes contrastOriginal via lerp and contrastShadows via a pow-based curve, then selects between them per-channel based on a comparison with hdrColor. Function signatures and external interfaces remain unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Scene as Scene Input
participant ISHDR as ISHDR.hlsl
participant Output as Color Out
Scene->>ISHDR: hdrColor, avgValue.x, Cinematic.z
rect rgba(200,230,255,0.25)
note over ISHDR: Compute two contrast paths
ISHDR->>ISHDR: contrastOriginal = lerp(avgValue.x, hdrColor, Cinematic.z)
ISHDR->>ISHDR: contrastShadows = pow(abs(hdrColor)/avgValue.x, Cinematic.z)\n * avgValue.x * sign(hdrColor)
end
alt contrastOriginal < hdrColor
ISHDR->>ISHDR: hdrColor = contrastShadows
else
ISHDR->>ISHDR: hdrColor = contrastOriginal
end
ISHDR-->>Output: hdrColor
note over Output: Public interface unchanged
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-08-03T18:37:19.690ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
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. Comment |
|
✅ A pre-release build is available for this PR: |
Summary by CodeRabbit