From 46dcad970ce7ef93b4a64373aa21be98c9133b77 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 8 Nov 2011 22:38:10 +0000 Subject: [PATCH] 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. --- intern/cycles/blender/blender_mesh.cpp | 1 - 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 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"));