A real-time SDF pathtracer. Edit your SDFs and see it pathtraced interactively.
Load cl.exe into environment variable, then invoke code/build.bat to generate the binary.
Build Spectra and run it. While the application is running, you can edit code/scene.hlsl and the changes will be hotloaded in real-time.
To make this work, you need to define the following three functions in scene.hlsl file:
// user-defined functions:
point_query Map(float3 P, float Time)
{
// define geometry
}
material MapMaterial(int MatId, float3 P, float Time)
{
// define material
}
float3 Env(float3 Rd, float Time)
{
// define environment lighting
}
float Fog(float Depth)
{
// define fog attenuation
}
To see how these functions are getting called, check out raymarch.hlsl and primary_shading.hlsl.
Also, the source comes with some example scenes I've made in the form of include files:
#include "sphere.hlsl"
//#include "cornellbox.hlsl"
//#include "tron.hlsl"
...
...
Selectively un-comment the scene you want to see. Here are some screenshots of these stock scenes I've prepared: