Instancing Instances

   4882   7   3
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
Hey, so I have been puzzling over whether there is a good way to do this for a while. Say I have a tree with instanced leaves and I want to make a forest of trees from it. Is there a way to instance the tree and still have the leaves render? Not sure if there is an obvious answer to this…
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
hey,
I'll reply here instead of vimeo.

short answer: you cannot instance instances. This is because the current rendertime procedurals do not support calling other procedurals.

So what can you do?
Depending on the requirements of your shot, you can either:
*) create a few trees (with leaves) and instance those around.
*) Or patches of trees if you are dealing with entire forests.
*) If you are dealing with entire forests, I highly recommend to make a level of detail tree patch, so the foreground trees load high res geo, the mid ground renders leaves as single face polygons and the background trees renders leaves as points/particles.

If you don't have that many trees and perhaps you need interaction with the leaves, you create an instance for each leaf and you could also create instances for the treetrunks.

Good luck!
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
12469 posts
Joined: July 2005
Offline
You can create nested instances by using nested packed primitives. This defines the geometry once and you can nest them like crazy.

Please see the attached hip file for a leaf/trunk/tree/forest example.

Attachments:
nestedPackedForest.hip (162.7 KB)

Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
Thanks for the quick reply guys! Also thanks for responding to my vimeo message Peter. I had a feeling that was probably what the issue was but figured that if anyone knew a workaround you would. As for the packed primitives I just started playing around with them last night and they look promising. I just have some spec questions though. Is there much of a speed difference between packed prims and instancing? I think I heard something about it being better to pack a large number of objects together rather then just a single leaf? Is that right?

Also about LOD's I am was wondering if there is a big speed difference between an object modeled with simple NURBs vs. low res polys? Anyway, thanks for all the help!
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
I think low poly models are faster than NURBS ,Because I think NURBS should be converting to the polygons in the Rendering process :?
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
90ender
Is there much of a speed difference between packed prims and instancing? I think I heard something about it being better to pack a large number of objects together rather then just a single leaf? Is that right?

The difference is negligible between rendering packed primitives on disk and using the Delay Load Procedural. The benefits to moving to Packed Primitives is you actually get to see the instances in the viewport in many different ways. So the Copy SOP is the instance generator when copying packed primitives around.


Also about LOD's I am was wondering if there is a big speed difference between an object modeled with simple NURBs vs. low res polys? Anyway, thanks for all the help!

Depends. Not much to a lot.

Mantra has to refine any and all primitives if it can't render them directly (small enough in the frustum to render with the given shading quality setting). Polys just undergo refinement if there are no displacement shaders used.

As for NURBs, Beziers, Subdivision Surfaces, Primtives (spheres, etc), and any polygons with true displacements will cause Mantra to further dice the refined geometry in to micropolygons. Another step and with PBR/raytracing there is a good chance that all these primitive types in the camera frustum will need to be micropolygonized all at once and not per bucket.

This can lead to more memory consumed and a bit more work in dicing the NURBs surfaces in to micropolygons. Again all depends as if there are tiny bits of leaves all over, then the refinement is not required (small enough to directly render) and if the leaf is around the size of a pixel, not much dicing in to micropolys either.

That is what I meant by “it depends”. For leaves, not that much.

If it's leaves, unless it's real close, polygons work just as fine imho. Use bump maps as well (remember true displacements cause the geometry to be micropolygonized).

It's easy enough to test as well. Just switch from NURBs to non-displaced Polys and test.
There's at least one school like the old school!
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
jeff
90ender
Is there much of a speed difference between packed prims and instancing? I think I heard something about it being better to pack a large number of objects together rather then just a single leaf? Is that right?

The difference is negligible between rendering packed primitives on disk and using the Delay Load Procedural. The benefits to moving to Packed Primitives is you actually get to see the instances in the viewport in many different ways. So the Copy SOP is the instance generator when copying packed primitives around.


Also about LOD's I am was wondering if there is a big speed difference between an object modeled with simple NURBs vs. low res polys? Anyway, thanks for all the help!

Depends. Not much to a lot.

Mantra has to refine any and all primitives if it can't render them directly (small enough in the frustum to render with the given shading quality setting). Polys just undergo refinement if there are no displacement shaders used.

As for NURBs, Beziers, Subdivision Surfaces, Primtives (spheres, etc), and any polygons with true displacements will cause Mantra to further dice the refined geometry in to micropolygons. Another step and with PBR/raytracing there is a good chance that all these primitive types in the camera frustum will need to be micropolygonized all at once and not per bucket.

This can lead to more memory consumed and a bit more work in dicing the NURBs surfaces in to micropolygons. Again all depends as if there are tiny bits of leaves all over, then the refinement is not required (small enough to directly render) and if the leaf is around the size of a pixel, not much dicing in to micropolys either.

That is what I meant by “it depends”. For leaves, not that much.

If it's leaves, unless it's real close, polygons work just as fine imho. Use bump maps as well (remember true displacements cause the geometry to be micropolygonized).

It's easy enough to test as well. Just switch from NURBs to non-displaced Polys and test.

Really whole explanation ,Thanks
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
jason_iversen
You can create nested instances by using nested packed primitives. This defines the geometry once and you can nest them like crazy.

Nice! Still on 12.5 here, so my info is outdated. I look forward to switching soon and making use of this awesome tech.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
  • Quick Links