This project provides a web-based ray tracer that can render scenes exported from Blender.
- Modular JavaScript ray tracer with physically-based rendering
- Blender add-on for exporting scenes
- Interactive rendering with adjustable camera and lighting parameters
- Support for various material types: Lambertian, Metal, Dielectric, Emissive
- Background options: Sky gradient, solid color, HDRI, procedural sky
- Post-processing effects: Tone mapping, anti-aliasing, denoising
- Launch Blender
- Go to Edit > Preferences > Add-ons
- Click "Install..." and select the
blender_addon/raycast_exporter.pyfile - Enable the "Import-Export: RayCast Exporter" add-on
- Create your scene in Blender
- Go to the 3D View sidebar (press N if not visible)
- Look for the "RayCast" tab
- Click "Export Scene"
- Choose where to save the JSON file
- Open
index.htmlin a web browser - Use the "Import Blender JSON" option to select your exported scene
- Click "Import Blender Scene"
- Adjust rendering parameters as needed
- Click "Render Scene"
- Spheres
- Boxes
- Planes
- Triangles
- Triangle Meshes (for arbitrary 3D models)
- Lambertian: Diffuse surfaces
- Metal: Reflective surfaces with adjustable roughness
- Dielectric: Glass and other transparent materials
- Emissive: Light-emitting surfaces
The exported JSON from Blender follows this structure:
{
"name": "Scene Name",
"objects": [
{
"type": "sphere",
"name": "Sphere1",
"center": [0, 0, -1],
"radius": 0.5,
"material": {
"type": "lambertian",
"color": [1.0, 0.2, 0.2]
}
}
// More objects...
],
"lights": [
{
"type": "point",
"position": [0, 5, 5],
"color": [1, 1, 1],
"intensity": 8.0
}
// More lights...
],
"camera": {
"position": [0, 1, 3],
"lookAt": [0, 0, -1],
"up": [0, 1, 0],
"fov": 40,
"aspect": 1.5,
"aperture": 0.05,
"focusDist": 4.0,
"type": "perspective"
},
"background": {
"type": "gradient",
"intensity": 1.0
}
}- Improved mesh optimization (BVH acceleration structures)
- Texture mapping
- More material types
- Animation support
- Environment mapping
- Two-way integration (open ray tracer from Blender)
This project is licensed under the MIT License - see the LICENSE file for details.