Problem: Bindless ray tracing – Uncover

[ad_1]

Mirror, mirror on the … different mirror. On this problem, we invite you to discover bindless rendering in Steel 3 and replicate rays on mirrored surfaces.

Due to the bindless enhancements in Steel 3, the HybridRendering pattern app appears higher than ever. It makes all scene assets accessible to its shaders utilizing Argument Buffers, then makes use of Steel ray tracing to provide reflections on metallic surfaces — like those beneath.

However as superbly because the app has drawn this scene, there’s nonetheless a limitation: It’s unable to indicate reflections inside reflections, just like the mirrored flooring reflecting the mirrored sphere.

In equity: It’s arduous to indicate mirrors reflecting mirrors! Mild infinitely bounces between the 2 surfaces, making a scenario that may’t be solved computationally. Ray tracing apps work round this situation by including a restricted variety of mild (or ray) “bounces” within the scene to supply extra realism.

On this problem, we invite you to increase that ray tracing code and improve your picture’s realism by including one (or extra) additional ray bounces.

Start the problem

Earlier than getting into this corridor of mirrors, we suggest first watching “Go bindless with Steel 3.” After you watch, obtain the “Rendering reflections in actual time utilizing ray tracing” pattern code — we’ll be utilizing it for this problem.




Go bindless with Steel 3

Study how one can unleash highly effective rendering strategies like ray tracing once you go bindless with Steel 3. We’ll present you the way to make your app’s bindless journey a pleasure by simplifying argument buffers, allocating acceleration buildings from heaps, and benefitting from the enhancements to the…

Rendering reflections in actual time utilizing ray tracing

The app has a devoted compute cross that calculates reflections from a skinny G-Buffer containing positions and normals for every pixel within the picture.

The ray tracing shader reads this information and makes use of it with the digital camera’s view path to calculate the path of the mirrored rays. It then makes use of Steel to hint these rays, discover intersections, and shade reflections.

raytracing::ray r;
r.origin = positions.learn(tid).xyz;
r.path = normalize(instructions.learn(tid).xyz);
r.min_distance = 0.1;
r.max_distance = FLT_MAX;

raytracing::intersector<raytracing::instancing, raytracing::triangle_data> inter;
inter.assume_geometry_type( raytracing::geometry_type::triangle );
auto intersection = inter.intersect( r, accelerationStructure, 0xFF );
if ( intersection.kind == raytracing::intersection_type::triangle )
{
  
}

This produces the next picture:

However there’s an issue! The hearth vehicles are lacking from the sphere’s reflection on the ground. We problem you to disclose the lacking vehicles by modifying the ray tracing shader, rtReflection, so as to add an extra ray hint step.

To finish this problem, you’ll:

  1. Use the mirrored regular and intersection place to calculate the subsequent bounce of rays.
  2. Extract the fabric shading logic right into a helper operate that lets you shade reflections inside the reflections.
  3. Mix all mirrored colours and write them into the outImage.

If you’re carried out, use the screenshot device, GPU Debugger, or QuickTime to seize your resolution and present us your work by posting it on Twitter with the hashtag #WWDC22Challenges. And should you’d like to debate bindless ray tracing and different Graphics & Video games subjects, be a part of the crew at occasions all through the rest of the week at WWDC22.

Discover #WWDC22Challenges on social media

Learn the WWDC22 Challenges Phrases and Circumstances



[ad_2]

Source_link

Leave a Comment