Your guide to Metal ray tracing

RSS for tag

Discuss the WWDC23 Session Your guide to Metal ray tracing

View Session

Posts under wwdc2023-10128 tag

5 Posts
Sort by:
Post not yet marked as solved
1 Replies
485 Views
Its said that A17 will support hardware raytracing. It will support both RayQuery (Inline Ray Tracing) and RayPipeline features, right? And we can use ray tracing function on compute and graphics shaders, right? Can we custom intersection test function? How can we handle sdf intersection test in ray tracing pipeline?
Posted
by jerrywwl.
Last updated
.
Post not yet marked as solved
0 Replies
440 Views
I've got a scene which renders as I expect: but in the acceleration structure inspector, the kraken primitive doesn't render: In the list on the left, the structure is there. As expected, there is just one bounding-box primitive as a lot happens in the intersection function (doing it this way since I've already built my own octree and it takes too long to rebuild BVHs for dynamic geometry) This is just based on the SimplePathTracer example. The signatures of the sphereIntersectionFunction and octreeIntersectionFunction aren't that different: [[intersection(bounding_box, triangle_data, instancing)]] BoundingBoxIntersection sphereIntersectionFunction(// Ray parameters passed to the ray intersector below float3 origin [[origin]], float3 direction [[direction]], float minDistance [[min_distance]], float maxDistance [[max_distance]], // Information about the primitive. unsigned int primitiveIndex [[primitive_id]], unsigned int geometryIndex [[geometry_intersection_function_table_offset]], // Custom resources bound to the intersection function table. device void *resources [[buffer(0), function_constant(useResourcesBuffer)]] #if SUPPORTS_METAL_3 ,const device Sphere* perPrimitiveData [[primitive_data]] #endif ,ray_data IntersectionPayload& payload [[payload]]) { vs. [[intersection(bounding_box, triangle_data, instancing)]] BoundingBoxIntersection octreeIntersectionFunction(// Ray parameters passed to the ray intersector below float3 origin [[origin]], float3 direction [[direction]], float minDistance [[min_distance]], float maxDistance [[max_distance]], // Information about the primitive. unsigned int primitiveIndex [[primitive_id]], unsigned int geometryIndex [[geometry_intersection_function_table_offset]], // Custom resources bound to the intersection function table. device void *resources [[buffer(0)]], const device BlockInfo* perPrimitiveData [[primitive_data]], ray_data IntersectionPayload& payload [[payload]]) Note: running 15.0 beta 5 (15A5209g) since even the unmodified SimplePathTracer example project will hang the acceleration structure viewer on Xcode 14. Update: Replacing the octreeIntersectionFunction's code with just a hard-coded sphere does render. Perhaps the viewer imposes a time (or instruction count) limit on intersection functions so as to not hang the GPU?
Posted
by Audulus.
Last updated
.
Post not yet marked as solved
0 Replies
738 Views
I am learning Accelerating ray tracing using Metal. The area light has its own struct in this sample code, but I want to sample rays directly from the LightMesh. Can I get the instances and geometry of lightMesh without using resources buffer? It seems the geometries are already loaded in the GPU because Metal3 is able to do the intersection test. However, I can only get primitive_data during the intersection, and cannot get the information when I tried to do sampling. Thanks a lot!
Posted
by QuintonQ.
Last updated
.
Post not yet marked as solved
1 Replies
625 Views
Application fails almost immediately after initial entry to rendering code. Could not locate file '.' in bundle. Class for component already registered Registering library () that already exists in shader manager. Library will be overwritten. Resolving material name 'engine:BuiltinRenderGraphResources/AR/suFeatheringCreateMergedOcclusionMask.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle What additional packages need updates to run successfully? I have updated the Xcode and other packages available in Beta set
Posted
by mfstanton.
Last updated
.