diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-08-21 13:24:13 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-08-21 13:24:13 -0600 |
commit | 942fd9ff8e267b361de580a95fa247e486120891 (patch) | |
tree | 683835731d05db901d98d10ba0023bb1ef3fb285 /libdimension/raytrace.c | |
parent | 6b1fcde7af64ca81079dffe1d62096228693b5d6 (diff) | |
download | dimension-942fd9ff8e267b361de580a95fa247e486120891.tar.xz |
Replace sky_spheres with a single background pigment.
Diffstat (limited to 'libdimension/raytrace.c')
-rw-r--r-- | libdimension/raytrace.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c index 92947d6..056e7bf 100644 --- a/libdimension/raytrace.c +++ b/libdimension/raytrace.c @@ -205,18 +205,14 @@ dmnsn_raytrace_scene_concurrent(void *ptr, unsigned int thread, /** Calculate the background color. */ static dmnsn_color -dmnsn_raytrace_background(dmnsn_raytrace_state *state, dmnsn_line ray) +dmnsn_raytrace_background(const dmnsn_raytrace_state *state, dmnsn_line ray) { - dmnsn_color color = state->scene->background; - if (state->scene->sky_sphere - && (state->scene->quality & DMNSN_RENDER_PIGMENT)) - { - dmnsn_color sky = dmnsn_sky_sphere_color(state->scene->sky_sphere, - dmnsn_vector_normalized(ray.n)); - color = dmnsn_apply_filter(color, sky); + dmnsn_pigment *background = state->scene->background; + if (state->scene->quality & DMNSN_RENDER_PIGMENT) { + return dmnsn_evaluate_pigment(background, dmnsn_vector_normalized(ray.n)); + } else { + return background->quick_color; } - - return color; } /** Calculate the base pigment at the intersection. */ |