diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-05-22 10:57:36 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2016-06-08 22:45:40 +0300 |
commit | ee08c87b4bdbce8a43ec7499dda4fe506ec51b32 (patch) | |
tree | 4a95f625288c631fa71492b525602cf4f83505cf /intern/cycles/blender | |
parent | 8708eee988cffaaaac0357efce3590da7ef76053 (diff) |
Cleanup: remove Cycles layer bits checking in the kernel.
At some point the idea was that we could have an optimization where we could
render multiple render layers without re-exporting the scene, by just updating
the layer bits. We are not doing this now and in practice with the available
render layer control like exclude layers it's not always possible anyway.
This makes it easier to support an arbitrary number of layers in the future
(hopefully this summer), and frees up some useful bits in the kernel.
Reviewed By: sergey, dingto
Differential Revision: https://developer.blender.org/D2020
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.h | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_util.h | 8 |
4 files changed, 5 insertions, 21 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index edd5f292c79..80768c096e3 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -365,13 +365,12 @@ Object *BlenderSync::sync_object(BL::Object& b_parent, } /* make holdout objects on excluded layer invisible for non-camera rays */ - if(use_holdout && (layer_flag & render_layer.exclude_layer)) + if(use_holdout && (layer_flag & render_layer.exclude_layer)) { visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA); + } - /* camera flag is not actually used, instead is tested against render layer - * flags */ - if(visibility & PATH_RAY_CAMERA) { - visibility |= layer_flag << PATH_RAY_LAYER_SHIFT; + /* hide objects not on render layer from camera rays */ + if(!(layer_flag & render_layer.layer)) { visibility &= ~PATH_RAY_CAMERA; } @@ -572,7 +571,6 @@ void BlenderSync::sync_objects(BL::SpaceView3D& b_v3d, float motion_time) bool hide = (render_layer.use_viewport_visibility)? b_ob.hide(): b_ob.hide_render(); uint ob_layer = get_layer(b_base->layers(), b_base->layers_local_view(), - render_layer.use_localview, object_is_light(b_ob), scene_layers); hide = hide || !(ob_layer & scene_layer); diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index fd24593c6b6..00f9f58cd12 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -269,8 +269,6 @@ void BlenderSync::sync_integrator() SAMPLING_NUM_PATTERNS, SAMPLING_PATTERN_SOBOL); - integrator->layer_flag = render_layer.layer; - integrator->sample_clamp_direct = get_float(cscene, "sample_clamp_direct"); integrator->sample_clamp_indirect = get_float(cscene, "sample_clamp_indirect"); #ifdef __CAMERA_MOTION__ @@ -377,8 +375,7 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer) layer = layername.c_str(); } else { - render_layer.use_localview = (b_v3d.local_view() ? true : false); - render_layer.scene_layer = get_layer(b_v3d.layers(), b_v3d.layers_local_view(), render_layer.use_localview); + render_layer.scene_layer = get_layer(b_v3d.layers(), b_v3d.layers_local_view()); render_layer.layer = render_layer.scene_layer; render_layer.exclude_layer = 0; render_layer.holdout_layer = 0; @@ -421,7 +418,6 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer) render_layer.use_surfaces = b_rlay->use_solid(); render_layer.use_hair = b_rlay->use_strand(); render_layer.use_viewport_visibility = false; - render_layer.use_localview = false; render_layer.bound_samples = (use_layer_samples == 1); if(use_layer_samples != 2) { diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index e7062d1322a..d690adb5662 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -185,7 +185,6 @@ private: use_surfaces(true), use_hair(true), use_viewport_visibility(false), - use_localview(false), samples(0), bound_samples(false) {} @@ -200,7 +199,6 @@ private: bool use_surfaces; bool use_hair; bool use_viewport_visibility; - bool use_localview; int samples; bool bound_samples; } render_layer; diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index d856982fddb..e23d8bf4e2d 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -275,7 +275,6 @@ static inline uint get_layer(const BL::Array<int, 20>& array) static inline uint get_layer(const BL::Array<int, 20>& array, const BL::Array<int, 8>& local_array, - bool use_local, bool is_light = false, uint scene_layers = (1 << 20) - 1) { @@ -300,13 +299,6 @@ static inline uint get_layer(const BL::Array<int, 20>& array, layer |= (1 << (20+i)); } - /* we don't have spare bits for localview (normally 20-28) because - * PATH_RAY_LAYER_SHIFT uses 20-32. So - check if we have localview and if - * so, shift local view bits down to 1-8, since this is done for the view - * port only - it should be OK and not conflict with render layers. */ - if(use_local) - layer >>= 20; - return layer; } |