diff options
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/color.c | 4 | ||||
-rw-r--r-- | libdimension/dimension/color.h | 4 | ||||
-rw-r--r-- | libdimension/dimension/scene.h | 2 | ||||
-rw-r--r-- | libdimension/raytrace.c | 14 |
4 files changed, 12 insertions, 12 deletions
diff --git a/libdimension/color.c b/libdimension/color.c index eea005b..02ecff9 100644 --- a/libdimension/color.c +++ b/libdimension/color.c @@ -263,7 +263,7 @@ dmnsn_filter_light(dmnsn_color light, dmnsn_color filter) /* Adds the background contribution, `filtered', to `filter' */ dmnsn_color -dmnsn_apply_translucency(dmnsn_color filtered, dmnsn_color filter) +dmnsn_apply_transparency(dmnsn_color filtered, dmnsn_color filter) { dmnsn_color ret = dmnsn_color_add( dmnsn_color_mul(1.0 - filter.trans, filter), @@ -278,7 +278,7 @@ dmnsn_apply_translucency(dmnsn_color filtered, dmnsn_color filter) dmnsn_color dmnsn_apply_filter(dmnsn_color color, dmnsn_color filter) { - return dmnsn_apply_translucency(dmnsn_filter_light(color, filter), filter); + return dmnsn_apply_transparency(dmnsn_filter_light(color, filter), filter); } /* Remove the filter channel */ diff --git a/libdimension/dimension/color.h b/libdimension/dimension/color.h index d4e0402..b135c70 100644 --- a/libdimension/dimension/color.h +++ b/libdimension/dimension/color.h @@ -31,7 +31,7 @@ typedef struct { double G; /**< sRGB green value. */ double B; /**< sRGB blue value. */ - double trans; /**< Translucency. */ + double trans; /**< Transparency. */ double filter; /**< Degree of filtering. */ } dmnsn_color; @@ -92,7 +92,7 @@ dmnsn_color dmnsn_color_gradient(dmnsn_color c1, dmnsn_color c2, double n); /** Filter \p light through \p filter. */ dmnsn_color dmnsn_filter_light(dmnsn_color light, dmnsn_color filter); /** Add the background contribution \p filtered to \p filter. */ -dmnsn_color dmnsn_apply_translucency(dmnsn_color filtered, dmnsn_color filter); +dmnsn_color dmnsn_apply_transparency(dmnsn_color filtered, dmnsn_color filter); /** Add the background contribution of \p color to \p filter. */ dmnsn_color dmnsn_apply_filter(dmnsn_color color, dmnsn_color filter); /** Convert the color into a close equivalent with only transmittance. */ diff --git a/libdimension/dimension/scene.h b/libdimension/dimension/scene.h index 41e2360..2f659e9 100644 --- a/libdimension/dimension/scene.h +++ b/libdimension/dimension/scene.h @@ -29,7 +29,7 @@ enum { DMNSN_RENDER_PIGMENT = 1 << 0, /**< Render pigments. */ DMNSN_RENDER_LIGHTS = 1 << 1, /**< Render lights and shadows. */ DMNSN_RENDER_FINISH = 1 << 2, /**< Render object finishes. */ - DMNSN_RENDER_TRANSLUCENCY = 1 << 3, /**< Render translucency/refraction. */ + DMNSN_RENDER_TRANSPARENCY = 1 << 3, /**< Render transparency/refraction. */ DMNSN_RENDER_REFLECTION = 1 << 4, /**< Render specular reflection. */ DMNSN_RENDER_FULL = ~DMNSN_RENDER_NONE /**< Render everything. */ }; diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c index cb5c8b6..ddd6e09 100644 --- a/libdimension/raytrace.c +++ b/libdimension/raytrace.c @@ -266,7 +266,7 @@ dmnsn_raytrace_light_ray(dmnsn_raytrace_state *state, dmnsn_initialize_raytrace_state(&shadow_state, &shadow_caster); dmnsn_raytrace_pigment(&shadow_state); - if ((state->scene->quality & DMNSN_RENDER_TRANSLUCENCY) + if ((state->scene->quality & DMNSN_RENDER_TRANSPARENCY) && shadow_state.pigment.trans >= dmnsn_epsilon) { color = dmnsn_filter_light(color, shadow_state.pigment); @@ -360,9 +360,9 @@ dmnsn_raytrace_reflection(const dmnsn_raytrace_state *state) return reflected; } -/** Handle translucency - must be called last to work correctly. */ +/** Handle transparency - must be called last to work correctly. */ static void -dmnsn_raytrace_translucency(dmnsn_raytrace_state *state) +dmnsn_raytrace_transparency(dmnsn_raytrace_state *state) { if (state->pigment.trans >= dmnsn_epsilon) { dmnsn_line trans_ray = dmnsn_new_line(state->r, state->intersection->ray.n); @@ -412,7 +412,7 @@ dmnsn_raytrace_translucency(dmnsn_raytrace_state *state) dmnsn_color filtered = dmnsn_filter_light(rec, state->pigment); state->diffuse.filter = state->pigment.filter; state->diffuse.trans = state->pigment.trans; - state->diffuse = dmnsn_apply_translucency(filtered, state->diffuse); + state->diffuse = dmnsn_apply_transparency(filtered, state->diffuse); } } @@ -452,9 +452,9 @@ dmnsn_raytrace_shoot(dmnsn_raytrace_state *state, dmnsn_line ray) ); } - /* Translucency */ - if (state->scene->quality & DMNSN_RENDER_TRANSLUCENCY) { - dmnsn_raytrace_translucency(state); + /* Transparency */ + if (state->scene->quality & DMNSN_RENDER_TRANSPARENCY) { + dmnsn_raytrace_transparency(state); } color = dmnsn_color_add(state->diffuse, state->additional); |