Create expressive procedural voxel scenes in code and bring them to life with physically based path tracing on the web. Photon is a code-first voxel scene authoring and rendering framework built around procedural generation and GPU-accelerated path tracing with WebGPU.
Warning
This project is currently under active development and all APIs are subject to change. You are welcome to check it out, but should not use it for serious projects yet.
Build voxel scenes entirely from code by combining simple primitives and procedural generators into complex structures. Rather than manually placing thousands of voxels, you describe the rules that produce them using strongly-typed functions.
const white = material({
color: [1, 1, 1],
});
const emissive = material({
color: [1, 0.22, 0.03],
emission: {
color: [1, 0.16, 0.015],
strength: 20,
},
});
const scene = group(
pyramid({
position: [0, 0, 0],
height: 10,
material: white,
}),
voxel({
position: [0, 3, -7],
material: emissive,
}),
);The authoring layer provides composable building blocks that can be reused, nested and combined as you wish:
| Concept | Purpose |
|---|---|
| π¨ Materials | Define how generated surfaces interact with light. |
| π§ Primitives | Basic building blocks from which voxel geometry can be created. |
| βοΈ Generators | Procedurally produce custom geometry according to your own algorithms. |
| π¦ Groups | Compose multiple elements into reusable, hierarchical structures. |
Photon's goal is to make modeling feel more like programming than traditional 3D authoring: define rules, compose them, and let the scene emerge from code.
- β‘ GPU-accelerated path tracing from a sparse voxel octree
- π Progressive accumulation for converging renders
- Stochastic anti-aliasing
- π‘ Physically based light transport with global illumination
- π¨ BSDF material pipeline
- Diffuse reflection β Lambertian-style diffuse light scattering
- Metallic reflection β Ideal smooth mirror reflection
- Emission β Glowing surfaces can emit radiance
- βοΈ Sun and gradient-sky environment lighting, including hard or soft shadows
- π· Perspective and orthographic cameras
- βοΈ Adaptive, GPU-budget-aware scheduling with tiled rendering
- π Live rendering telemetry for progress, timing and scheduling state
This software is provided under the MIT license.
