<div dir="ltr"><div>A couple issues:</div><div>* bkNode is not added to the background shader graph.<br>* Don't add BSDF to the background shader, it makes no sense.<br>* Connect bkNode->output("Background") to graph->output()->input("Surface") directly.</div><div><br><div><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 22, 2018 at 3:27 PM, F Escobar <span dir="ltr"><<a href="mailto:materialesescobar@hotmail.es" target="_blank">materialesescobar@hotmail.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
I thought that this could be easy... but I was wrong<br>
<br>
<div>ccl::BackgroundNode* bkNode = new ccl::BackgroundNode();</div>
<div>ccl::Background* bk = scene->background;</div>
<div>ccl::Shader *shader = scene->default_background;
<div><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">ccl::ShaderGraph *graph =¬†</span><span style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;font-size:16px;font-family:Calibri,Helvetica,sans-serif;color:rgb(0,0,0)">shader->graph¬†</span><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">;</span><br>
</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">ccl::SkyTextureNode* sky = new ccl::SkyTextureNode();
<div><span style="background-color:rgba(0,0,0,0)">graph->add(sky);</span></div>
</span></div>
</div>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgba(0,0,0,0)">
<br>
<div>ccl::DiffuseBsdfNode *diffuseBSDF = new ccl::DiffuseBsdfNode();</div>
<div>graph->add(diffuseBSDF);</div>
<div>graph->connect(sky->output("<wbr>Color"), bkNode->input("Color"));</div>
<div>graph->connect(bkNode->output(<wbr>"Background"), diffuseBSDF->input("Color"));</div>
<div>graph->connect(diffuseBSDF-><wbr>output("BSDF"), graph->output()->input("<wbr>Surface"));</div>
<div>
<div><br>
</div>
<div>shader->tag_update(scene);</div>
<div><span style="white-space:pre-wrap"></span><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400">bk</span>->tag_update(scene);<br>
<br>
That looks fair on my head but I only get a black environment so that's wrong for sure.</div>
<div><br>
</div>
<div>Any Idea on this? I bet that is something related to update the bk or the bkNode.</div>
<div><br>
</div>
<div>Thank you in advance</div>
<br>
</div>
<br>
</div>
</div>

<br>______________________________<wbr>_________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">https://lists.blender.org/<wbr>mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><br></div>