generate millions particles at rendertime

   14937   8   8
User Avatar
Member
3 posts
Joined: Sept. 2013
Offline
Hi!
Do you know a method to generate millions of particles at rendertime given a low number of particles? what I mean is trying to duplicate particles or make others particles that follow the motion of surrounding particles, but without display them in viewport, and generate only at rendertime. much like krakatoa, but in houdini.

I have looked into clusterThis, but there is currently no version for H12.5.


Mike
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Two ways:

In SOPs you can use the Point Replicate SOP to take your tens or hundred of thousands of particles and turn it in to hundreds of thousands or tens of millions. It's surprising how efficient this SOP is and it is all visible in the viewport. There are some nice options such as velocity scaling if you have a vel field around.
Don't forget to turn the display of points to pixels as this is a bit more efficient in the viewport in the viewport Display Options. Just try. Push it in the viewport. Heck it's better to stay WISYWIG as far as you can in to the process. This is Houdini after all.

Then there is the Point Replicate Mantra Procedural for render time point multiplication. Just add it to SHOPs along with a CVEX SHOP with the replicate logic then on the object, point it at the Point Replicate Mantra Procedural SHOP. You can add attributes to your point cloud to multiply the number of points set on the procedural.

I attached an example file that has a CVEX shader that replicates the Point Replicate SOP.


The two go hand in hand. I like to bump up the point count with the Point Replicate SOP. First work on a subset of the points. If I really want a lot of particles I will take it up to as high as I can here, sometimes in the tens of millions but do it with a ROP Geometry SOP to write it out so I don't get viewport updates.

Then use the Point Replicate Procedural to take the large point cloud and add another 10x to 100x multiplier to bump it up to hundreds of millions.

Raytracing or PBR
To get an efficient render, make sure to set the Object to render geometry as points.
If you want to use geometric normals to get proper shading for disintegrating geometry effect, enable this under the Render as points options. Now your point normals will affect the shading and reflections.

Make sure to use a basic raytrace shader with basic diffuse and specular scattering.

Try the full opacity = 1 and make them small (pscale) and add as many as you can.
If you do want opacity, not an issue. Ensure to keep Stochastic Transparency (only works with raytracing and PBR) on and up the transparent samples in the Mantra ROP. With this you can use raytrace or PBR.

Micropolygon
Some may recommend using Micropolygon rendering for massive amounts of points and that is an excellent choice. With the Render As Points option on the object, you only shade a single point so it stays light and fast. Unlike raytracing and PBR, if there is no reflection of objects or no raytracing, only the points in the current bucket are loaded in, shaded and rendered then unloaded when Mantra finishes a row of buckets or when the memory limit threshold is reached.

Watch out for opacity though. Again keep the opacity up (try 0.1 up to 1 but go as low as you want) and do the more is better approach.

As with Raytracing, enable the shading normal on the object to do the disintegration effect.


Other Effects
Some other things…

To render points as volumes, you can use the Mantra Volume procedural and a cvex context to shade the points as volume density for very efficient renders. Ask if you want an example plus there are a few kicking around on OdForce for volume rendering.

To do colour accumulation type effects, you can craft a shader that does this. You can even use a Point Cloud approach to load in the neighbouring points to get even more control over how the colour accumulates to get nice organic brightening of regions.

Attachments:
repligrid.hip (1.5 MB)
point_replicate_sample.hip (1.1 MB)

There's at least one school like the old school!
User Avatar
Member
3 posts
Joined: Sept. 2013
Offline
Thanks Jeff! Really good answer! I will look into this.
User Avatar
Member
122 posts
Joined: Aug. 2013
Offline
hellou.
particles made using sop solver could be a good choiice too.
User Avatar
Member
3 posts
Joined: Sept. 2013
Offline
I've tested a bit now. I found that it takes a pretty long time to generate the particles at rendertime, it takes about 30 min before the render starts, and it is only one thread working. is there something I can do to keep the render/generation-time down, except decreasing particle count?
User Avatar
Member
37 posts
Joined: Oct. 2009
Offline
The point replicate procedural is a great tool, it would be great to get it multi-threaded in H13 and get the huge increase in speed when generating massive amounts of particles.
User Avatar
Member
373 posts
Joined: March 2009
Offline
Just for the record, Krakatoa does not do point count multiplication at rendertime. For the most part, it relies on wedges (partitioning in Krakatoa) and delayed-load rendering of the point clouds. In max, they have a few tools and methods of generating additional points from existing points, very similar to the point replicate, but you usually either copy the object (prt loader), and modify point positions (then render them all together) in the max scene, or you modify and write out new partitions, and render those together with the original ones.
Ian Farnsworth
User Avatar
Member
1743 posts
Joined: March 2012
Offline
When you profile it with the Performance Monitor, what node(s) inside of the Point Replicate are taking up most of the time? It might (or might not) be easy to do a quick optimization if it's something simple that's taking up the time. (Edit: Actually, I have no idea if the Performance Monitor even supports profiling procedurals at all. Does it? I was talking about the Point Replicate SOP.)
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
237 posts
Joined: July 2005
Offline
repligrid.hip

I was hopeing to learn a thing or two from this file but get an error when rendering in H13.0

mantra: Error initializing procedural ‘ptreplicate’ on object /obj/grid_object1

EDIT: not working on houdini 13.0.260 in windows, is working in H13.0.288
Robert Kelly
  • Quick Links