Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_light.cpp
| Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | void BlenderSync::sync_light(BL::Object &b_parent, | ||||
| /* location and (inverted!) direction */ | /* location and (inverted!) direction */ | ||||
| light->set_co(transform_get_column(&tfm, 3)); | light->set_co(transform_get_column(&tfm, 3)); | ||||
| light->set_dir(-transform_get_column(&tfm, 2)); | light->set_dir(-transform_get_column(&tfm, 2)); | ||||
| light->set_tfm(tfm); | light->set_tfm(tfm); | ||||
| /* shader */ | /* shader */ | ||||
| array<Node *> used_shaders; | array<Node *> used_shaders; | ||||
| find_shader(b_light, used_shaders, scene->default_light); | find_shader(b_light, used_shaders, scene->get_default_light()); | ||||
| light->set_shader(static_cast<Shader *>(used_shaders[0])); | light->set_shader(static_cast<Shader *>(used_shaders[0])); | ||||
| /* shadow */ | /* shadow */ | ||||
| PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); | PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); | ||||
| PointerRNA clight = RNA_pointer_get(&b_light.ptr, "cycles"); | PointerRNA clight = RNA_pointer_get(&b_light.ptr, "cycles"); | ||||
| light->set_cast_shadow(get_boolean(clight, "cast_shadow")); | light->set_cast_shadow(get_boolean(clight, "cast_shadow")); | ||||
| light->set_use_mis(get_boolean(clight, "use_multiple_importance_sampling")); | light->set_use_mis(get_boolean(clight, "use_multiple_importance_sampling")); | ||||
| ▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | if (sample_as_light || use_portal) { | ||||
| b_world.ptr.data != world_map) { | b_world.ptr.data != world_map) { | ||||
| light->set_light_type(LIGHT_BACKGROUND); | light->set_light_type(LIGHT_BACKGROUND); | ||||
| if (sampling_method == SAMPLING_MANUAL) { | if (sampling_method == SAMPLING_MANUAL) { | ||||
| light->set_map_resolution(get_int(cworld, "sample_map_resolution")); | light->set_map_resolution(get_int(cworld, "sample_map_resolution")); | ||||
| } | } | ||||
| else { | else { | ||||
| light->set_map_resolution(0); | light->set_map_resolution(0); | ||||
| } | } | ||||
| light->set_shader(scene->default_background); | light->set_shader(scene->get_default_background()); | ||||
| light->set_use_mis(sample_as_light); | light->set_use_mis(sample_as_light); | ||||
| light->set_max_bounces(get_int(cworld, "max_bounces")); | light->set_max_bounces(get_int(cworld, "max_bounces")); | ||||
| /* force enable light again when world is resynced */ | /* force enable light again when world is resynced */ | ||||
| light->set_is_enabled(true); | light->set_is_enabled(true); | ||||
| int samples = get_int(cworld, "samples"); | int samples = get_int(cworld, "samples"); | ||||
| if (get_boolean(cscene, "use_square_samples")) | if (get_boolean(cscene, "use_square_samples")) | ||||
| Show All 16 Lines | |||||