diff options
Diffstat (limited to 'shaders/compute.comp')
| -rw-r--r-- | shaders/compute.comp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/shaders/compute.comp b/shaders/compute.comp index f179b63..2b08c5c 100644 --- a/shaders/compute.comp +++ b/shaders/compute.comp @@ -46,7 +46,7 @@ struct camera { float[3] padding; }; -layout(set = 0, binding = 0) buffer Inputs { +layout(set = 0, binding = 0) uniform Inputs { vec4 sky_color; vec4 ground_color; camera cam; @@ -61,10 +61,10 @@ layout(set = 0, binding = 0) buffer Inputs { uint samples_per_pixel; uint width; uint height; - - vec4[] image; }; +layout(set = 0, binding = 1, rgba8) uniform writeonly image2D output_image; + vec3 at(ray r, float t) { return r.origin + r.direction * t; } @@ -223,5 +223,7 @@ void main() { } float spp_scale = (1.0 / samples_per_pixel); - image[y * width + x] = sqrt(out_color * spp_scale); + out_color = sqrt(out_color * spp_scale); + // image[y * width + x] = sqrt(out_color * spp_scale); + imageStore(output_image, ivec2(x, y), out_color); } |
