PFX to Displacement Tutorial
INTRODUCTION Back in LightWave 5.x, ParticleStorm was the particle system used. This system relied on top of the existing Displacement architecture, which gave the coder the ability to manipulate point data. Being a displacement it could be influenced by other displacement plugins that would be applied to the particles. They could also be affected with bones. In LightWave 6.x, ParticleStorm was superceded by the new ParticleFX, which was in of itself a dynamics architecture. It no longer relied nor used the displacements to manipulate particles. Particles in LightWave 6.x and above were a different type of object (called Custom Objects) altogether. With this separation, particles were unaffected by displacements, which to some, especially me, could prove useful and time-saving. These notes outline my experimentation to convert ParticleFX particles back to the old-style displacements.
OVERVIEW Point particles are first generated in Modeler. These points are then put into Layout, and applied a custom Displacement LScript. This custom LScript looks at an existing ParticleFX emitter and copies each particles positions to its corresponding point.
PROCESS First make point particles. This can be achieved by creating a sphere and killing off all the polygons. The point particles can also be globally centered at <0,0,0>. Alternately, I provided a custom Modeler LScript that can be used to generate these. TimeWeightedPonts.ls Note: when using this script, no selection is necessary, and no selection will be taken consideration of. Proper weighting for PFX2DisplacementDM necessitates that the internal point index be accessed directly, as opposed to user selection. More on this later. Operation: when creating new particles, select
New Particles. When you already have an existing point particle
cloud and simply want to modify the weights, select Apply Weights. Back to the problem.... Create 1000 point particles and load that into Layout. We are going to create an HVEmitter to serve as a reference emitter for our point particles. Give this emitter the values you see in the images below: This settings will give make your emitter emit particles at 10 particles a frame and spit them out along the Z axis.
PFX2DisplacementDM.ls The heart of it is the LScript. It is a simpe displacement LScript, which is applied to a point cloud. What the script does is look at a specified emitter (as reference) and detect the particles it emits and then applies that information by displacing the point particles it is attached to. There are only two user inputs in this script.
So now we use it... Select your point particles and apply the PFX2DisplacementDM to it. Double-click on the slot and then select the HVEmitter on the Reference Emitter of the PFX2DisplacmentDM script. You should be able to see the point particles immediately follow the PFX particles. If this is not readily apparent, hide the HVemitter particles. Now, under the point particles create some bones for it and then rest them: Make sure these bones have Morph Positions turned on. Go to frame 50 and pose the bone. Then scrub the timeline from 0 to 50 and watch the point particles deform along the bones:
The problem with this is that the point particles all have the same age. LScript cannot generate points on-the-fly. Points cannot be written data (I had hoped to write in the particle age for each point). So all the points must exist beforehand to be displaced. This problem is not solved entirely. I thought of a workaround, but it is very much a half-solution.: it consists of `tagging` points with `time-weights` which signify the chronological order of their `appearance`. However, I am unable to modulate this dynamically over time using gradients. It is likely I am missing something. If you have any idea how to improve the upcoming solution I am about to present, I'd welcome the knowledge. I created a script that serves as a point-maker and weighter, which weights points based on their point index. A more specific explanation on what's this all about... Since our point particles generate on the same time all of them have the same age. We can, however, counteract this by explicitly assigning them a particle age using the only parameter that HyperVoxels can read in points: weight maps. We run the script and input the Weight Map name (no existing weight map required), input the Birth Rate to determine the `groupings` of each emission. This tells the script to apply a certain `time-weight` value to a group of points that will emit at the same time, as opposed to a individual points. Unfortunately, envelopeable birth rates are not yet supported. Assignment order can be either one. I've experimented on both Min-Max and Min-Max-Min (which refers to the order of weights assigned to the points by index) and Min-Max-Min seems to achieve a more pleasant aging. Once the points have been made, go to Layout and set it up as we did above, or something similar. You do not need bones at this point. Apply HyperVoxels to the loaded point particles, by activating that object in the HyperVoxels panel. Then set the particle size to 2cm, or so. Access the Texture Layer (e.g. `T` button). Add a gradient with the following settings: Note that the third key (though it looks like the second) has a parameter (or location) of 248.7509. This would probably be different if you were using a scratch scene. In the scene file provided, this is, more or less, the value. The significance of this gradient and these values, is that we are simply telling HyperVoxels to read weight values as percentages. In the first key, the Value is 100% at parameter -1. Second key is at Value 100% at parameter 0. Third key is 0% at parameter 248.7509. In the next layer, create another gradient with these inputs: This Particle Age gradient serves as the first and only modulator. It tells the layer below it to increase in size as it ages. Since all of them are of the same age, their individual weights are what gives them their unique sizes as the time progresses. First key has a value of -100% at parameter 0. Second key has a value of 0% at parameter 30. Please take note that the blending mode is set to Additive. Scrubbing the timeline will reveal the effect of particle aging, somewhat. So, all in all, the problem of particle age has not really been fully solved. This is, indeed, an ugly hack, and, truth be told, I dont think it will stand up to any real-world use, because there is no way to really modulate it further. What if we need the particles to become larger immediately? Or what if we wanted to shrink the particles mid-way and then enlarge them again? I've thought of using the displaced points as reference for a customised, LScript-driven Particle Object. This may actually serve to get particle age data. But it is complicated: to have three things going to achieve something that one should be already doing. I might seriously take it up, though, if sooner or later other production workarounds dont meet expectations. Also, I still have to find out whether or not LScript has the ability to read the location of bone-displaced points. If not, then that shuts the door for good. If you, the reader, have any useful ideas regarding this matter, either about the method itself, or ideas outside the box, inputs will be appreciated.
Future things I intended to do.... The particle age limitation problem is mainly a HyperVoxels problem. I intend to incorporate FX_Link_UltraIA with PFX2Displacement so that particle data flows more freely. I dont think, with an attachment to FX_Link_UltraIA, particle age will continue to pose a problem. But we'll just have to see. ©2005, Lernie Ang |