Allow scaling and distance transforms in Sky.hlsl - #55
Conversation
Update Sky.hlsl vertex shader to transform vin.PosL by gTexTransform for cubemap lookup vector calculation and remove .xyww force-swizzle on PosH. This allows gWorld scale and distance transforms to properly affect clip space position and depth. Co-authored-by: moonwho101 <90150577+moonwho101@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
🟡 Changes recommended
The updated shader logic introduces depth/clipping and cubemap-direction transform issues that can cause incorrect rendering behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the sky vertex shader (Sky.hlsl) to (1) apply gTexTransform to the cubemap lookup vector and (2) change how the sky is projected into clip space so world-space transforms affect the final position.
Changes:
- Apply
gTexTransformto the cubemap sampling direction (vout.PosL). - Change sky clip-space output from the classic
z=wfar-plane technique to a fullmul(posW, gViewProj)projection.
File summaries
| File | Description |
|---|---|
| Shaders/Sky.hlsl | Updates cubemap lookup vector transformation and modifies sky clip-space positioning logic. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // Transform local vertex position by gTexTransform for cubemap lookup vector. | ||
| vout.PosL = mul(float4(vin.PosL, 1.0f), gTexTransform).xyz; |
| // Transform to clip space using gViewProj so gWorld scale and distance dictate clip space position. | ||
| vout.PosH = mul(posW, gViewProj); |
Fixed Sky.hlsl so that gWorld matrix scaling and distance transformations take effect in clip space, and gTexTransform can transform the cubemap lookup vector.
PR created automatically by Jules for task 15809471105062068495 started by @moonwho101