Skip to content

CLI Reference

Complete command-line options.

Usage

bash
ray_tracer [options] -o <output_file>

General Options

OptionDefaultDescription
-o, --output <file>output.ppmOutput file path
-w, --width <n>800Image width
-h, --height <n>600Image height
--scene <name>demoPreset scene name
-v, --verboseoffShow detailed output

Render Mode

OptionDescription
-p, --path-traceEnable path tracing mode
-s, --samples <n>Samples per pixel (path tracing)

Preset Scenes

NameDescriptionSpheres
demoDemo scene10
cornellCornell Box6
randomRandom spheres100

Examples

bash
# Default Phong shading
ray_tracer -o phong.ppm

# 4K resolution
ray_tracer -w 3840 -h 2160 -o 4k.ppm

# Path tracing 128 samples
ray_tracer --scene cornell -p -s 128 -o cornell-128.ppm

# High quality path tracing
ray_tracer --scene cornell -p -s 512 -w 1920 -h 1080 -o high-quality.ppm

Performance Tuning

bash
# With BVH acceleration (default)
ray_tracer --scene random -o fast.ppm

# Without BVH (for comparison testing)
ray_tracer --scene demo --no-bvh -o slow.ppm

Technical Whitepaper · Built with VitePress