<div dir="ltr"><div><div>Hi there<br><br></div>I am not sure that this is the right place for the question, but nevertheless. I have the following problem with cycles renderer light system. I try to create the scene and render it by code. The problem with lights. I add the light to the scene by the following code:<br></div>//Create light shader and add it to the scene<br><div>    ccl::Light *light = new ccl::Light();<br>    ccl::Shader *shader = new ccl::Shader();<br>    shader-&gt;name = &quot;lightShader&quot;;<br>    ShaderGraph *graph = new ShaderGraph();<br>    ShaderNode *emNode = graph-&gt;add(new EmissionNode());<br>    emNode-&gt;input(&quot;Color&quot;)-&gt;value = make_float3(1.0, 1.0, 1.0);<br>    emNode-&gt;input(&quot;Strength&quot;)-&gt;value.x = 100;<br>    ShaderNode *out = graph-&gt;output();<br>    graph-&gt;connect(emNode-&gt;output(&quot;Emission&quot;), out-&gt;input(&quot;Surface&quot;));<br>    shader-&gt;set_graph(graph);<br>    shader-&gt;tag_update(scene);<br>    scene-&gt;shaders.push_back(shader);<br>    light-&gt;shader = scene-&gt;shaders.size() - 1;<br></div><div>//Next set light object properties<br>    light-&gt;type = LightType::LIGHT_POINT;<br>    light-&gt;samples = 50;<br>    light-&gt;size = 0.1;<br>    light-&gt;cast_shadow = true;<br>    light-&gt;use_mis = true;<br>    light-&gt;max_bounces = true;<br>    light-&gt;use_diffuse = true;<br>    light-&gt;use_glossy = true;<br>    light-&gt;use_transmission = true;<br>    light-&gt;use_scatter = true;<br></div><div>//Set position and direction<br></div><div>    light-&gt;dir = make_float3(1.0, 1.0, 1.0);<br>    light-&gt;co = make_float3(0.0, 0.0, 3.0);<br>    Transform tfm = transform_identity();<br>    light-&gt;co = transform_point(&amp;tfm, light-&gt;co);<br></div><div>//Add light to the scene<br></div><div>    light-&gt;tag_update(scene);<br>    scene-&gt;lights.push_back(light);<br><br></div><div>But when I start the render, the result is completely black. If I add the background to the scene with some color, then I see the objects on the scene (with some simple bsdf shader), illuminated by background. And there is no effect from the light.<br><br></div><div>So, the question: how properly setup lights for rendering in cycles?<br></div></div>