<div dir="ltr">In your example is rather correct, it'll create two objects which are sharing the same mesh. ObjectManager and BVH builder detects if objects are sharing the same mesh and does some special things for proper instancing then.<div><br></div><div>Not sure why do you ask about shaders, they are not object property, they're mesh property. Synchronization code from blender/ is whet you want to look into to understand it better.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 18, 2015 at 2:28 AM, Mohamed Sakr <span dir="ltr"><<a href="mailto:3dsakr@gmail.com" target="_blank">3dsakr@gmail.com</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">Hi,<br><br>I'm creating an exporter to Cycles Standalone, I wanna know how Cycles renders instances?<br>so if I have a Mesh* which is shared across 2 Object* , is this all what I need to do? or am I missing something?<br><br>Mesh* any_mesh;<br>//fill mesh data<br><br>Object* main_object;<br>main_object->mesh = any_mesh;<br>main_object->tfm = any_tfm;<br><br>Object* instance_object;<br>instance_object->mesh = any_mesh;<br>instance_object->tfm = instance_tfm;<br><br>//what about mesh->used_shaders??<br><br>so in short, what I do to mark an object as an instance., which data to fill, how to determine its shader.<br><br>cheers,<br>Mohamed Sakr</div>
<br>_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div><span style="color:rgb(102,102,102)">With best regards, Sergey Sharybin</span></div></div>
</div>