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]
  • Particle Position. Saved in generic scene units.
Velocity float32[3]
  • Particle Velocity. Saved in generic scene units per second.
Normal float32[3]
  • Particle Normal. Saved in generic scene units (not necessarily unit length).
  • Usually acquired by the Krakatoa PRT Surface and PRT Volume objects.
  • 3ds Max: Automatically converted from the Particle Flow particle transform’s X axis.
Density float32
  • Particle Density.
Color float32[3]
  • Particle Color.
  • 3ds Max: This is converted to/from map channel 0 (vertex color) or from the material Diffuse Color where appropriate.
  • Maya: This is converted to/from rgbPP where appropriate.
Emission float32[3]
  • Particle Self-Illumination Color.
  • 3ds Max: This is converted from material Self-Illumination channel where appropriate.
  • Maya: This is converted from incandescencePP where appropriate.
Absorption float32[3]
  • Particle Absorption Color.
  • 3ds Max: This is converted from material Filter channel where appropriate.
  • Maya: This is converted to/from incandescencePP where appropriate.

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]
  • Texture Coordinates.
  • This is converted to/from 3ds Max map channel 1 (UVW) where appropriate.
Mapping2 Mapping3, etc. float32[3]
  • Coordinate Mappings.
  • 3ds Max: These channels are converted to/from the 3ds Max map channels 2 to 99 where appropriate.
Acceleration float32[3]
  • Particle Acceleration. Saved in generic scene units per second squared
Orientation float32[4]
  • Particle Orientation. This is a quaternion representing the orientation of the particle.
  • 3ds Max: This is converted to/from the Orientation channel of Particle Flow, Thinking Particles etc. where appropriate.
Spin float32[4]
  • Particle Spin. This is an angle/axis value, representing the axis and angular velocity of the particle.
  • 3ds Max: This is converted to/from the Spin channel of Particle Flow where appropriate.
MXSFloat float32
  • Particle Flow MAXScript Float.
MXSVector float32[3]
  • Particle Flow MAXScript Vector.
ID int32
  • Particle Birth ID.

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.