Hi, its me again
is it possible or will it be possible in the future, to create particle partition which will mark the Events inside the .prt with IDs so as to put differnt KCMs on each?
I would like to have specific control over shading of each event (the same control i have when using pflow without prd_loader), without having to render out 4-8 different prt’s each time
is this or will this be possible?
Use an existing channel like MXSInteger to mark the particles. But that requires Script Operators (slow!) or Box #3 (expensive), so you could go with a UVW Map channel instead. In each event, add a Mapping operator and set the U coordinate to the number of the Event, e.g. 1.0, 2.0, 3.0 etc. (You can write to any of the 99 Mapping Channels, just not the Vertex Color because that is the Krakatoa Color channel). Make sure to add that Mapping Channel to the list of Channels to save to PRT. Save the particles and load in a PRT Loader.
In my experiment, I simply split 50% of the particles to a second event with opposite Speed and marked the two events with Mapping10 channel set to U=1.0 and U=2.0:
Then in a KCM, just read the same Mapping Channel, use ToScalar Operator with second input set to Integer Node with value of 1. Pass the value to a Equal Operator and its result to the third input of a Switch Operator (which is our IF test) to decide whether to pass through the original color or apply a new color via a Texture Map or a whole branch of nodes that define the shading.
Stack multiple KCMs with the Equal test comparing to 2.0, 3.0 etc. and you can affect your particles by event.
I assigned a cellular texture map to the particles with U=2.0 and an Electric map to the particles with U=1.0:
What we SHOULD do in the future is respect the MtlIndex channel which comes from PFlow and is supposed to contain the Material ID of the particle and allow a KCM to set the MtlIndex to apply a different Sub-Material from a Multi-Sub Material to the particles. So the above example would still work the same, but instead of setting the color via KCM, you would be just setting the Material ID with the Switch Operator and the rest would be taken care of by the Multi-Sub Material.
The alternative is to save each Event’s particles to a separate stream (by setting some Events to Render > Geometry while others to Render > Phantom and excluding the Phantom from saving). Then you could load each Event in a separate PRT Loader and apply the Material you want to each one of them.
If you have Box #3, you would just set the value of some channel like Script Integer to 1,2,3 etc.
This would save you some disk space because UVW Mapping is 3 floats instead of one Integer.
Otherwise the rest would be the same (you would be saving and checking the MXSInteger in the Equal test instead of a Mapping channel).