| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This tutorial demonstrates the foundational ray tracing implementation by converting the raster foundation to use ray tracing pipelines. It introduces the core concepts of ray-based rendering with acceleration structures, ray generation, closest hit, and miss shaders. This serves as the essential foundation that all subsequent ray tracing tutorials build upon.
This implementation transforms the raster foundation by replacing the traditional graphics pipeline with a ray tracing pipeline. Instead of rasterizing triangles, rays are generated from the camera and traced through the scene using acceleration structures for efficient intersection testing.
Pipeline Type: Ray tracing pipeline vs graphics pipeline
Shader Types: Ray generation, closest hit, miss shaders
Geometry Handling: Acceleration structures (BLAS/TLAS)
Rendering Method: vkCmdTraceRaysKHR vs vkCmdDrawIndexed
[shader("raygeneration")]
void rgenMain()
{
// Generate camera rays and trace them
RayDesc ray;
ray.Origin = cameraPosition;
ray.Direction = normalize(rayDirection);
TraceRay(topLevelAS, rayFlags, 0xff, 0, 0, 0, ray, payload);
}[shader("closesthit")]
void rchitMain(inout HitPayload payload, in BuiltInTriangleIntersectionAttributes attr)
{
// Basic material shading at intersection point
payload.color = float3(1, 0, 0); // Simple red color
}[shader("miss")]
void rmissMain(inout HitPayload payload)
{
// Sky/background color for rays that miss geometry
payload.color = float3(1, 1, 1); // White background
}This basic implementation enables:
For step-by-step conversion guide, see rt_tutorial
This basic implementation can be extended with:
For detailed information about the core ray tracing components:
| Back | FazBrowse Home | New Git URL |