After an internal discussion, we feel that we should provide in Krakatoa SR some form of generalized channel operations to cover at least the basics of what Magma can be used for in Krakatoa MX, or mimic some of the above-mentioned Max-specific features.
These operations are:
*Default channel value
*Override channel value
*Copy channel value
*Scale channel value
Default channel value: Normally, when a an external particle stream is missing a channel, Krakatoa assumes a reasonable factory default value. For example, if no Color channel is provided, the default would be [1,1,1]. If no Density is found, the default is 1.0. For Velocity it is [0,0,0] and so on.
The new option would allow you to specify a different default value for the following particle stream(s) than the factory default. We have a special operation right now for providing a default color, but in the future this would be generalized to specify the default for any named channel, so you could make particles without default Velocity default to [0,0,1] instead of [0,0,0] for example.
Override channel value: This would allow you to specify a new value for the incoming particles in the current and nested scopes even if the channel already exists. Right now we provide dedicated Color, Emission and Absorption overrides, the new generalized operation would apply to any arbitrary named channel, including Density (which was the original topic )
Copy channel value: This would allow you to copy the content of one channel into another. This can be very useful if a channel has a wrong and thus unsupported name, e.g. you have a channel called “Data1” but it actually contains a Color value, so you can specify “Data1” and “Color” as arguments and a new “Color” channel will be created using the values from the “Data1” channel. Another useful case is when you want to do some basic “wiring” of values, for example copy the “Normal” channel into “Color” in order to colorize the particles based on their orientation (an otherwise typical case for a Magma operation).
Scale channel value: This would apply a multiplication with a scalar or vector to the values in an existing channel. This operation would be performed after the above operations, so it would scale the values regardless of their source. In other words, whether the “Color” channel came from the PRT file, from a Default, from an Override or was copied from another channel, it will be multiplied by the given value. So if you wanted to express “Color”=“Normal”*0.5, you could use a Copy channel operation first to clone the Normals into Color, then do a Scale channel by 0.5…
These basic operations would be too primitive compared to the power of the Magma system, but would cover a number of cases that are currently easily solved with Magma in Krakatoa MX but require resaving of particles in Krakatoa SR. We hope that this will be a useful interim solution while working on getting Magma into Krakatoa SR…