diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-09 02:38:10 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-09 02:38:10 +0400 |
commit | 46dcad970ce7ef93b4a64373aa21be98c9133b77 (patch) | |
tree | a461de37a2819dd0e856038bbfeacf6538fad516 | |
parent | 7f273394d599293d41b5bff37b3ad56bb507a1c8 (diff) |
Cycles: fix light strength mistmatch when clicking "use nodes".
Regarding merge status, there should be no build failures, but cycles may not
be enabled in your build, we are still solving:
* Windows: CUDA kernel compile at runtime is failing, probably will have to
do precompiled kernel again.
* Mac: scons is not building cycles yet.
* Linux doesn't have boost + openimageio libs available in lib/ yet, so it
requires manual install of those libs still.
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 1 | ||||
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 3bf83fa533f..56e8561d64b 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -276,7 +276,6 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated) vector<Mesh::Triangle> oldtriangle = mesh->triangles; - mesh->clear(); mesh->used_shaders = used_shaders; mesh->name = ustring(b_ob_data.name().c_str()); diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index f1b032b5cc8..6f78fe1f0d4 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -665,10 +665,16 @@ void BlenderSync::sync_lamps() } else { ShaderNode *closure, *out; + float strength = 1.0f; + + if(b_lamp->type() == BL::Lamp::type_POINT || + b_lamp->type() == BL::Lamp::type_SPOT || + b_lamp->type() == BL::Lamp::type_AREA) + strength = 100.0f; closure = graph->add(new EmissionNode()); closure->input("Color")->value = get_float3(b_lamp->color()); - closure->input("Strength")->value.x = b_lamp->energy()*10.0f; + closure->input("Strength")->value.x = strength; out = graph->output(); graph->connect(closure->output("Emission"), out->input("Surface")); |