TRENDING
  • About
  • Contact
No Result
View All Result
  • Home
  • News
  • Review
  • Devices
    • Apple Gadget
    • Ipad
    • Iphone
    • Macbook
  • Apps
  • Compares
SUBSCRIBE
  • Home
  • News
  • Review
  • Devices
    • Apple Gadget
    • Ipad
    • Iphone
    • Macbook
  • Apps
  • Compares
No Result
View All Result
No Result
View All Result
Home News

Challenge: Bindless ray tracing – Discover

by
June 13, 2022
in News
0
Challenge: Bindless ray tracing – Discover
465
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter

Mirror, mirror on the … other mirror. In this challenge, we invite you to explore bindless rendering in Metal 3 and reflect rays on mirrored surfaces.

Thanks to the bindless enhancements in Metal 3, the HybridRendering sample app looks better than ever. It makes all scene resources available to its shaders using Argument Buffers, then uses Metal ray tracing to produce reflections on metallic surfaces — like the ones below.

But as beautifully as the app has drawn this scene, there’s still a limitation: It’s unable to show reflections within reflections, like the mirrored floor reflecting the mirrored sphere.

In fairness: It’s hard to show mirrors reflecting mirrors! Light infinitely bounces between the two surfaces, creating a situation that can’t be solved computationally. Ray tracing apps work around this issue by adding a limited number of light (or ray) “bounces” in the scene to provide more realism.

In this challenge, we invite you to extend that ray tracing code and increase your image’s realism by adding one (or more) extra ray bounces.

Begin the challenge

Before entering this hall of mirrors, we recommend first watching “Go bindless with Metal 3.” After you watch, download the “Rendering reflections in real time using ray tracing” sample code — we’ll be using it for this challenge.




Go bindless with Metal 3

Learn how you can unleash powerful rendering techniques like ray tracing when you go bindless with Metal 3. We’ll show you how to make your app’s bindless journey a joy by simplifying argument buffers, allocating acceleration structures from heaps, and benefitting from the improvements to the…

Rendering reflections in real time using ray tracing

The app has a dedicated compute pass that calculates reflections from a thin G-Buffer containing positions and normals for each pixel in the image.

The ray tracing shader reads this data and uses it with the camera’s view direction to calculate the direction of the reflected rays. It then uses Metal to trace these rays, find intersections, and shade reflections.

raytracing::ray r;
r.origin = positions.read(tid).xyz;
r.direction = normalize(directions.read(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.type == raytracing::intersection_type::triangle )
{
  
}

This produces the following image:

But there’s a problem! The fire trucks are missing from the sphere’s reflection on the floor. We challenge you to reveal the missing trucks by modifying the ray tracing shader, rtReflection, to add an additional ray trace step.

To complete this challenge, you’ll:

  1. Use the reflected normal and intersection position to calculate the next bounce of rays.
  2. Extract the material shading logic into a helper function that allows you to shade reflections within the reflections.
  3. Combine all reflected colors and write them into the outImage.

When you’re done, use the screenshot tool, GPU Debugger, or QuickTime to capture your solution and show us your work by posting it on Twitter with the hashtag #WWDC22Challenges. And if you’d like to discuss bindless ray tracing and other Graphics & Games topics, join the team at events throughout the remainder of the week at WWDC22.

Explore #WWDC22Challenges on social media

Read the WWDC22 Challenges Terms and Conditions

//platform.twitter.com/widgets.js

Source link

Share this:

  • Twitter
  • Facebook

Like this:

Like Loading...
Share186Tweet116Share47

Related Posts

Head to Space in the Classic Graphic Adventure Game Dexter Stardust
News

Head to Space in the Classic Graphic Adventure Game Dexter Stardust

August 12, 2022
Facebook avoids European blackout as regulators squabble over EU-US data transfers  – TechCrunch
News

Facebook avoids European blackout as regulators squabble over EU-US data transfers  – TechCrunch

August 12, 2022
Telegram founder blames Apple for holding back a major update
News

Telegram founder blames Apple for holding back a major update

August 12, 2022
What’s new in advertising attribution technologies – Latest News
News

Upcoming AppTrackingTransparency requirements – Latest News

August 12, 2022
Apple TV+ picks up dark comedy Physical for third season
News

Apple TV+ picks up dark comedy Physical for third season

August 11, 2022
Apple renews Rose Byrne’s dramedy series Physical for a third season
News

Apple renews Rose Byrne’s dramedy series Physical for a third season

August 11, 2022
Next Post
Renders could show the stunning new purple iPhone 14 Pro months before release

iPhone 14 could be a big upgrade for front-facing camera selfie fans

Leave a ReplyCancel reply

Recommended

Apple: No apps circumvented user privacy controls

Apple: No apps circumvented user privacy controls

February 10, 2023
Lightning could strike back — expect portless iPhone problems, says analyst

USB-C iPhone picks up speed as another nation considers mandate

June 29, 2022
When will the iPhone be forced to use USB-C?

When will the iPhone be forced to use USB-C?

October 4, 2022
Apple’s iPhone App Store rules labeled ‘absurd’ as Elon Musk and Spotify’s CEO pile on

Apple’s iPhone App Store rules labeled ‘absurd’ as Elon Musk and Spotify’s CEO pile on

May 2, 2023
The quick and easy guide to eSIM on Apple’s iPhone 14

The quick and easy guide to eSIM on Apple’s iPhone 14

September 13, 2022
Lengthy report details Apple’s long-rumored AR/VR headset, including project delays, prototypes, technical challenges, and more

Apple’s mixed-reality headset expected to launch in early 2023, second-generation model expected in 2024

July 14, 2022
Facebook Twitter Youtube Pinterest
Behalf of Apple

behalfofapple.com is a Tech News Website. We provide you with the latest breaking news and videos straight from the Apple Tech News industry.

Categories

  • Apple Gadget
  • Apps
  • Ipad
  • Iphone
  • News
  • Review

Quick Menu

  • Home
  • About
  • Contact
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

Copyright © 2022 behalfofapple.com

No Result
View All Result
  • About
  • Contact
  • Disclaimer
  • Home
  • Privacy Policy
  • Terms and Conditions

Copyright © 2022 behalfofapple.com

Discover more from Behalf of Apple

Subscribe now to keep reading and get access to the full archive.

Subscribe

Continue reading

Go to mobile version
%d
    • Disclaimer: We are not affiliated, associated, authorized, endorsed by, or in any way officially connected with Apple. We are merely a tech news organization.