Skip to content

Architecture

Valtteri Koskivuori edited this page May 30, 2018 · 5 revisions

A few notes on some details on how C-ray works

Shared scene data

C-ray uses shared, global arrays for polygons, vertices, texture coordinates and normals. You don't have to worry about this, as all the management is already complete and (somewhat) tested. This choice was made to simplify memory management. Thus, the crayOBJ data structure only has to keep track of an offset, and amount of a given element belonging to it, like so:

int vertexCount;

int firstVectorIndex;

Left-hand coordinate system (Y up world)

This is something that I'm looking to change, since any models you export from, say, Blender, will be mirrored on one axis.

In C-ray, X is right, Y is up, and Z is forward by default.

No instancing, simple transforms

C-ray does not support object instancing at this time. Meaning if you want multiple instances of the same mesh, you just have to load it in multiple times (thus consuming more memory) This is just to keep things simple, but I'm open to improvements on this regard.

The transform system, again, is very simple. You can rotate models, scale them and move them around using numeric coordinates and degrees. Transforms are computed and applied on the actual source coordinates, before rendering.

Primitive default raytracer

I am currently working on improving my math/physics knowledge to prepare for expanding C-ray's rather primitive raytracer into a full unbiased path tracer. This takes time, but please do get in touch if you have suggestions for improvements!

Clone this wiki locally