summaryrefslogtreecommitdiff
path: root/src/modules/ray
AgeCommit message (Collapse)Author
2017-06-01ray: move max depth check out of trace_ray()Vito Caputo
We can avoid some unnecessary work at the max depth by checking it in shade_ray() instead.
2017-05-27ray: inline ray_object_* switch functionsVito Caputo
2017-05-27ray: simplify ray_3f_normalize()Vito Caputo
This is functionally identical.
2017-05-27ray: redo ray_3f_distance()Vito Caputo
This function isn't currently used, but its implementation was awful.
2017-05-27ray: normalize direction missed in 28d8022Vito Caputo
Need to normalize the direction when we step the y axis and @ start.
2017-05-27ray: use approximate power in specular reflectionVito Caputo
powf() is slow but precise, this isn't the fastest method but it's at least portable and a bit faster.
2017-05-26ray: s/nlerp/lerp/ where normalize is unnecessaryVito Caputo
It's only necessary to normalize the direction stored vector in x_step(), the rest can simply be linearly interpolated which saves some divides.
2017-05-12ray: mult normalize in ray_object_sphere_normalVito Caputo
Simple optimization taking advantage of the prepare, mults generally are cheaper than divs.
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-27*: remove vestigial module/${module}/${module}.hVito Caputo
Prior to rototiller_module_t these headers were included and the module-specific render functions called directly. That's no longer the case, these files are irrelevant today.
2017-04-22*: add module context machineryVito Caputo
introduces create_context() and destroy_context() methods, and adds a 'void *context' first parameter to the module methods. If a module doesn't supply create_context() then NULL is simply passed around as the context, so trivial modules can continue to only implement render_fragment(). A subsequent commit will update the modules to encapsulate their global state in module-specific contexts.
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-04-22ray: convert to generalized threaded renderingVito Caputo
The ray tracer was already threaded, so this required little change other than making some state global like the previous commits, and calling the underlying non-threaded single-fragment scene renderer function. A future commit will discard the now vestigial ray_threads related code.
2017-04-22*: /render/render_fragment/ in rototiller_module_tVito Caputo
Adding more context to the name in anticipation of adding a prepare_frame() method to the module struct.
2017-04-21*: s/renderer/module/gVito Caputo
Make consistent with the source directory structure naming.
2017-02-14ray: increase highlight exponent on shiny sphereVito Caputo
The highlight on the little green sphere was white-washing the entire thing due to its high specular reflection value. This produces more reasonable results...
2017-02-14ray: add highlight exponent to ray_surface_tVito Caputo
Was a constant at 20, this allows it to be specified per-object.
2017-02-12ray: tweak surface propertiesVito Caputo
Make spheres a little more diverse in terms of specular/diffusion, and minor tweak to the plane color.
2017-02-12ray: update copyright yearsVito Caputo
2017-02-12ray: improve camera movementVito Caputo
Make the camera orbit around the origin at a varying radius, with kept aimed facing the origin, with some vertical sweep+tilt thrown in.
2017-02-12ray: fixup ray_object_plane_intersects_ray() bugVito Caputo
We should only consider dot products > 0 as intersected, or >= something very close to 0 (epsilon). As-is resulted in planes moving with camera movement along the plane normal axis. Also fixes plane distance to be non-negative in the current scene.
2017-02-12ray: remove vestigial stdio.h includeVito Caputo
Leftover from debugging presumably
2017-02-10ray: implement all orders in ray_euler_basis()Vito Caputo
Originally I only implemented pitch->yaw->roll, and being new to all this didn't fully appreciate the limitation that resulted in. This adds all six permutations of pitch/yaw/roll, the scene must specify the desired order when setting up the camera with the euler angles, see the enum in ray_euler.h.
2017-02-09ray: remove redundant recursion depth incrementVito Caputo
trace_ray() bumps the depth, the reflection ray trace_ray() call just needs to propagate the depth variable not advance it as well. This was probably vestigial from early development and never got taken out. This does mean more reflections now, and correspondingly slower rendering, but it at least makes MAX_RECURSION_DEPTH accurate. The define can be changed if the performance is too bad.
2017-02-09ray: fix mistake in ray:sphere intersection mathVito Caputo
2017-01-18autotools: s#../../#@top_srcdir@/src#Vito Caputo
The relative path broke out-of-tree builds. Previously the following: $ mkdir /tmp/foo $ cd /tmp/foo $ ~/src/rototiller/configure $ make Would fail to compile unable to locate the headers in ~/rototiller/src This fixes it.
2017-01-18*: move source into src/ subdirVito Caputo
Restoring some organizational sanity since adopting autotools.
© All Rights Reserved