nicoladanese Posted September 6, 2019 Share Posted September 6, 2019 Hey! I'm looking into a way of doing this sort of abstract models, and I'm copy/stamping cubes on a grid, driving colors from a map and the height of the cubes (from another map + noise) is piped into a copy stamp, it works fine but I find it very slow when the number of copies rises too much, it takes roughly one minute to copy/stamp 1 million cubes. I noticed is not multi threaded so I wonder if there's a smarter/faster/better way of approaching this cheers! Quote Link to comment Share on other sites More sharing options...
Librarian Posted September 6, 2019 Share Posted September 6, 2019 ProcSRle.hipnc Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted September 6, 2019 Share Posted September 6, 2019 Maybe you could try point instancing. You transfer all your colors, height info etc. to drive your shader color and size attributes that will modify your cubes at rendering.... Quote Link to comment Share on other sites More sharing options...
nicoladanese Posted September 6, 2019 Author Share Posted September 6, 2019 28 minutes ago, srletak said: ProcSRle.hipnc Hey thanks! I didn't think about extruding primitives, definitely faster, the only problem is that this way you are limited on the shape of the geos, I think I need to have more control over the shape of the instanced geo Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted September 6, 2019 Share Posted September 6, 2019 (edited) Oops Edited September 6, 2019 by StepbyStepVFX Answered by mistake - Post should be removed Quote Link to comment Share on other sites More sharing options...
Librarian Posted September 6, 2019 Share Posted September 6, 2019 instance node grid scatter Point Wrangel code/ make a path(plural) the your OBJ int instNum = chi("instanceNum"); string instanceBase = chs("instancePathBase"); float random = rand(@ptnum + ch("seed")); float baseRate = 0; for( int i=1; i<=instNum; i++){ baseRate += ch( concat("rate",itoa(i)) ); } float instCurRate = 0; string instancePath; for( int i=1; i<=instNum; i++){ float instRate = ch( concat("rate",itoa(i)) ) / baseRate; if(random > instCurRate && random <= instCurRate + instRate){ instancePath = concat(instanceBase, chs( concat("instancePath",itoa(i)) ) ); } instCurRate += instRate; } s@instance = instancePath; Quote Link to comment Share on other sites More sharing options...
Atom Posted September 6, 2019 Share Posted September 6, 2019 (edited) Here is the basic "fake" stamp that evolved after CopyToPoints nodes was released. If you run it, inside a FOREACH loop, you can reliably fetch attributes from point #0. This image shows the standard point instancing technique, which is faster than the CopyToPoints, fake stamp. The main reason you might still want to use CopyToPoints, is if you are generating geometry that you need to export. ap_fake_stamp_090619.hiplc Edited September 6, 2019 by Atom Quote Link to comment Share on other sites More sharing options...
toadstorm Posted September 6, 2019 Share Posted September 6, 2019 There's no need for any kind of copy stamping or for/each loops for this kind of thing, since the only difference between any of those copied boxes is the transformation matrix. You can pass template point attributes into the Copy SOP that describe the scale of each instance, and Copy does the rest. You can assign the color attribute after the fact; Mantra and Redshift (and probably most other renderers) can read the color attribute from the points and use this to drive the albedo of each instance. In the Mantra shaders this would be done just by enabling "Use Packed Color". instances_no_stamping_toadstorm.hip 4 Quote Link to comment Share on other sites More sharing options...
nicoladanese Posted September 10, 2019 Author Share Posted September 10, 2019 hey all! thanks for all the replies, I'll look into all of them asap, I've been busy trying to get outof a shitstorm of work lately Quote Link to comment Share on other sites More sharing options...
kuzy62 Posted November 21, 2019 Share Posted November 21, 2019 On 9/6/2019 at 5:36 PM, toadstorm said: There's no need for any kind of copy stamping or for/each loops for this kind of thing, since the only difference between any of those copied boxes is the transformation matrix. You can pass template point attributes into the Copy SOP that describe the scale of each instance, and Copy does the rest. You can assign the color attribute after the fact; Mantra and Redshift (and probably most other renderers) can read the color attribute from the points and use this to drive the albedo of each instance. In the Mantra shaders this would be done just by enabling "Use Packed Color". instances_no_stamping_toadstorm.hip Thanks very much for this!!! I have been making those Lee Griggs style images in Cinema 4D and then in Houdini for awhile now...but my system got bogged down with all the geometry very quickly.....I was playing around with this last night and tried to build some stuff myself rather than just copying your file.....I can get it to copy cubes to the grid with no issue at all.....and then I used an attribute from map to color the cubes based on an image file......what I wanted to do is scale the cubes in the y direction based on the color of points on the grid.....I couldn't seem to make it work......any advice would be greatly appreciated!!! Thanks! Quote Link to comment Share on other sites More sharing options...
toadstorm Posted November 21, 2019 Share Posted November 21, 2019 something like this? i'm attaching an example file. also, if you're coming from a C4D background... you might want to try MOPs. it uses a similar flow to Mograph... you could use Falloff from Texture and then the Transform Modifier to scale objects in Y in this particular case. height_from_luma.hip 2 Quote Link to comment Share on other sites More sharing options...
jimeng20 Posted November 21, 2019 Share Posted November 21, 2019 Like what Henry said, you can just use your color as your y scale, if you set your point v@scale = set(1,1+@Cd.y*mult, 1); and when you copy boxes to your point, you can see the scale differences. No stamping, no loops needed. If you wanna control the scale after the copy, you can also packed the copy geo and modify the primtive intrinsic "transform". Quote Link to comment Share on other sites More sharing options...
kuzy62 Posted November 22, 2019 Share Posted November 22, 2019 Thanks very much!!!! That is exactly what I was looking for!!!! Quote Link to comment Share on other sites More sharing options...
nicoladanese Posted November 22, 2019 Author Share Posted November 22, 2019 Hey! I'm glad this thread is still useful! first I want to say thanks to all the guys that came and helped almost 2 months ago. I finally managed to deliver the shots I was working on and I'm really happy with the result! Dan, from my experience I would say that using color to drive Y scale is definitely the smarter way, I mean you paint/import/draw maps in color so you have a visual feedback of what is driving the height of the cubes, than convert color to the scale value as suggested by toadstorm! Purely from an artistic point of view, so very personal, I would suggest to not just use color to drive scale, but experiment with noises and other stuff, in my experience the most successful approach is to extract some features from the color map, and then add more informations to it to make it look more interesting and organic...but again this is very subjective here's an example of my stuff, as you can see you can find some feature of the color in the height map as well, but then I added a lot more informations to make it look more interesting, well at least that was the plan 1 Quote Link to comment Share on other sites More sharing options...
nicoladanese Posted November 22, 2019 Author Share Posted November 22, 2019 ... and this is one of the frame of the final result...roughly 1 billion cubes rendered!!! 3 Quote Link to comment Share on other sites More sharing options...
kuzy62 Posted November 22, 2019 Share Posted November 22, 2019 8 hours ago, nicoladanese said: ... and this is one of the frame of the final result...roughly 1 billion cubes rendered!!! That looks insane!!! How much memory to render 1 billion cubes?? I've got 25 million in a scene and am using almost 15 GB....am I doing something wrong?? Quote Link to comment Share on other sites More sharing options...
nicoladanese Posted November 25, 2019 Author Share Posted November 25, 2019 are you packing when you copy to points? My setup was sort of a matrioska (the russian dolls that gets smaller and smaller) so I packed one tile, then copy the packed tile to more tiles...that kept my memory low! btw the image you see is rendered in 2 layers, foreground and background... Quote Link to comment Share on other sites More sharing options...
kuzy62 Posted November 25, 2019 Share Posted November 25, 2019 3 hours ago, nicoladanese said: are you packing when you copy to points? My setup was sort of a matrioska (the russian dolls that gets smaller and smaller) so I packed one tile, then copy the packed tile to more tiles...that kept my memory low! btw the image you see is rendered in 2 layers, foreground and background... I didn't do it that way....packing first...then copy to points....will give that a try! Thanks! :-) Quote Link to comment Share on other sites More sharing options...
kuzy62 Posted November 26, 2019 Share Posted November 26, 2019 (edited) First try with this technique....9 million cubes......I included the the file.....I think there is more optimization that can be done! 20191120_v2.hip Edited November 26, 2019 by kuzy62 attached file Quote Link to comment Share on other sites More sharing options...
santjaga1975 Posted January 27, 2020 Share Posted January 27, 2020 Hi! How to make the same but not on grid, on sphere for example? Like here? On the sphere we have cilinders, Y height driven by height texture map, (X and Z scales driven manualy), color driven by texture map and appearing driven by texture mask. ? Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.