Skip to content

Fix procedural skybox orientation in orthographic cameras - #622

Merged
DoubleStyx merged 2 commits into
DoubleStyx:masterfrom
Baplar:procedural-skybox-orientation
Jun 4, 2026
Merged

DoubleStyx merged 2 commits into
DoubleStyx:masterfrom
Baplar:procedural-skybox-orientation

Conversation

@Baplar

@Baplar Baplar commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

This was caused by the view ray being double-flipped in offscreen views.
It’s flipped once already in skybox::ndc_from_fragment_position, but we incorrectly flipped it a second time in clip_pos_from_view_ray

let camera_ray = view_ray.xy / (-view_ray.z);
if (orthographic) {
return vec4<f32>(sign(view_ray.xy * proj_params.xy), 0.0, 1.0);
return vec4<f32>(camera_ray * sign(proj_params.xy), 0.0, 1.0);

@Baplar Baplar Jun 4, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There was a discrepancy with Unity in the way all skyboxes got rendered in ortho cameras, this change seems to bring it up to parity, along with the change in the common module

@Baplar Baplar changed the title Fix procedural skybox orientation on desktop and in cameras Fix procedural skybox orientation in orthographic cameras Jun 4, 2026
@DoubleStyx
DoubleStyx merged commit a3c3991 into DoubleStyx:master Jun 4, 2026
7 of 10 checks passed
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.

Reflection Probe Cubemap Captures Show Black Sky on ProceduralSkyMaterial

2 participants