diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-10 01:09:20 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-10 01:09:20 +0400 |
commit | ad10cbf04aed17c69ccd4e15921669d18ed987e1 (patch) | |
tree | 9a73793ecd3932a5e9a603bc13027078752f6700 /intern/cycles/blender/blender_object.cpp | |
parent | 97d1abfe95281de3e42fb9a8d13226c621fdede5 (diff) |
Cycles: multiple importance sampling for lamps, which helps reduce noise for
big lamps and sharp glossy reflections. This was already supported for mesh
lights and the background, so lamps should do it too.
This is not for free and it's a bit slower than I hoped even though there is
no extra BVH ray intersection. I'll try to optimize it more later.
* Area lights look a bit different now, they had the wrong shape before.
* Also fixes a sampling issue in the non-progressive integrator.
* Only enabled for the CPU, will test on the GPU later.
* An option to disable this will be added for situations where it does not help.
Same time comparison before/after:
http://www.pasteall.org/pic/show.php?id=43313
http://www.pasteall.org/pic/show.php?id=43314
Diffstat (limited to 'intern/cycles/blender/blender_object.cpp')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index ad701266c5b..e9bcea70ab6 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -127,8 +127,8 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI case BL::Lamp::type_AREA: { BL::AreaLamp b_area_lamp(b_lamp); light->size = 1.0f; - light->axisu = make_float3(tfm.x.x, tfm.y.x, tfm.z.x); - light->axisv = make_float3(tfm.x.y, tfm.y.y, tfm.z.y); + light->axisu = transform_get_column(&tfm, 0); + light->axisv = transform_get_column(&tfm, 1); light->sizeu = b_area_lamp.size(); if(b_area_lamp.shape() == BL::AreaLamp::shape_RECTANGLE) light->sizev = b_area_lamp.size_y(); @@ -140,8 +140,8 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI } /* location and (inverted!) direction */ - light->co = make_float3(tfm.x.w, tfm.y.w, tfm.z.w); - light->dir = -make_float3(tfm.x.z, tfm.y.z, tfm.z.z); + light->co = transform_get_column(&tfm, 3); + light->dir = -transform_get_column(&tfm, 2); /* shader */ vector<uint> used_shaders; |