Skip to content

Allow scaling and distance transforms in Sky.hlsl - #55

Open
moonwho101 wants to merge 1 commit into
mainfrom
jules-15809471105062068495-9f68c0cb
Open

Allow scaling and distance transforms in Sky.hlsl#55
moonwho101 wants to merge 1 commit into
mainfrom
jules-15809471105062068495-9f68c0cb

Conversation

@moonwho101

Copy link
Copy Markdown
Owner

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

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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings September 5, 2026 01:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 gTexTransform to the cubemap sampling direction (vout.PosL).
  • Change sky clip-space output from the classic z=w far-plane technique to a full mul(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.

Comment thread Shaders/Sky.hlsl
Comment on lines +26 to +27
// Transform local vertex position by gTexTransform for cubemap lookup vector.
vout.PosL = mul(float4(vin.PosL, 1.0f), gTexTransform).xyz;
Comment thread Shaders/Sky.hlsl
Comment on lines +35 to +36
// Transform to clip space using gViewProj so gWorld scale and distance dictate clip space position.
vout.PosH = mul(posW, gViewProj);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants