summaryrefslogtreecommitdiff
path: root/src/modules/ray/ray_scene.h
AgeCommit message (Collapse)Author
2017-12-10ray: split scene data from render stateVito Caputo
This introduces ray_render_t, and ray_render.[ch]. The _prepared member of ray_scene_t has been moved to ray_render_t, and the other _prepared members (e.g. objects) will follow. Up until now I've just been sticking the precomputed state under _prepared members of their associated structures, and simply using convention to enforce anything resembling an api boundary. It's been convenient without being inefficient, but I'd like to move the ray code into more of a reusable library and this wart needs to be addressed. The render state is also where any spatial indexes will be built and maintained, another thing I've been experimenting with. Note most of the churn here is just renaming ray_scene.c to ray_render.c. A nearly global s/ray_scene/ray_render/ has occurred, now that ray_scene_t really only serves as glue to bind objects, lights, and scene-global properties into a cohesive unit.
2017-09-29ray: remove unused ray_scene_t.n_{lights,objects}Vito Caputo
Commit 445e94 switched to using sentinel objects, but missed removal of these obsoleted object counts.
2017-09-13ray: cleanup ray_camera_frame_t fragmentsVito Caputo
Previously every fb_fragment_t (and thus thread) was constructing its own ray_camera_frame_t view into the scene, duplicating some work. Instead introduce ray_camera_fragment_t to encapsulate the truly per-fragment state and make ray_scene_render_fragment() operate on just this stuff with a reference to a shared ray_camera_frame_t prepared once per-frame. Some minor ray_camera.c cleanups sneak in as well (prefer multiply instead of divide, whitespace cleanups...)
2017-06-02ray: plumb depth and camera to objectsVito Caputo
To enable prepare to precompute aspects of primary rays which all have a common origin at the camera, bring the camera to ray_object*_prepare() and bring the depth to ray_object*_intersects_ray() for primary ray detection. This is only scaffolding, functionally unchanged.
2017-06-01ray: perform ambient light color scale in prepareVito Caputo
Trivially removes a ray_3f_mult_scalar() from the hot path.
2017-05-12ray: add ray_scene_prepare() object precomputingVito Caputo
Just embed a _prepared struct in the object where precomputed stuff can be cached. Gets called once before rendering, which ends up calling the object-specific ray_object_$type_prepare() methods per object.
2017-04-22ray: remove vestigial ray_threads codeVito Caputo
Now that rototiller is generally threaded when a prepare_frame() method is supplied, and modules/ray has been updated accordingly, discard the now redundant ray-specific threading code and related stuff.
2017-01-18*: move source into src/ subdirVito Caputo
Restoring some organizational sanity since adopting autotools.
© All Rights Reserved