Krakatoa Particle Channels¶
Overview¶
- Krakatoa uses particle file formats which support arbitrary channels.
- Some of the file formats allow for completely arbitrary channel names, but Krakatoa follows some conventions for channel names.
- This affects the usage of both PRT Files and CSV Files.
- BIN Files use a predefined mapping between Krakatoa conventions and the channels provided within that file format.
- Channel names are treated as Case Sensitive within Krakatoa.
Channel Data Type¶
- An individual particle channel can be any data type from the following types
- float16, float32, float64
- int8, int16, int32, int64
- uint8, uint16, uint32, uint64
- Each channel also has an arity, which is how many of the above types it has in a row. Krakatoa uses 3 floats, or a float32[3] channel for Position, and in most cases a float16[3] channel for color types.
Channel Naming Conventions¶
- For channel names, Krakatoa uses a CamelCase convention, starting with a capital letter.
- A channel name must start with a letter or ‘_’ character, and must be made up entirely of numbers, letters, and ‘_’ characters.
- Here are some channel conventions which Krakatoa uses.
- Most channels which are indicated as float32 could also be stored in memory or on disk as float16 to save space.
- This depends on whether the quantization of fitting it into a 16 bit floating point is acceptable.
- For colors, velocities, and densities, this is usually acceptable, but for position this generally is not.
The following channel names are recognized by Krakatoa when rendering particles:
Channel Name | Data Type | Comments |
---|---|---|
Position | float32[3] |
|
Velocity | float32[3] |
|
Normal | float32[3] |
|
Density | float32 |
|
Color | float32[3] |
|
Emission | float32[3] |
|
Absorption | float32[3] |
|
The following channel names are typically used by Krakatoa when saving and loading PRT files, but are not directly used by the renderer
Channel Name | Data Type | Comments |
---|---|---|
TextureCoord | float32[3] |
|
Mapping2 Mapping3, etc. | float32[3] |
|
Acceleration | float32[3] |
|
Orientation | float32[4] |
|
Spin | float32[4] |
|
MXSFloat | float32 |
|
MXSVector | float32[3] |
|
ID | int32 |
|
Using Channels In Krakatoa MX¶
- Most of the channels described above have a very specific function - Position controls the placement of the particles, Velocity controls their speed and so on.
- When defining the Color and Density of the Particles though, the Color and Density channels are NOT the only possible Data Channels that could be used to control the rendering of the particles.
- 3ds Max supports 100 mapping channels.
- Channel 0 is used exclusively for Vertex Color data and Krakatoa converts automatically between it and the Krakatoa Color channel.
- Channel 1 is assumed to be for Texture Coordinates (because 3ds Max 1.0 had only one texture coordinates channel, Krakatoa calls it explicitly TextureCoord).
- Channels 2 to 99 were introduced in 3ds Max 3.0 and can contain arbitrary float32[3] data including texture coordinates, colors etc.
- 3ds Max provides a dedicated Vertex Color Map procedural texture which can read the data from any of the 100 channels and convert it to an RGB color.
- This implies that you can store multiple color data channels in a particle file and then mix them at render time using Vertex Color Maps as loaders and any blending maps like RGB Multiply, RGB Tint, Blend, Mask, Composite etc. to define the final color or a particle.
- These maps can also be mixed, blended with and controlled by any other 3ds Max maps for even more advanced results.
- Since Krakatoa allows you to use the Opacity channel of a material to modulate the Density of a particle, this also implies that the RGB value of any of the 100 Mapping channels (or a combination thereof) could be used via Vertex Color Maps in the Opacity Map slot of a Standard Material applied to a PRT Loader to define the Density of the particles in addition to the dedicated Density channel.
- Note that the evaluation of the particle color will be slower when using Vertex Color Maps in a Material compared to simply loading a Color channel from a particle file, but the flexibility is worth the time penalty.
- Also, in Krakatoa v1.5 and higher, the evaluation of the mapping is multi-threaded and significantly faster than in v.1.1.x.