This is a GPU

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-12-26 17:30:13

This is a GPU "software" raytracer (i.e. using manual ray-scene intersections and not RTX) written using the WebGPU API. It expects a single glTF scene as input. It supports flat-colored and textured materials with albedo, normal, and material maps. It doesn't support refraction (yet).

To run the program, first build it (see instructions below), then run it with a single glTF scene in the command arguments. For example, if you've built the project in a build directory inside the project root, then you can run ./webgpu-raytracer ../test_scenes/bunny/bunny_100k.gltf.

An optional second command-line parameter defines the background of the scene. It can either be an RGB comma-separated triple like 1,0.5,0.25, or path to an HDRI environment map. The env_maps directory contains some sample enrivonment maps.

If the camera changes in raytracing mode, the raytracing result is discarded and the preview mode is activated again (i.e. there's no temporal reprojection in this case).

Leave a Comment