vkoskiv/c-ray logo

vkoskiv/c-ray

Free

c-ray is a small, simple path tracer written in C

FreeFree tier
Type
Open Source

About vkoskiv/c-ray

c-ray is a portable, hackable, embeddable offline software path tracer written in C99, designed for learning and experimentation. It emphasizes a clear codebase without superfluous abstraction. Key capabilities include a unidirectional Monte Carlo integrator with global illumination, a performant BVH accelerator, a node-graph material/shader system with 32+ node types (including a Principled BSDF approximation), multithreading, object instancing, HDR environment maps, depth of field via a thin-lens camera model, and cluster rendering support over TCP/IP. It provides a C API, Python bindings, and a Blender add-on for easy integration. c-ray has been verified on x86, ARM, PowerPC, MIPS, SPARC, and WebAssembly architectures. It is actively maintained with community contributions and includes an integrated test suite.

Key Features

Unidirectional Monte Carlo integrator with global illumination
Node-graph material/shader system with 32+ node types including Principled BSDF approximation
Performant BVH accelerator for ray tracing
Multithreaded rendering
Object instancing
HDR environment maps for realistic lighting
Thin-lens camera approximation with depth of field
Cluster rendering support over TCP/IP
Python bindings for scripting and integration
Blender add-on for direct use within Blender

Pros & Cons

Pros
  • Open source with a permissive license (BSD-style)
  • Highly portable across many CPU architectures and WebAssembly
  • Clear, hackable codebase written in C99 that is easy to understand and modify
  • Comprehensive feature set for an educational renderer (global illumination, BVH, materials, depth of field)
  • Includes both Python bindings and a Blender add-on for workflow integration
  • Active community with contributions and a dedicated wiki for documentation
Cons
  • Not intended for production rendering; performance is lower compared to GPU-accelerated renderers
  • Material system uses ad-hoc implementations rather than fully physically based models
  • Limited documentation beyond the wiki and README; learning curve for modifying internals
  • Offline CPU rendering only; no real-time or GPU support
  • Some advanced features (e.g., more efficient light sampling, lower memory usage) are still under development

Best For

Learning computer graphics and path tracing fundamentalsExperimental rendering and research prototypingOffline rendering of 3D scenes with global illuminationIntegration into Blender as an educational or hobbyist render engineCross-platform rendering on diverse CPU architectures including ARM and legacy systems

FAQ

What is c-ray?
c-ray is a portable, hackable, embeddable offline software path tracer written in C99, designed primarily for learning the fundamentals of path tracing and computer graphics.
What platforms does c-ray support?
It has been verified on x86, x86_64, ARMv6–v8/AARCH64, PowerPC 7xx/74xx, MIPS R5000, SuperSPARC II, and WebAssembly via emscripten.
Can I use c-ray in Blender?
Yes, c-ray includes a Blender add-on. You can build and install it by setting BLENDER_ROOT in lib.mk and running 'make fullblsync' to compile the Python bindings and install the add-on.
Is c-ray open source?
Yes, the source code is available on GitHub under a permissive license (BSD-3-Clause as indicated in the LICENSE file).
What programming language is c-ray written in?
The core renderer is written in plain C99 with some optional dependencies written in Python (utility scripts) and CMake for building.