| Previous Topic (Rendering PRT Loader Objects) | Up (Particle Sources) | Next Topic (Rendering Thinking Particles) |
Rendering Geometry Volumes As Particle Clouds
Available in Krakatoa v1.5.0 and higher
- 1 Rendering Geometry Volumes As Particle Clouds
Introduction
- Krakatoa has the ability to render any geometry volume by filling it with particles on-the-fly.
- The special PRT Volume object can be used to convert exactly one geometry object into a particle cloud at render time.
- The PRT Volume provides separate set of parameters for previewing the conversion in the 3ds Max Viewports.
- Just like the PRT Loader object, the PRT Volume object also supports Krakatoa Channel Modifiers and 3ds Max Deformation Modifiers.
Workflows Overview
- A dedicated Krakatoa PRT Volume object can be created and pointed at a geometry object to fill the latter with particles.
- The PRT Volume object can be transformed independently from the source - it acquires the volume data in local space of the source and ignores its transformations.
- To keep the PRT Volume aligned to the source, you can parent it (link it) to the source.
- The source option "PRT Volumes" in the Krakatoa Main Controls rollout can be used to enable/disable the rendering of the PRT Volume objects.
- The generated particles can be saved to particle files to be used as input in PRT Loaders or Krakatoa PRT Loader Birth and Krakatoa PRT Loader Update PFlow operators. In other words, the PRT Volume can be used to quickly turn geometry objects into particle clouds, since the alternatives (Position Object>Volume, the various Culling methods etc.) are generally slower.
- The resulting cloud can be rendered in Krakatoa as either particles or voxels. Note that while the voxel size of the renderer is fixed, the Spacing option of the PRT Volume object can vary per object and can even be animated over time for advanced effects. For best results, the Spacing should be equal to or less than the rendering Voxel Size.
Creating PRT Volume Objects
- There are several ways to create a PRT Volume object:
Command Pannel > Create Tab
- To create a PRT Volume Object by hand,
- Switch the Command Panel to Create mode
- Select Geometry icon
- Select "Krakatoa" category from the drop-down list
- Click the "PRT Volume" button to enter Creation Mode
- Click once in the viewport to create a PRT Volume object with pivot at the clicked point
- Switch the Command Panel to Modify mode
- Use the "Volume Object:None" pickbutton to select a geometry or spline object as the volume source
Main Menu > Krakatoa Menu
- If the Krakatoa Menu in the Main Menu is enabled (default),
- Select one or more geometry objects in the scene
- Select the menu option "Create PRT Volume(s) from selected Object(s) - Hold SHIFT to create manually" from the Krakatoa menu to create one PRT Volume object for each selected geometry object.
- If you press and hold SHIFT while selecting the menu item, the selected objects will be ignored and the Command Panel will enter PRT Volume creation mode as described above - click in the viewport to define the pivot point of the PRT Volume.
Toolbar > VOL icon
- If you have customized a toolbar as described here,
- Select one or more geometry objects in the scene
- Click the VOL icon on the toolbar to create one PRT Volume object for every selected geometry object.
- Alternatively, if you press and hold the SHIFT key while clicking the VOL icon, the selected objects will be ignored and the Command Panel will enter PRT Volume creation mode as described above - click in the viewport to define the pivot point of the PRT Volume.
Example
The following example shows the Stanford University Happy Buddha mesh containing 1 million polygons converted to a PRT Volume with 2.8M points.
- In the first image, the original mesh is shown in the viewport.
- In the second image, the volume was rendered as Particles illuminated by 2 spot lights (10.766 sec. incl. 2.266 sec. particle generation)
- In the third image, the volume was rendered as Voxels. (14.25 sec. incl. 1.625 sec. particle generation)
- In the forth image, the particles acquired normals from the volume and were shaded using Phong Shading with Environment Reflections on. (19.485 sec, incl. 6.862 sec. particle generation with Normals acquisition)
Technical Details
- The PRT Volume conversion turns the source geometry into a Level Set internally.
- Then, one or more particles are created inside every populated voxel, as long as the particle is inside the mesh.
- The distance of the particle to the closest point on the surface will be stored in the SignedDistance channel with negative sign (negative sign means "inside").
- The Normals and any Mapping Coordinates are taken from the data stored in the Voxels by the Level Set conversion.
- The surface data is interpolated throughout the volume, so that 2D texture coordinates and normals blend smoothly.
NOTE that Velocity data is NOT acquired from the surface. Thus, deforming meshes will not transfer their velocities to the particles in the volume and the built-in Krakatoa Motion Blur will not produce any blur of the particles. You can use 3ds Max Multi-Pass Motion Blur to sample the mesh multiple times and get particles appearing/disappearing as the mesh changes.
- Openings in the mesh or Slice modifier cuts through the mesh even without any Cap Holes after that usually result in solid volumes with few artifacts. The following examples show the same teapot rendered as full volume and then sliced in half using a Slice modifier, showing the distribution of UV coordinates inside the volume:
- When the Shell option is enabled, only particles within a specified range measured from the surface of the object will be created. The following examples show the same teapot as above but set to thickness equal to one voxel width and 5 voxel widths:
- The Normal acquisition via the PRT Volume is generally faster than the Normals acquisition via the PRT Loader's culling surface option, but the Level Set might appear faceted when using large polygons like a low-resolution teapot. The PRT Volume conversion scales really well with increasing mesh complexity, so increasing the polygon count procedurally or using TurboSmooth is a valid approach for smoothing out the normals. The following examples show the same teapot with 4 and 32 segments filled with Spacing set to 0.5:
- If filling a volume with large flat sides and sharp corners like a box, the edges will appear rounded with the radius depending on the voxel size (Particle Spacing). The follwing examples show the same box filled at Spacing settings of 1.0 and 0.2:
- When perfectly smooth normals from the surface are required, acquiring normals using the PRT Loader's culling surface or the Krakatoa Geometry Lookup Particle Flow Operator might be a slower but better alternative. This method is not recommended for box-like objects though.
Filling Partially Open Objects
- The PRT Volume object does not require the geometry of the object to be fully closed (as seen from the Teapot which is rather leaky).
- In fact, the PRT Volume object can work even with fully open surfaces, including a Plane!
- The raytracing algorithm used to convert the geometry to a Level Set takes the bounding box of the object plus a bit of a safety region as the limit of what can contain geometry, thus if the geometry is open and cannot be filled correctly within the mesh, in the worst case the particles will leak out until they reach the end of the object's bounding box.
- For example, here is a plane primitive in the XY ground plane converted to a PRT Volume (moved next to it).
- If we would rotate the Plane object at 45 degrees, the PRT Volume would stay the same because it uses the Object Space mesh!
- If we would add an XForm modifier to the Plane and rotate its Mesh at 45 degrees, the PRT Volume would follow. Since the plane is not a closed volume, the whole volume below the plane will be filled with particles:
- Rotating the XForm Gizmo to 90 degrees results in a vertical plane of particles.
- We continue rotating the XForm Gizmo to 135 and 180 degrees and get similar results on the other side of the "bounding box" of the plane:
- Given that an plane is probably the worst case of an open object, we can be sure that the PRT Volume object will do its best to generate particles even where the geometry is less than perfectly closed.
Filling Spline Shapes
- The PRT Volume object can use Spline Shapes as the geometry source.
- By default, when the Enable In Renderer / Enable In Viewport options are not checked, the shape will be converted internally to an Editable Mesh first, then the resulting mesh will be filled.
- This means that closed shapes will be typically converted to a valid mesh and will produce results similar to the Partially Open Objects example above.
- Open shapes will typically generate no valid mesh and will not produce a valid volume.
- If the Enable In Renderer / Enable In Viewport options are checked, the resulting renderable spline geometry will be acquired as the volume to fill and will produce particles inside the render mesh.
- In the examples below,
- An Ellipse Shape has been created and picked as the PRT Volume Source (left)
- The Enable In Viewport option was checked to generate a Renderable Spline mesh (right)
- In the following two examples,
- An Edit Spline modifier was added to the Ellipse and a segment was deleted, resulting in an open shape that cannot be meshed (left)
- A Renderable Spline modifier was added to the stack to generate a Renderable Spline mesh again (right)
Vertex Color Acquisition
- Since the PRT Volume will acquire the Vertex Color Channel from the source geometry into the Color channel of the particles, painting Vertex Colors on the source geometry using the VertexPaint modifier will propagate instantaneously to the PRT Volume particles.
- For example, let's create a GeoSphere and a PRT Volume out of it.
- If we would add a VertexPaint modifier to the GeoSphere, the PRT Volume will turn white (due to the default Vertex Color Channel).
- In the VertexPaint modifier, we can set the paint color to dark blur and use the Bucket icon to floodfill the Vertex Color Channel with that color.
- Then we can set the paint color to yellow and start painting with the Brush on the GeoSphere - the PRT Volume will update interactively (this of course depends on the complexity of the mesh and the number of particles generated).
Selection Channel Acquisition
Available in Krakatoa v1.6.0 and higher
- The PRT Volume can acquire the Vertex Selection of the Volume Object provided the Vertex Selection is active on top of the stack.
- Unfortunately, this is not as easy as selecting some vertices because if the Vertex Sub-Object mode is turned off to get out of the selection, the PRT Volume will stop seeing it.
- To solve this problem, a TurnToMesh Modifier set to output the Vertex sub-object selection must be added to the source geometry.
- The PRT Volume provides a menu item in its options menu called "Inherit Volume Object Vertex Selection Via Modifier" to add the TurnToMesh modifier with the right settings.
- In the following example,
- A MeshSelect modifier was added to the Geosphere used as Volume Object source by the PRT Volume.
- A vertex selection was made and Soft-Selection was enabled
- A TurnToMesh modifier was added to the Volume Object to propagate the vertex selection into the particles' Selection Channel.
- A Krakatoa Channels Modifier with Selection Channel Input -> ToVector Operator -> Color Channel Output was added to display the selection as white and the lack of selection as black with gray in the areas of soft-selection (left image)
- Adding an XForm Modifier to the PRT Volume and scaling its Gizmo at sub-object level takes the particle selection channel into account and affects the particles according to their soft-selection value (right image):
Legacy Particles As PRT Volumes
- All Legacy Particle Systems support the PRT Volume object.
- The following example shows a simple SuperSpray in Metaball mesh mode:
- The SuperSpray as seen in the viewport:
- The SuperSpray rendered as Particles with PRT Volume and Phong Shading:
- The SuperSpray rendered as Voxels (0.5/2) with PRT Volume and Phong Shading:
- The SuperSpray rendered as Voxels (0.5/2) with PRT Volume and Isotropic Shading:
Particle Flows As PRT Volumes
- Particle Flow systems cannot be converted directly to PRT Volumes.
- An intermediate Mesher Compound Object is required to turn the PFlow into a Mesh.
- Then the Mesher can be picked by the PRT Volume to fill with particles.
See the topic Creating Thick Smoke Using Particle Flow, Mesher and PRT Volume for a detailed example.
Thinking Particles As PRT Volumes
- The PRT Volume object can use the Thinking Particles object as the source.
- As result, the Mesh Shapes of the particles will be filled with particles.
- The following screenshot shows a simple TP system with only 25 particles using an instanced Sphere mesh in the 3ds Max viewport:
- If rendered as points, only 25 particles will be drawn:
- Creating a PRT Volume object with Spacing of 0.5 and selecting the TP object produces 1,586,359 particles:
- Here are the same 1.5 M particles rendered as voxels with size 0.5 and Filter of 2:
- Of course, the Shell feature is also supported. Here is a rendering with voxel size 0.5 with Filter of 2 and Shell of 0.0/1.0: