[Bf-cycles] rendering instances in Cycles

Mohamed Sakr 3dsakr at gmail.com
Thu Jun 18 16:32:49 CEST 2015


Sergey, from this point, what about a large "switch" node?
it is similar to switch(){} in C++, input () will be the object index, and
cases can be dynamic input count, each is a Closure, output is a Closure.
"something similar to Mix or Add Closures, but on a large scale to handle
instances"

this would be better than creating too many cases, each with its "math node
(==)  & Mix Closure"

On Thu, Jun 18, 2015 at 4:26 PM, Mohamed Sakr <3dsakr at gmail.com> wrote:

> thanks a lot Sergey for the help :)
> cheers.
>
> On Thu, Jun 18, 2015 at 4:15 PM, Sergey Sharybin <sergey.vfx at gmail.com>
> wrote:
>
>> You can not use different shaders for different materials, they're
>> betting referenced by geometry primitives. As you already mentioned, you
>> can tweak shader settings by using Object Info and Particle Info nodes. But
>> that wouldn't separate shaders, that will just evaluate same shader
>> differently for different instances.
>>
>> On Thu, Jun 18, 2015 at 4:06 PM, Mohamed Sakr <3dsakr at gmail.com> wrote:
>>
>>> ok Sergey, I understand the part of object instancing, but what confuses
>>> me is: how does each object got its own shader?
>>> I see inside Blender there is an Object info node, which uses data
>>> dynamically like Object index & Material index, is this the only way to
>>> separate shaders between instances?
>>>
>>> On Thu, Jun 18, 2015 at 3:52 PM, Sergey Sharybin <sergey.vfx at gmail.com>
>>> wrote:
>>>
>>>> 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.
>>>>
>>>> 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.
>>>>
>>>> On Thu, Jun 18, 2015 at 2:28 AM, Mohamed Sakr <3dsakr at gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm creating an exporter to Cycles Standalone, I wanna know how Cycles
>>>>> renders instances?
>>>>> 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?
>>>>>
>>>>> Mesh* any_mesh;
>>>>> //fill mesh data
>>>>>
>>>>> Object* main_object;
>>>>> main_object->mesh = any_mesh;
>>>>> main_object->tfm = any_tfm;
>>>>>
>>>>> Object* instance_object;
>>>>> instance_object->mesh = any_mesh;
>>>>> instance_object->tfm = instance_tfm;
>>>>>
>>>>> //what about mesh->used_shaders??
>>>>>
>>>>> so in short, what I do to mark an object as an instance., which data
>>>>> to fill, how to determine its shader.
>>>>>
>>>>> cheers,
>>>>> Mohamed Sakr
>>>>>
>>>>> _______________________________________________
>>>>> Bf-cycles mailing list
>>>>> Bf-cycles at blender.org
>>>>> http://lists.blender.org/mailman/listinfo/bf-cycles
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> With best regards, Sergey Sharybin
>>>>
>>>> _______________________________________________
>>>> Bf-cycles mailing list
>>>> Bf-cycles at blender.org
>>>> http://lists.blender.org/mailman/listinfo/bf-cycles
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Bf-cycles mailing list
>>> Bf-cycles at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-cycles
>>>
>>>
>>
>>
>> --
>> With best regards, Sergey Sharybin
>>
>> _______________________________________________
>> Bf-cycles mailing list
>> Bf-cycles at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-cycles
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-cycles/attachments/20150618/be06793e/attachment.htm 


More information about the Bf-cycles mailing list