Skip to content

Commit

Permalink
vk: rt: draw skybox where ray hasn't hit anything
Browse files Browse the repository at this point in the history
fixes #579
  • Loading branch information
w23 committed Sep 26, 2023
1 parent 02efba3 commit f63dcd1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ref/vk/shaders/ray_primary.comp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ void main() {
//debug_geometry_index = rayQueryGetIntersectionPrimitiveIndexEXT(rq, true);
primaryRayHit(rq, payload);
L = rayQueryGetIntersectionTEXT(rq, true);
} else {
// Draw skybox when nothing is hit
payload.emissive.rgb = SRGBtoLINEAR(texture(skybox, ray.direction).rgb);
}

traceSimpleBlending(ray.origin, ray.direction, L, payload.emissive.rgb, payload.base_color_a.rgb);
Expand Down

0 comments on commit f63dcd1

Please sign in to comment.