<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body 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("Color"), bkNode->input("Color"));</div>
<div>graph->connect(bkNode->output("Background"), diffuseBSDF->input("Color"));</div>
<div>graph->connect(diffuseBSDF->output("BSDF"), graph->output()->input("Surface"));</div>
<div>
<div><br>
</div>
<div>shader->tag_update(scene);</div>
<div><span style="white-space:pre"></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>
</body>
</html>