I can render hundreds of millions of points in Mantra if I set them to be Rendered As Points (Render>Geometry tab). However, I can't render delayed procedulars or packed primitives.
I am asking, because instead of default spheres I am trying to render them as cubes.
Best,
Daniel
How Render As Points in Mantra works? How come it is so fast?
3529 5 3- dankray
- Member
- 82 posts
- Joined: March 2017
- Offline
- neil_math_comp
- Member
- 1743 posts
- Joined: March 2012
- Offline
For rendering points as spheres, they only have a position and a radius. If there's any displacement shading or anything else fancy on them, the memory and time go way up. Packed primitives each have at least a double-precision, 4x4 matrix for the transform, the same for the inverse transform, a bounding box, possible material assignments, etc, so they take more memory and time.
If you want a very large number of things that are fairly similar, one trick is to batch them. For example, you could have 100 different arrangements of 100 boxes, each with 10000 packed primitives referencing it, for a total of 100,000,000 boxes, but only 10,000 packed primitives and 100 unique details being referenced by them. I managed to do a render of 1 trillion boxes once by putting 1 million boxes in a detail, then having 1 million packed primitives referencing that one detail.
If you want a very large number of things that are fairly similar, one trick is to batch them. For example, you could have 100 different arrangements of 100 boxes, each with 10000 packed primitives referencing it, for a total of 100,000,000 boxes, but only 10,000 packed primitives and 100 unique details being referenced by them. I managed to do a render of 1 trillion boxes once by putting 1 million boxes in a detail, then having 1 million packed primitives referencing that one detail.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- dankray
- Member
- 82 posts
- Joined: March 2017
- Offline
Thank you ndickson for your quick reply. That does make sense and it sounds very intriguing to hear that you managed to achieve such a big number of instances. Do you think that you might reference any tutorials for creating such batching?
Otherwise, I was wondering if you are aware of any way to “add” a third option to Geometry>Render Points as (vm_renderpoints)? Perhaps through HDK as a plugin?
My points change on every frame drastically, so I am looking for a good way to automate such batching.
Otherwise, I was wondering if you are aware of any way to “add” a third option to Geometry>Render Points as (vm_renderpoints)? Perhaps through HDK as a plugin?
My points change on every frame drastically, so I am looking for a good way to automate such batching.
Edited by dankray - Feb. 2, 2018 04:53:44
- tamte
- Member
- 8619 posts
- Joined: July 2007
- Offline
- dankray
- Member
- 82 posts
- Joined: March 2017
- Offline
- howiem
- Member
- 146 posts
- Joined: Sept. 2011
- Offline
Man, looking at those images, you've got a lot of points there, huh Looks like a point cloud from a LIDAR scan.
The techniques ndickson was talking about are grand if you're repeated structures going on, but I'm guessing you haven't built your scene up from smaller components.
There are soooo many points in your scene though that any sort of instancing is going to eat memory. But how many are actually going to be close enough for you to see they're boxes and not spheres? I can only guess at the shot you're after, but I'd be tempted to group only those points within a certain distance of the camera, and only instance boxes onto them, leaving the rest to be rendered as spheres or discs.
Level of detail stuff, innit.
Quick example attached of grouping points by distance from camera. I'm grouping by Bounding Sphere, and to tie the centre of the sphere to the camera, right-click the “Center” parameter, and choose Reference -> Scene Data, then drill down into the camera til you reach it's World translation. Houdini fills in the zany expression you need automatically
Move the camera around and the point colours will change automatically. You can object merge either the near or far ones into a new object (or instance object) as appropriate
The techniques ndickson was talking about are grand if you're repeated structures going on, but I'm guessing you haven't built your scene up from smaller components.
There are soooo many points in your scene though that any sort of instancing is going to eat memory. But how many are actually going to be close enough for you to see they're boxes and not spheres? I can only guess at the shot you're after, but I'd be tempted to group only those points within a certain distance of the camera, and only instance boxes onto them, leaving the rest to be rendered as spheres or discs.
Level of detail stuff, innit.
Quick example attached of grouping points by distance from camera. I'm grouping by Bounding Sphere, and to tie the centre of the sphere to the camera, right-click the “Center” parameter, and choose Reference -> Scene Data, then drill down into the camera til you reach it's World translation. Houdini fills in the zany expression you need automatically
Move the camera around and the point colours will change automatically. You can object merge either the near or far ones into a new object (or instance object) as appropriate
Edited by howiem - Feb. 1, 2018 08:17:57
-
- Quick Links