Tutorial on the idiosyncrasies of the Instancing laboratory. Part 2 of 6

edited July 2012 in Bryce Discussion

For Part 1 of 6 of my tutorial, please go to [ http://www.daz3d.com/forums/discussion/3637/ ]


For Rashad Carter's Comprehensive Tutorial, please go to [ http://www.daz3d.com/forums/discussion/3381/ ]


I have decided to rename the IL from my previous rename, ADL to ARDL. Advanced Replication and Distribution Lab.


First we are going to confirm that the ARDL can NOT randomly rotate the 6 Bryce CSG Primitives.


[023] Please have a look at Picture_21. Here i have prepared the 6 Primitives with various transformations. They are all very simple and no Boolean Set Operations were used. I am going to use a "Mixed Brush" in the ARDL and we will see if any of them rotate properly. You know by now what to do in the ARDL. What is new here is that we must select all 6 of the objects.


[024] Please have a look at Picture_22 and Picture_23. We have selected all 6 objects and they all have random rotation applied but no random scaling.


[025] The render can be seen in Picture_24. No rotation is evident. We see more or less distortion. The Blue Cones, Silver Discs and Red Lenses have not even been distorted in any way - let alone rotated! I did some more tests on the Blue Cones, Silver Discs and Red Lenses each in solo mode. Each of them alone did not respond either.


[026] We are now going to convert these 6 objects into mesh objects and then repeat what we did above. You know how to do this from Part 1 of this tutorial ( see paragraphs [019] to [021] ). The result is shown in Picture_25. So we have confirmed that what we want to do can be achieved ONLY with mesh objects. That is as expected. But it is always good to test something as exhaustively as possible.


[027] I got the idea that i might be able to get around some of these problems if i used mesh bounding boxes for distribution [as a source for the ARDL] and then later [after making them individual objects] loading them with real objects using Copy and Paste Matrix. That is practical only for up to hundred and preferably less objects. If you need thousands, it is impractical. But i thought that for a small number of objects i would give it a try. I thought it would be useful for sticking a small number of objects on a complex surface aligned with the normals. Unfortunately it did not work as expected. Below i show you what the problem is and what the consequences are.


[028] First we need to convert a Bryce cube into a mesh object. Perhaps you will find that easy to do by now [more likely you have done it a thousand times]. To avoid having to repeat a boring procedure, please save everything you have done in the User Object Library [or in a directory called "OBJ Files"]. Once you have that polygonal cube it will behave like any polygonal model. We are going to use it to make the Place-Holder Object for User Controlled Instancing [UCI].


[029] Next we need to make the object to be "loaded" [the one which will have the matrix of the destination applied to it]. I have chosen something simple. Two cones as shown in Picture_26. We will make two versions [1] a Bryce-ONLY CSG version and [2] a version converted into a Surface Mesh. We don't need to use any BSOps for [1] but we will need them for [2] in order to get an object free of embedded polygons which waste memory [we also need to use a 3D modelling application to weld the upper and lower halves together]. An important difference between versions [1] and [2] is that version [1] is perfectly smooth and has no polygons and version [2] is constituted of polygons with a resolution dependent on the wire-frame resolution you have selected when you converted the object from CSG to Surface Mesh. I won't go into all that now because i will cover it in Part 3 of this tutorial and it is quite technical and would take us too far from the current investigation. Obviously the Master Object from which you can load many instances into any matrix you create randomly or deliberately, can be a very complicated model. Here we use something very simple to test the principle. You will note that i have used a transparent material for the Place-Holder Object. In a big scene you could make such objects invisible [non-rendering] or you could just delete them before you render [but always keep the source file!].


[030] Now that we have the Place-Holder Object to be replicated and distributed and also the two Master Objects to be "loaded", we can proceed with the experiment. Please see Picture_27 for an image of the objects. The final result should be the transformed object contained in the RED FRAME in the picture. Note how the Place-Holder Object has been scaled to force a Linear Transformation of the Master Object. The exact dimensions are not so important for this experiment. Make something similar.


[031] First we must test a single operation of Copy Matrix and Paste Matrix. Make a copy of the Place-Holder Object and a copy of the Master Object. Rotate the copy of the Place-Holder Object randomly so that all 3 axis are non-orthogonal relative to World Space axis. It should be rotated such that it would be near impossible for anyone to place a copy of the Master Object inside it with perfect alignment by hand and eye alone.


[032] The following is a standard operation used in Bryce-ONLY modelling [quite a lot] and you may want to learn it perfectly so that you can do it in a second or so without thinking [without having to select Copy Matrix and Paste Matrix from the menu].


(Step 1) Select the copy of the Place-Holder Object and press ALT + C


(Step 2) Select the copy of the Master Object and press ALT + V


The Master Object has snapped to the matrix of the Place-Holder Object. Do this for versions (1) and (2) of the Master Object. You will notice that both the CSG version and the mesh version behave the same. Please see Picture_28.


Having established the basic principle, now comes the fun part of this tutorial and the eventual disappointment.


[033] Make a copy of the Place-Holder Object sitting on the ground plane. Using the Multi-Replicate procedure, create something similar to that shown in Picture_29. The exact angles and distances don't matter. Make in total 5 objects. Then make 5 copies of the Master Object. Then perform the Copy Matrix and Paste Matrix operation [as in [032] above] on each of the 5 sets. Please see Picture_30 for the end result you should get. You can do it on both versions of the Master Object. The CSG version and the mesh version both work fine! I know this is dumb because we could have just used Multi-Replicate on a transformed Master Object. But my madness will become clear very soon.


[034] Make a copy of the Place-Holder Object below the ground plane. Snap to World Centre and then nudge it down. Enter the ARDL using the by now well understood procedure but un-check "Instances". Create a Distribution similar to the one shown in Picture_31. We see that the Place-Holder Objects have all been randomly rotated. You should repeat this later with instances also. They will also work fine.


[035] Select the Group of Distributed Copies [or Instances] and click on the "U" button. Please see Picture_32. All the Place-Holder Objects are now independent. If you move the ground plane, they will not follow anymore.


[036] Now make some copies of the Master Object and progressively "load" them into some of the Place-Holder Objects. You will find some strange results - "there is something wrong with the matrix". Please see Picture_33. Why can't we "load" them as we did after using Multi-Replicate? Who knows what is wrong? It has nothing to do with the Master Object being CSG or a mesh, grouped or ungrouped. The answer is this: The ARDL creates a flawed matrix for the replicated or instanced objects such that the Paste Matrix operation always pastes into the World Space Bounding Box of the object. That also explains some of the strange distortions i demonstrated when i started Part 2 of my tutorial. Please compare with Picture_30 above.


[037] That means we can't use the UCI technique with the ARDL as we can with Multi-Replicate [and that goes for linked objects as well]. That limitation has NOTHING to do with if or not we are using Bryce Primitives or imported meshes. If you tried to exchange imported meshes at various instances with other imported meshes you would get the same distortions you get with Bryce Primitives. Please look at Picture_34 which shows a very clear example of this distortion. Picture_35 shows how it should look. I still have not figured out exactly how the Multi-Replicated mesh objects are different from the same objects produced by the ARDL. But for now i want to keep this tutorial short and to the point.


[038] However there is some good news as well. The ARDL can handle a very large number of trees created in the Tree Lab. All of these trees can be instances. I have not researched how many trees one can have in a scene and i may report on this later. Please see Picture_36. You can see that the trees are randomly rotated as well!


If you make fancy trees by grouping parts made in the Tree Lab then these groups are not rotated. However since these kinds of special trees are usually in the foreground, you can rotate them by hand to get the best composition [you would not want the computer to randomly rotate the special trees you have made.]


To conclude, i show a picture [Picture_37] of a recent experiment. I took Rashad's advice and pressed the ALT key when painting some Mesh Objects onto a sphere [Note that Bryce Primitives will not line up with the surface normals as Mesh Objects do]. It worked fine because i converted the Master Object first into a Mesh Object. The object was made from MetaBalls then scaled 200 percent at world centre. The hull was then converted into a polygonal mesh which took a long time. Scaling up before conversion increases the resolution of the mesh dramatically. There are two things to keep in mind though. Don't scale up too much especially if your object is very complex else Bryce will crash and the other is: ALWAYS convert at WORLD CENTRE. If you raise the object to 400 or more BU along the Y axis and onvert, then Bryce most likely will crash [will always crash at 500 BU even without pre-scaling].

The Master Object consisted of 2048 MetaBalls. Used compound Multi-Replicate operations to create a relatively simple form [a bit of overkill i think but i wanted to push Bryce to the limit]. After conversion at X2 it was 268,864 polygons. In the ARDL i created 240 instances on a hemisphere. Bryce told me that i had 64 million, 527 thousand and 360 polygons! Since Bryce did not crash and i could navigate without too much bother [it helps to display everything as bounding boxes] i take it that all those millions of polygons are virtual and that Bryce 7.1 actually does do "True Instancing"! The file also opens and saves quite quickly. The file size is: 18,513 KB [150,488 KB RAM when one works on it or renders] I am using a quad core 32-bit computer with 4GB of RAM and i also use LAA. Beware though! Do not convert the Instances to Real Objects. Bryce may not be able to save the file and you won't be able to reload it again!


In Part 3 i will go more deeply into UCI especially how that technique can be used to make ultra large Bryce scene files consisting of hundreds of millions of polygons and millions of objects.


Kind regards


Peter

Picture_37b.jpg
800 x 800 - 770K
Pictures_33_36.jpg
800 x 800 - 189K
Pictures_29_32.jpg
800 x 800 - 153K
Pictures_25_28.jpg
800 x 800 - 195K
Pictures_21_24.jpg
800 x 800 - 187K
Post edited by pbudarick_4a3d2ac478 on

Comments

  • Rashad CarterRashad Carter Posts: 1,799
    edited December 1969

    Eating it all up!

  • Electro-ElvisElectro-Elvis Posts: 883
    edited December 1969

    Hello Peter

    You write very clear and precisely. Even for me, who is not a native english speaker, completly understandable. I like your style. And last but least you give very profound information. Thanks a lot for that. I am eager to read part 3

Sign In or Register to comment.