PDA

View Full Version : Instancing in 11 - Some Questions



Surrealist.
11-12-2011, 03:50 AM
I have a few questions about instancing.

What is the procedure for adding instances? I'll give this as an example:

Say you want to make a tree full of leaves.

First can you distribute the leaves evenly along the branches automatically and with some control over the placement such as weight map, or poly normals or points.

Second, once you make this first tree, could you have it be one group and then instance this group so that all of the individual instances remain instances and then make copies of (and automatically distribute the this instance group) to create a larger, say, forest of trees that originate from one trunk and one leaf and say have it plotted across a terrain?

Another example would be making a building out of only a few stones that you size into slightly different shapes. Say a brick building. And lets say you had one group of these bricks that you used to create the frame around a window portal. (By hand of course) and then could you then take this group of stones and make copies of the group to place around the building for more windows that would all be made up of the first 3 stones and not have to build each individual window again?

And now, it says you can surface each one individually. Is this a process of clicking on the stone and changing the surface?

Or is it possible to have say a few surfaces that you can have randomly distributed among the instances ?

And is it possible to cast deformations globally across multiple instances?

The brick/stone example. Lets say you wanted to make a random looking surface across the stones that are all placed in a uniform position - similar to bricks. But you wanted to add a crumple deformation that was cast across all of the bricks to make the face uneven looking?

I have attached an image I did in LightWave a while back. On the right of the image are the stones before displacement, on the left you see the displacement as applied to the object. Since it was an object it was displaced along the normals but it might work in a very similar way with a 3D procedural texture applied globally - in theory.

This entire building was constructed out of only a few stones that were copied and snapped into place in Modeler.

I was able to make groups of them and copy those for the similar parts - as described above.

Since these were subpatched objects I had major memory problems as you can guess. Instancing would open up some interesting possibilities for this project depending on the workflow possible.

Thanks!

Boris Goreta
11-12-2011, 04:51 AM
Instance deformation

reference object can be deformed, in this example it was deformed using displacement texture, all instances get deformed too and it is animatable

OFF
11-12-2011, 05:06 AM
How LW Instances differs from DPInstances?

Boris Goreta
11-12-2011, 05:09 AM
Concerning your castle example. You can model several groups of blocks and then instance them over single polys, points or particles. In this case you would model single polys in modeler in places where you need a group (instance) to appear. Then in layout you have the ability to see a preview in opengl of all those instanced groups and see if they fit firmly together, check for gaps etc. What is not yet clear to me is the abiliy to manually orient each instance. Instance can be told to align to poly normal but I don't know yet if you could define the heading of each instance too. I mean you can do it manually for each instance but what is a better solution are polygons with one edge shorter that are used to instance objects and orient them automatically to the shortest edge.

biliousfrog
11-12-2011, 05:16 AM
My guess is that it is similar to how HDInstance currently works...although more stable hopefully. Obviously Boris is the best person to answer at this point or an NT representitive but my guess is a similar approach to HDI, whereby instances can be distributed across a surface, per polygon or per point. Each instance can have the surface 'varied' by using a gradient which randomly applies the values across the instances additively...so you'd create a surface and add a gradient colour for example which is 'added' to the original surface.

In the tree example, I think that HDI allows multiple instancing. You'd instance some leaves on to a tree, then instance the tree...whether LW can do this, I don't know.

Boris Goreta
11-12-2011, 05:17 AM
They don't actually differ much, all principles are very much the same.

LW has the ability to show all instances in opengl, animated, deformed, real time, DP instance shows only points or bounding boxes, this is a huge plus for LW.

http://forums.newtek.com/showpost.php?p=1194792&postcount=115

LW also has a very good distribution algorithm that tries to distribute instances on a surface in a way the instances don't intersect each other.

DP has some extra distribution algorithms too but I've found LW's implementation much easier since in DP you have to achieve that with nodes.

DP has some nice features to instance animated objects and randomize speeds and offsets between instances. I'm not sure LW can do that yet but it can instance deformed and animated references, I don't know if this can be randomized over instances.


Also in DP you can instance leaves on trees and then instance those trees+leaves over surfaces.

lardbros
11-12-2011, 05:21 AM
I think the LW11 instancing differs greatly from DP's doesn't it? DP's was a volume, like Hypervoxels, this LW11 one feels like it's TRUE geometry instancing! It's crazy fast too!

Boris Goreta
11-12-2011, 05:27 AM
I think calculation principles are the same, DP is volume plugin just because this way it has access to all data that it needs from LW. LW instance is more integrated and doesn't need to be added this way.

lardbros
11-12-2011, 05:30 AM
You clearly know more than me on the subject... bottom line is, it's working great, and is fully integrated! :D Clearly from your examples, it looks great too! :D

Boris... as you've been testing quite heavily... have you had any issues with colour differences between VPR and F9 with your instances?

Check out this thread I've made in the HC area, and let me know :D

http://forums.newtek.com/showthread.php?p=1195320#post1195320

Boris Goreta
11-12-2011, 05:32 AM
Instance coloring:

you go to surface node editor of a reference object that you are instancing, then add instance info and use ID Index output, if you have 1000 instances in the scene then this number goes from 1 to 1000. You want to feed this to a color gradient to get variations in color. Since instance numbers can vary from scene to scene it is a better idea to feed this ID number to sequencer ( db&w tools free plugin ). Sequencer then outputs numbers from 0 to 1 so you can always have a fixed color gradient ranging from 0 to 1. Then you feed the color gradient output to material color.

Wilfrick
11-12-2011, 05:43 AM
I used a lot HDI, maybe in the 80% of my work.

Now, instances of lw11 are really great!!! They aren't volume, but phisical polygons, this mean that the render speed is the same of all normal polygons objects, so FINALLY can render GI on instaces without wait next century to finish render.

Boris Goreta
11-12-2011, 05:48 AM
They are not physical polygons because that would void the biggest advantage of instances which is memory preservation. Instances are just bounding boxes. If a ray hits it only then it looks for polygons of this instance reference adjusting the ray angle so it matches to instance position, rotation and scale.

biliousfrog
11-12-2011, 05:49 AM
I used a lot HDI, maybe in the 80% of my work.

Now, instances of lw11 are really great!!! They aren't volume, but phisical polygons, this mean that the render speed is the same of all normal polygons objects, so FINALLY can render GI on instaces without wait next century to finish render.

That's good to hear, does it have similar functionality and workflow? I quite like HDI but it seems to be 50/50 whether it will work or not. I've lost countless hours trying to find out why things aren't rendering, rendering with glitches or just rendering black...it has been one of the most useful and also most useless plugins I've ever bought.

lardbros
11-12-2011, 05:58 AM
I used a lot HDI, maybe in the 80% of my work.

Now, instances of lw11 are really great!!! They aren't volume, but phisical polygons, this mean that the render speed is the same of all normal polygons objects, so FINALLY can render GI on instaces without wait next century to finish render.

100000 cubes, instanced using the stanford lucy surface as the instance generator... VPR rendered this in 13 seconds, with GI!! :D

Wilfrick
11-12-2011, 06:07 AM
They are not physical polygons because that would void the biggest advantage of instances which is memory preservation. Instances are just bounding boxes. If a ray hits it only then it looks for polygons of this instance reference adjusting the ray angle so it matches to instance position, rotation and scale.

No, isntances aren't only bounding box, turn it in mesh from bounding box and you will see them in opengl too, in wire frame too, like all normal polygons. Don't ask me how it is possible, I can't understand, but they are polygons that.... don't use memory!

Boris Goreta
11-12-2011, 06:11 AM
This is just for previewing purposes, they are fed to GPU memory. When rendering only one set of polygons is in RAM.

dee
11-12-2011, 06:14 AM
nevermind...

Nigel Baker
11-12-2011, 06:14 AM
Hello All,

Has Newtek put up any tutorials expelling how to use the new features like Instances?

Regards,
Nigel

SBowie
11-12-2011, 06:17 AM
Has Newtek put up any tutorials expelling how to use the new features like Instances?Not yet. Apart from some teasers, I wouldn't expect them to until after release.

Wilfrick
11-12-2011, 06:18 AM
This is just for previewing purposes, they are fed to GPU memory. When rendering only one set of polygons is in RAM.

Ok, i don't know, if they are volume I must say that the render speed of these volume instances is the same of polygon objects. HDI and DPI were really really slow, and needed to activate the volume GI, now no, all happen like objects.

A question: how can hide the source objects? With HDI simply turn 100% dissolve, but now also the instances dissolve....

lardbros
11-12-2011, 06:22 AM
This is not that type of geometry instancing known from Core or other software where you can grab an instance and move/rotate/scale it, it's just a render instance. Hopefully we will get "the real thing" in a later version when modeling tools are in.

But render instancing is better... isn't it?

In 3dsmax you create instances, and each one is still built for the viewport... even with bounding box on, it's still slow!

This has been implemented in Lightwave too! If I grab my original Statue of Liberty, and go to 'Clone' and then instance, it will clone my selected geometry, using the new instance generator. I can then go in and rotate, or scale to my heart's content! :D

THEY EVEN TAKE ON MY BULLET SIM TOO! :D Ha!!!

dee
11-12-2011, 06:29 AM
A question: how can hide the source objects? With HDI simply turn 100% dissolve, but now also the instances dissolve....

Turn visibility off in Scene Editor.



This has been implemented in Lightwave too! If I grab my original Statue of Liberty, and go to 'Clone' and then instance, it will clone my selected geometry, using the new instance generator. I can then go in and rotate, or scale to my heart's content! :D

Cool, didn't know that.:)

lardbros
11-12-2011, 06:31 AM
I didn't either, I just found it halfway through typing my post! :D

Good times!

dee
11-12-2011, 06:39 AM
BTW, does anyone know what this little icon is good for?

http://forums.newtek.com/attachment.php?attachmentid=99268&stc=1&d=1321105108

Bitboy
11-12-2011, 06:43 AM
It's for including children of the selected object into the instancing.

Wilfrick
11-12-2011, 06:50 AM
Turn visibility off in Scene Editor.


and disappear from rendering???
It stay in render and very bad disappear all instances too from view port.

lardbros
11-12-2011, 06:54 AM
I managed to untick visibility of the source object and the instances stay visible. Are you talking HDInstance or LW11 instancing?

Nigel Baker
11-12-2011, 06:56 AM
Hello All,

By the way how or what do I use to blow apart an object?

Regards
Nigel

lardbros
11-12-2011, 07:03 AM
Take the model into Modeller and then use the Fracture tool, under the multiply tab... :D

dee
11-12-2011, 07:07 AM
and disappear from rendering???
It stay in render and very bad disappear all instances too from view port.

Uncheck it in the A column.

Sensei
11-12-2011, 07:07 AM
No, isntances aren't only bounding box, turn it in mesh from bounding box and you will see them in opengl too, in wire frame too, like all normal polygons. Don't ask me how it is possible, I can't understand, but they are polygons that.... don't use memory!

That's illusion.
Reference object polygons are put to gfx memory, then just transformation matrix is changed, and defines where it's displayed..

dee
11-12-2011, 07:09 AM
It's for including children of the selected object into the instancing.

Thanks.

Nigel Baker
11-12-2011, 07:14 AM
Hello LardBros,

Thanks for that, but that Crashes out my Mac every time.
Other people on the forum are posting the same issue.

Regards,
Nigel

Surrealist.
11-12-2011, 07:29 AM
Concerning your castle example. You can model several groups of blocks and then instance them over single polys, points or particles. In this case you would model single polys in modeler in places where you need a group (instance) to appear. Then in layout you have the ability to see a preview in opengl of all those instanced groups and see if they fit firmly together, check for gaps etc. What is not yet clear to me is the abiliy to manually orient each instance. Instance can be told to align to poly normal but I don't know yet if you could define the heading of each instance too. I mean you can do it manually for each instance but what is a better solution are polygons with one edge shorter that are used to instance objects and orient them automatically to the shortest edge.

Right, in my case I would only need to create the instance of the group, say for a window. Trying to place the window automatically would not be productive in my mind, unless I wanted to create some high rise where everything was uniform.

So it is good to know this much is possible.

Thanks for the answer.

Lots of good information here is this thread guys, thanks!

Learning a lot from reading all of the posts and having a look at examples. :)

lardbros
11-12-2011, 08:02 AM
Hello LardBros,

Thanks for that, but that Crashes out my Mac every time.
Other people on the forum are posting the same issue.

Regards,
Nigel

Oh no, maybe it's a MAC issue? Get it reported to fogbugz! :D

Wilfrick
11-12-2011, 08:26 AM
Uncheck it in the A column.

hem..... I'm a :chicken: ....

never knew the function of A column... now work right....

I return in my hen-house.

Ty for the info

Boris Goreta
11-12-2011, 08:43 AM
It is possible to instance objects with MDD animation. How can I randomize animation offset and speed so the horses don't run in sync ?

Sensei
11-12-2011, 08:54 AM
How can I randomize animation offset and speed so the horses don't run in sync ?

Make multiple references at different stages.

juice
11-12-2011, 08:55 AM
here is an other test how can be used
http://www.youtube.com/watch?v=M8wAvR1duLA

Boris Goreta
11-12-2011, 08:56 AM
You are so smart. Thanks !


Make multiple references at different stages.

bazsa73
11-12-2011, 09:02 AM
It is possible to instance objects with MDD animation. How can I randomize animation offset and speed so the horses don't run in sync ?

looks good, now you can make Riders of Rohan in LW! Well, you need some riders first:)

zapper1998
11-12-2011, 09:15 AM
Where is the docs on the Instancing??

Please

juice
11-12-2011, 10:24 AM
... i have difficults with time offset but I am sure to find the button :-)

http://www.youtube.com/watch?v=Gn6czrVWpFc

for people who ask for shaded view of the instances
http://www.youtube.com/watch?v=wQVLEchIj2A

JeffrySG
11-12-2011, 10:27 AM
here is an other test how can be used
http://www.youtube.com/watch?v=M8wAvR1duLA

Thanks for the video. It's nice to see some of the interface and it in action a bit.

Boris Goreta
11-12-2011, 10:27 AM
Let us know if you find out how to time shift.

COBRASoft
11-12-2011, 10:34 AM
Boris: you're using instances, not the flocking. If I remember the right from the show, Rob said that the flocking avoids collisions of the instances.

also, for coloring, I tried the fixed random output directly into a gradient, worked perfectly without the sequencer. Could you check this to be sure?

Some nice ideas here, thx all!

Boris Goreta
11-12-2011, 01:16 PM
Yes, no flocking yet, didn't have the chance to test that.

ncr100
11-12-2011, 02:43 PM
100000 cubes, instanced using the stanford lucy surface as the instance generator... VPR rendered this in 13 seconds, with GI!! :D

Boris - what is the process for setting up a volume as an instance generator?

I have Generation > Type > Surface ... but that's not the volume, just the skin.

?

Thanks in advance.

Boris Goreta
11-12-2011, 03:04 PM
Check this link out:

http://www.youtube.com/watch?v=C3K1bnoJE28

It is DP instance but the same method can be applied to LW instances.


Boris - what is the process for setting up a volume as an instance generator?

I have Generation > Type > Surface ... but that's not the volume, just the skin.

?

Thanks in advance.

ncr100
11-12-2011, 04:01 PM
Check this link out:

http://www.youtube.com/watch?v=C3K1bnoJE28

It is DP instance but the same method can be applied to LW instances.

Tx!

Pavlov
11-12-2011, 06:06 PM
for sure it has been said, but main difference between LW 11 instancing and DPi/HDi is that Lw 11's is not volumetric. This means a lot alone in terms of speed.
Then, instancing has full SDK so any 3rd part will be able to develop ot top of it and, i.e, feed instances to 3rd part engines.
Paolo

Joearchi
12-11-2011, 07:23 AM
Hello,

I've been trying this marvelous new option for the past few days, but I still have one big question:

Is possible to instance instances? A good example would be a forest made with instanced trees, which are made with a tree object and instanced leaves... That would be awesome... But maybe I'm asking too much.

dblincoe
12-11-2011, 08:08 AM
Hello,

I've been trying this marvelous new option for the past few days, but I still have one big question:

Is possible to instance instances? A good example would be a forest made with instanced trees, which are made with a tree object and instanced leaves... That would be awesome... But maybe I'm asking too much.

Not yet, but I've seen numerous request for it. I also did a feature request for it. Fingers crossed.

Sensei
12-11-2011, 08:15 AM
To be honest, it sounds like you have no idea what are instances..

Instance does NOT exist!

It's translation of ray origin and ray direction.. and ray is casted on reference (physically existing geometry) to find out where it intersected it and what triangle hit etc. data.

dblincoe
12-11-2011, 08:32 AM
But instances of instances are possible - look at HDinstance. It handles instances that have children instances.
At the very least couldn't the same geometry used for the opengl preview be used to determine the ray's intersection? Doesn't some of those calculations already have to be made just to display the preview/lighting/texture correctly?
It can't be done until someone programs it to do so. Not saying that I could. I definitely don't understand from a programming point of view what it would take. I'm still amazed that we can do any of this. :D

Maybe LW can have an hybrid type of instancing that has the best features of true volumetric instances and the features found in HDinstances.

Sensei
12-11-2011, 08:35 AM
Applications which have bucket rendering, and history and modifier stack, might have completely different instancing method- geometry generated in fly, when ray is passing bounding box. This instancing method takes memory, but also allows custom displacement. Then when such instance is not used long enough, because rays are not hitting it, or there is out of memory in other part of program, instance memory is freed.

Sensei
12-11-2011, 08:38 AM
HD_Instance offsetting instances - that's example of what is not instancing.. ;)
It's virtual geometry loaded from disk in fly, during rendering, when it's needed. Boosted version of LW built-in object replacement.

Sensei
12-11-2011, 09:16 AM
At the very least couldn't the same geometry used for the opengl preview be used to determine the ray's intersection? Doesn't some of those calculations already have to be made just to display the preview/lighting/texture correctly?

There is/should be no memory used by OpenGL except the one for reference object.. Routine simply set new transformation matrix for each instance, then use "draw reference". Each vertex in reference is multiplied by matrix by GPU automatically, and result is in completely different position, scale and rotation.

There is no calculations to preview/lighting/texture..

JeffrySG
12-11-2011, 09:59 AM
But instances of instances are possible - look at HDinstance.

Even Strata3D has let the user do this for many many years. It's very powerful and useful feature to have. Especially when you can access the instancing within the modeling area in addition to the layout area.

ncr100
12-12-2011, 08:22 PM
The unreleased version of LW 11 does not expose a button to do instances of instances.

dblincoe
12-12-2011, 08:31 PM
Even Strata3D has let the user do this for many many years. It's very powerful and useful feature to have. Especially when you can access the instancing within the modeling area in addition to the layout area.

+1 Would love to be able to instance in modeler.

Joearchi
12-13-2011, 01:44 AM
OK, thanks for the answers. I Will try another way to do it :)