diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-08 09:45:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-08 09:45:16 +0400 |
commit | 19d0f93099b0964fca66c4f4b1651260b749a73d (patch) | |
tree | dbc9dabdc2e87dba0d35d0a947b70abb5f07af08 /intern/cycles | |
parent | 873fe5cb59deac0918135e2226c6d2b3cbc743ef (diff) | |
parent | 054e10ac135eee0eb6d4a0e3ca5a3e8ae5a94cea (diff) |
svn merge ^/trunk/blender -r43934:43976
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/blender_session.cpp | 16 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 20 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.h | 5 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_shader.h | 11 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_noise.h | 5 |
5 files changed, 34 insertions, 23 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index d9adc5480dc..cc6ba073188 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -191,14 +191,8 @@ void BlenderSession::render() BL::RenderResult::layers_iterator b_iter; BL::RenderLayers b_rr_layers(r.ptr); - int active = 0; - /* render each layer */ - for(b_rr.layers.begin(b_iter); b_iter != b_rr.layers.end(); ++b_iter, ++active) { - /* single layer render */ - if(r.use_single_layer()) - active = b_rr_layers.active_index(); - + for(b_rr.layers.begin(b_iter); b_iter != b_rr.layers.end(); ++b_iter) { /* set layer */ b_rlay = *b_iter; @@ -226,7 +220,7 @@ void BlenderSession::render() session->reset(buffer_params, session_params.samples); /* update scene */ - sync->sync_data(b_v3d, active); + sync->sync_data(b_v3d, b_iter->name().c_str()); /* render */ session->start(); @@ -394,7 +388,7 @@ void BlenderSession::get_progress(float& progress, double& total_time) void BlenderSession::update_status_progress() { - string status, substatus; + string timestatus, status, substatus; float progress; double total_time; char time_str[128]; @@ -403,13 +397,13 @@ void BlenderSession::update_status_progress() get_progress(progress, total_time); BLI_timestr(total_time, time_str); - status = "Elapsed: " + string(time_str) + " | " + status; + timestatus = "Elapsed: " + string(time_str) + " | "; if(substatus.size() > 0) status += " | " + substatus; if(status != last_status) { - RE_engine_update_stats((RenderEngine*)b_engine.ptr.data, "", status.c_str()); + RE_engine_update_stats((RenderEngine*)b_engine.ptr.data, "", (timestatus + status).c_str()); last_status = status; } if(progress != last_progress) { diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 29ab0ebef1f..91996d52bea 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -122,7 +122,7 @@ bool BlenderSync::sync_recalc() return recalc; } -void BlenderSync::sync_data(BL::SpaceView3D b_v3d, int layer) +void BlenderSync::sync_data(BL::SpaceView3D b_v3d, const char *layer) { sync_render_layers(b_v3d); sync_integrator(layer); @@ -133,7 +133,7 @@ void BlenderSync::sync_data(BL::SpaceView3D b_v3d, int layer) /* Integrator */ -void BlenderSync::sync_integrator(int layer) +void BlenderSync::sync_integrator(const char *layer) { PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); @@ -155,7 +155,20 @@ void BlenderSync::sync_integrator(int layer) integrator->no_caustics = get_boolean(cscene, "no_caustics"); integrator->seed = get_int(cscene, "seed"); - integrator->layer_flag = render_layers[layer].layer; + + /* render layer */ + int active_layer = 0; + + if(layer) { + for(int i = 0; i < render_layers.size(); i++) { + if(render_layers[i].name == layer) { + active_layer = i; + break; + } + } + } + + integrator->layer_flag = render_layers[active_layer].layer; if(integrator->modified(previntegrator)) integrator->tag_update(scene); @@ -208,6 +221,7 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d) /* single layer for now */ RenderLayerInfo rlay; + rlay.name = b_rlay->name(); rlay.scene_layer = get_layer(b_scene.layers()); rlay.layer = get_layer(b_rlay->layers()); rlay.material_override = b_rlay->material_override(); diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index 5e76a0a0b1e..b0bd3004492 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -54,7 +54,7 @@ public: /* sync */ bool sync_recalc(); - void sync_data(BL::SpaceView3D b_v3d, int layer = 0); + void sync_data(BL::SpaceView3D b_v3d, const char *layer = 0); void sync_camera(int width, int height); void sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height); @@ -70,7 +70,7 @@ private: void sync_materials(); void sync_objects(BL::SpaceView3D b_v3d); void sync_film(); - void sync_integrator(int layer); + void sync_integrator(const char *layer); void sync_view(); void sync_world(); void sync_render_layers(BL::SpaceView3D b_v3d); @@ -110,6 +110,7 @@ private: material_override(PointerRNA_NULL) {} + string name; uint scene_layer; uint layer; BL::Material material_override; diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h index 7e0b0ff4d0f..46ef5d2022a 100644 --- a/intern/cycles/kernel/kernel_shader.h +++ b/intern/cycles/kernel/kernel_shader.h @@ -368,12 +368,13 @@ __device int shader_bsdf_sample(KernelGlobals *kg, const ShaderData *sd, #else label = svm_bsdf_sample(sd, sc, randu, randv, &eval, omega_in, domega_in, pdf); #endif + if(*pdf != 0.0f) { + bsdf_eval_init(bsdf_eval, sc->type, eval*sc->weight, kernel_data.film.use_light_pass); - bsdf_eval_init(bsdf_eval, sc->type, eval*sc->weight, kernel_data.film.use_light_pass); - - if(sd->num_closure > 1 && *pdf != 0.0f) { - float sweight = sc->sample_weight; - _shader_bsdf_multi_eval(sd, *omega_in, pdf, sampled, bsdf_eval, *pdf*sweight, sweight); + if(sd->num_closure > 1) { + float sweight = sc->sample_weight; + _shader_bsdf_multi_eval(sd, *omega_in, pdf, sampled, bsdf_eval, *pdf*sweight, sweight); + } } return label; diff --git a/intern/cycles/kernel/svm/svm_noise.h b/intern/cycles/kernel/svm/svm_noise.h index 28ad028ad0e..1d3ace061ab 100644 --- a/intern/cycles/kernel/svm/svm_noise.h +++ b/intern/cycles/kernel/svm/svm_noise.h @@ -84,8 +84,9 @@ __device uint phash(int kx, int ky, int kz, int3 p) __device float floorfrac(float x, int* i) { - *i = quick_floor(x); - return x - *i; + float f = floorf(x); + *i = (int)f; + return x - f; } __device float fade(float t) |