Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/shaders/clouds_compute.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,13 @@ fn update(@builtin(global_invocation_id) invocation_id: vec3<u32>, @builtin(num_
let index = vec2f(f32(invocation_id.x), f32(invocation_id.y)) + vec2f(0.5);

// Load old camera matrix before storageBarrier to prevent race conditions;
let old_cam = common::load_camera(clouds_render_texture, u32(config.render_resolution.y) - 1);
let sample_y = u32(config.render_resolution.y) - 1;
let old_cam = mat4x4f(
textureLoad(clouds_render_texture, vec2u(1, sample_y)),
textureLoad(clouds_render_texture, vec2u(2, sample_y)),
textureLoad(clouds_render_texture, vec2u(3, sample_y)),
textureLoad(clouds_render_texture, vec2u(4, sample_y)),
);
var frag_coord = vec2f(index.x, config.render_resolution.y - index.y);

var ray_origin = get_ray_origin(config.time);
Expand Down
9 changes: 0 additions & 9 deletions src/shaders/common.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ fn save_camera(camera: mat4x4f, frag_coord: vec2f, ray_origin: vec3f) -> vec4f {
return vec4f(0.0);
}

fn load_camera(texture: texture_storage_2d<rgba32float, read_write>, sample_y: u32) -> mat4x4f {
return mat4x4f(
textureLoad(texture, vec2u(1, sample_y)),
textureLoad(texture, vec2u(2, sample_y)),
textureLoad(texture, vec2u(3, sample_y)),
textureLoad(texture, vec2u(4, sample_y)),
);
}

// Noise functions
//
// Hash without Sine by Dave Hoskins
Expand Down
Loading