Revision: 41689
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41689
Author:   blendix
Date:     2011-11-08 22:38:10 +0000 (Tue, 08 Nov 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/intern/cycles/blender/blender_mesh.cpp
    trunk/blender/intern/cycles/blender/blender_shader.cpp

Modified: trunk/blender/intern/cycles/blender/blender_mesh.cpp
===================================================================
--- trunk/blender/intern/cycles/blender/blender_mesh.cpp        2011-11-08 
21:46:31 UTC (rev 41688)
+++ trunk/blender/intern/cycles/blender/blender_mesh.cpp        2011-11-08 
22:38:10 UTC (rev 41689)
@@ -276,7 +276,6 @@
 
        vector<Mesh::Triangle> oldtriangle = mesh->triangles;
 
-
        mesh->clear();
        mesh->used_shaders = used_shaders;
        mesh->name = ustring(b_ob_data.name().c_str());

Modified: trunk/blender/intern/cycles/blender/blender_shader.cpp
===================================================================
--- trunk/blender/intern/cycles/blender/blender_shader.cpp      2011-11-08 
21:46:31 UTC (rev 41688)
+++ trunk/blender/intern/cycles/blender/blender_shader.cpp      2011-11-08 
22:38:10 UTC (rev 41689)
@@ -665,10 +665,16 @@
                        }
                        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"));

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to