Memory Channels Rollout¶
Available in Krakatoa v1.1.0 and higher

Particle Channels To Load Into Memory¶
Available in: Krakatoa v1.1.0 and higher.
- Prior to version 1.1.0, Krakatoa used a fixed set of channels when rendering particles: Position, Velocity, Color, Density, Normal and Lighting. The total number of bytes a particle would require when loaded into memory was thus fixed at 38.
- Starting with version 1.1.0, the internal memory organization has been enhanced to take advantage of the named channels system already used for saving particles to disk. Most channels can now be allocated only when required by a specific feature of Krakatoa and the precision (number of bytes per component) can be customized by the user.
- Version 1.5.0 introduces a number of additional channels allowing for Emission and Absorption calculations during rendering as well as per-particle Specular Power (Glossiness), Specular Level and Phase Eccentricity control.
- The following channels can be allocated by the Krakatoa renderer:
- Position Channel - this channel is always allocated and has a fixed float32[3] type. It is used to store the particle positions in world space.
- Velocity Channel - this channel is only needed to interpolate particle positions for motion blur, so it will be allocated only if the >Enable Motion Blur option is checked.
- Color Channel - this channel is usually allocated and stores the particle color taken either from the source’s wireframe color, the shading color evaluated from the source’s material or an explicit value taken from a particle sequence file.
- In versions prior to 1.5.0, when the >Override Particle Colors option was checked and the drop-down list was set to Custom Particle Color, the color was constant for all particles in memory, thus allocating a channel would have meant wasting at least 6 bytes per particle. Instead of storing the same color in the Color channel, it would be taken from the Custom Particle Color swatch directly.
- In Krakatoa v1.5.0 and higher, the Color Channel will be allocated in all cases, since the Override Particle Colors mode also supports mapping and the color can thus vary from particle to particle.
- Density Channel - this channel is always allocated and can have a user-defined precision. It is used to store the particle density. If a particle source does not provide an explicit density value, the value of 1.0 is used as default.
- Lighting Channel - this channel is allocated when the >Ignore Scene Lights option is unchecked. It stores the color value of the particle after the lighting calculations.
- The content of this channel can be frozen and reused by enabling the LCache (Lighting Cache) option, otherwise it will be recalculated on each render iteration.
- The content of this channel can also be saved to the Emission channel of a PRT sequence and reloaded and manipulated via KCMs for relighting operations.
- Emission Channel - this channel is allocated when the >Use Emission option is checked in the Main Controls rollout.
- Absorption Channel - this channel is allocated when the >Use Absorption option is checked in the Main Controls rollout.
- Normal Channel - this channel is allocated when the Phase Function is set to Phong Surface mode or the >Use Environment Reflections option is checked. It will contain the particle’s normal vector. The normal is taken from the surface normal when rendering geometry vertices as particles, from the X axis of the particle’s transformation matrix in the case of 3ds Max particle systems or from the Normals channel when loading a particle sequence from disk. If a file sequence does not provide a Normals channel, the default value will be [0,0,0] causing particles to render black. The channel could also be set using a KCM.
- MBlurTime Channel - this channel is used to store the particle’s motion blur time when performing Jittered Motion Blur. While it adds 2 or 4 bytes per particle, it allows the rendering pass to use the same faster sorting and particle access methods as the lighting pass and thus speeds up rendering significantly. In Krakatoa v1.0.1 and earlier, the render pass always used Indexed Sort and thus Indexed data access which is inherently slower.
- SpecularPower Channel - this channel is allocated only when the Phase Function is set to Phong Surface mode and the >Per-particle [SpecularPower] Channel option is checked in the Shader Parameters rollout.
- SpecularLevel Channel - this channel is allocated only when the Phase Function is set to Phong Surface mode and the >Per-particle [SpecularLevel] Channel option is checked in the Shader Parameters rollout.
- Eccentricity Channel - this channel is allocated only when the Phase Function is set to Henyey-Greenstein or Schlick mode and the >Per-particle [Eccentricity] Channel option is checked in the Shader Parameters rollout.
The following table gives a quick overview of the Memory Channels:
Channel Name | Notes | Formats | Default=Bytes |
---|---|---|---|
Position Channel | Always allocated | float32[3] | float32[3]=12 |
Color Channel | Always allocated | float16[3]|float32[3] | float16[3]=6 |
Density Channel | Always allocated | float16|float32 | float16=2 |
Lighting Channel | Allocated if >Ignore Scene Lights is off | float16[3]|float32[3] | float16[3]=6 |
Velocity Channel | Allocated only if >Enable Motion Blur is on | float16[3]|float32[3] | float16[3]=6 |
Emission Channel | Allocated only if >Use Emission is on | float16[3]|float32[3] | float16[3]=6 |
Absorption Channel | Allocated only if >Use Absorption is on | float16[3]|float32[3] | float16[3]=6 |
Normal Channel | Allocated if Phong Surface shading or Env.Reflections are on | float16[3]|float32[3] | float16[3]=6 |
MBlurTime Channel | Allocated only if both >Use Motion Blur and >Jittered Motion Blur are on | float16|float32 | float16=2 |
SpecularPower Channel | Allocated only if >Per-particle [SpecularPower] Channel is checked | float16|float32 | float16=2 |
SpecularLevel Channel | Allocated only if >Per-particle [SpecularLevel] Channel is checked | float16|float32 | float16=2 |
Eccentricity Channel | Allocated only if >Per-particle [Eccentricity] Channel is checked | float16|float32 | float16=2 |
- The buttons between the two list boxes can be used to change the depth of one or more channels (except for the Position channel which is currently hard-coded to 32 bits per component) in either list to the given number of bits per component:
- 16 - sets each component of the selected channels to 16 bits (2 bytes), thus a Velocity, Normal, Lighting or Color channel would store 3*2 = 6 bytes and the Density channel would store 2 bytes.
- 32 - sets each component of the selected channels to 32 bits (4 bytes), thus a Velocity, Normal, Lighting or Color channel would store 3*4 = 12 bytes and the Density channel would store 4 bytes.
- The + and – signs in front of the Channels represent their state in the Particle Cache.
- When a particle channel has been allocated and the data has been cached, the channel will show a plus sign.
- When a particle channel has not been loaded yet, it will have the minus sign.
- If all channels on the right list have their status set to +, the cache is valid and will be used if the Particle Cache is engaged. (the cache indicator will be green)
- If at least one channel on the right list has its status set to –, the cache will require rebuilding (the cache indicator will be yellow)
- The line underneath the channel lists will display the number of particles (in Millions) currently loaded in the cache and the amount of memory (in Megabytes) they occupy.
Cache Information¶
- This group of controls provides information about
- The on/off status of the Particle and Lighting Caches
- The number of particles currently in memory
- The amount of memory used by these particles in Megabytes
- The cache validity status - this is an extended version of the cache indicator found in the Main Controls rollout and features a text description of the status in addition to the color signal.
Suggested Initial Memory When Final Particle Count Cannot Be Determined¶
Available in: Krakatoa v1.6.0 and higher

- Before Krakatoa loads particles into memory, it queries the particle counts from all enabled sources scheduled to be rendered.
- It accumulates the particle counts reported by each source and then allocates memory for a particle stream of that size.
- In some cases though, the particle source is unable to report the expected number of particles because it does not know it it.
- One example of this is a PRT Loader containing at least one CSV file. CSV files have no particle count hint and thus the particle count is not known until the particles are actually loaded.
- Another case is the PRT Volume which doesn’t report the expected particle count (this might change in the future).
- In these cases, the memory allocated for the particle stream can turn out to be less than needed, but allocating additional memory causes a considerable performance hit.
- Thus, to ensure that enough memory is allocated before rendering, the >Pre-Allocate Memory option and the corresponding spinner can be used to specify the particle count in Million Particles to be expected when the final particle count cannot be determined for some reason.
Pre-Allocate Memory checkbutton¶
- When this option is unchecked (factory default), the memory will be allocated automatically and will be expanded as needed.
- This can lead to slower performance when rendering PRT Volume and CSV file particles, but will only use as much memory as needed.
- When this option is checked and the particle count cannot be determined for the above-mentioned reasons, the memory specified by the spinner will be allocated.
- This can lead to more memory being used than needed (for example, if memory was reserved for 50 million particles but only 10 million were actually loaded, memory for 40 million particles was in fact wasted).
- On the positive side, on 64 bit machines with enough RAM, being able to pre-allocate a single chunk of memory before rendering can result in significant speed up when rendering PRT Volumes (CSV files are slow by nature and might not see that much of a speedup).
- The default state of this option can be set as usual by right-clicking the checkbutton and selecting to store the current state as statup default.
- Below is a comparison of Krakatoa v.1.5.1 loading a PRT Volume object with various particle counts vs. Krakatoa v1.5.2 using Memory Pre-Allocation for 50 million particles:

- The time to load 50 million particles was reduced from over 11 minutes to 17.5 seconds, or more than 38 times.
Milltion Particles spinner¶
- As described above, this spinner defines the number of particles in millions to allocate memory for.
- The actual amount of memory to be allocated will depend on the Memory Channels currently requested by various features.
- You can use the Particle Count/Memory Calculator described further on this page to set the particle count based on a given memory amount, or find out how much memory will be used for the given number of particles.
- The default particle count can be set using the >> Presets menu next to the spinner.
- The >> Presets menu also provides an option to “Copy N to Calculator” where N is the current value in the spinner.
- When selected, the number entered in the spinner will be copied to the particle count spinner of the Calculator and the MB Memory spinner of the calculator will display the actual amount of memory that will be pre-allocated.
- Similarly, you can enter the amount of memory you want to pre-allocate in the MB Memory spinner, then use the >> Presets menu of the Calculator’s particle count spinner to copy the resulting particle count to the Million Particles spinner of the Pre-Allocate group of controls.
Particle Count / Memory Calculator¶
Available in: Krakatoa v1.1.0 and higher.

- The Calculator provides two value fields which are interconnected two-ways using the Bytes/Particle value displayed in the Particle Channels To Load Into Memory group of controls. It can be used to determine how much RAM would be required to load a specific number of particles or how many particles would fit in a given amount of memory.
- The Particle Count value is in Million particles, thus entering 1.2345 will be interpreted as 1,234,500 particles. Entering a value or spinning the arrows will automatically update the Memory value to show the Megabytes required by this number of particles using the current active memory channels.
- The Memory value is in Megabytes (1024*1024 bytes), thus entering 2048 will be interpreted as 2GB of RAM. Entering a value or spinning the arrows will automatically update the Particle Count value to show how many particles would fit in this amount of memory using the current active memory channels.
- Changing settings that affect the active channels including toggling Motion Blur, Use Lighting and Use Normals options on and off or changing the channel depth of one or more channels between 16 and 32 bits will update the Memory value while keeping the Particle Count constant.
- Left-clicking or right-clicking the [>>] buttons next to the value fields will open context menus providing a range of useful presets.
- Select a value from the presets list to load into the corresponding value field.
- Enter a value not on the presets list and select Add from the context menu to add to the list.
- Enter a value that is already on the list and select Remove to remove from the list.