<div dir="ltr"><div><div><div>So I am setting up a shader that reads from an ImageTextureNode in Cycles:</div><div><span style="white-space:pre">         </span>ccl::CheckerTextureNode *img = new ccl::CheckerTextureNode();</div><div><span style="white-space:pre">         </span>img->input("Color1")->set(ccl::make_float3(0.0, 0.8, 0.0));</div><div><span style="white-space:pre">           </span>img->input("Color2")->set(ccl::make_float3(0.0, 0.2, 1.0));</div><div><span style="white-space:pre">           </span>img->input("Scale")->set(2.0f);</div><div><br></div><div>I have added my UVs to the mesh like this (I have verified my UVs are correct):</div><div><br></div><div><span style="white-space:pre">               </span>ccl::Attribute *attr_vUV = mesh->attributes.add(ccl::ATTR_STD_UV, ccl::ustring("UVMap"));</div><div><span style="white-space:pre">                </span>ccl::float3 *fUV = attr_vUV->data_float3();</div><div><span style="white-space:pre">                </span>for (int i = 0; i < verts_size; i++)</div><div><span style="white-space:pre">               </span>{</div><div><span style="white-space:pre">                     </span>fUV[i].x = UVs[i * 2 + 0];</div><div><span style="white-space:pre">                    </span>fUV[i].y = UVs[i * 2 + 1];</div><div><span style="white-space:pre">                    </span>fUV[i].z = 0.0f;</div><div><span style="white-space:pre">              </span>}</div><div><br></div><div><br></div><div>I then add UVMap node to the graph like this:</div><div><span style="white-space:pre">               </span>ccl::UVMapNode *uvm = new ccl::UVMapNode();</div><div><span style="white-space:pre">           </span>uvm->attribute = ccl::ustring("UVMap");</div><div><span style="white-space:pre">          </span>graph->add(uvm);</div><div><span style="white-space:pre">           </span></div><div>And connect it to the rest of the shader like this:</div><div><span style="white-space:pre">            </span>graph->connect(uvm->output("UV"), img->input("Vector"));</div><div><span style="white-space:pre">         </span>graph->connect(img->output("Color"), diffuseBrdfNode->input("Color"));</div><div><br></div><div>I've tried various different variants of this (assuming 2D UVs, not setting the UVMapNode attribute, etc) the result is always very broken image (see simple rectangle example attached).</div><div><br></div><div>Is there a step I am missing to correctly setting up the UVs?</div></div></div><div><br></div></div>