ActiveParticle
Harigane- Particle
MMM Compatible
Last updated: 20/05/2014
ActiveParticle generates textured billboard particles that appear with movement.

Click the image above to see it in full
Download
Tutorial
1. Go to 'accessory manipulation' and click 'load'.
2. Select your desired effect and click 'OK'.
Accessory Parameter Values
-X, Y, and Z: Adjusts the position of the effect.
-Si: Adjusts the amount of particles generated.
-Tr: Adjusts the opacity of the particles.
Controller Explanations
SmoothControl.x produces a 2D plane that allows particles to softly fade away when colliding with this plane, rather than abruptly clip through objects. Particles will also not appear behind this plane. Adjust the position of this plane to your liking, and then set Tr to 0.
BackgroundControl.x allows for background assets, such as the stage, to generate particles when they move in conjunction with the effect's movements. Load this accessory into MMD and attach it to the bone of your desired background asset.
TimeControl.x allows you to adjust the speed of the particles in MMD, allowing for easy slow-motion scenes or still shots. Setting this accessory's Si to 0 causes the particles to stop in time, and they will only move by advancing to the next keyframe. The accessory's Tr controls the speed of the particles; setting it to 0 causes the particles' time to stop completely.
Editing the Code Parameters
-Line 10: #define UNIT_COUNT: Determines the maximum number of particles, by multiples of 1024, that can be generated at once. Setting this value to 1 sets the maximum number of particles to 1024, or (1 x 1024); whereas setting it to 4 sets the maximum to 4096, or (4 x 1024).
-Line 13 or Line 14 (ActiveParticleC): #define TEX_FileName: Determines which image file to use when generating particles.
-Line 13 (APC): #define TEX_GradMapFile: Determines which image file to use when the particles change colors.
-Line 14 or Line 15 (APC): #define TEX_PARTICLE_XNUM: Determines the number of particles generated at a time when moving along the x axis.
-Line 15 or Line 16 (APC): #define TEX_PARTICLE_YNUM: Determines the number of particles generated at a time when moving along the y axis.
-Line 16 or Line 17 (APC): #define TEX_USE_MIPMAP: Determines whether the effect generates texture mipmaps. Setting this value to 0 means the effect will not generate texture mipmaps, whereas setting it to 1 means the effect will.
-Line 17 or Line 18 (APC): #define TEX_ADD_FLG: Determines whether the effect applies an Add / Linear Dodge blend mode onto the effect. Setting this value to 0 means the effect will not apply the blend mode, whereas setting it to 1 means the effect will apply the blend mode.
-Line 20: float3 ParticleColor: Determines the color values to multiply the particle image by, represented by a value range of 0.0~1.0 in an RGB value format.
-Line 21: float ParticleRandamColor: Determines the color variance of the particles generated, represented by a value range of 0.0~1.0.
-Line 22: float ParticleSize: Determines the size of the particles generated.
-Line 23: float ParticleRandamSize: Determines the size variance of the particles generated, represented by a value range of 0.0~1.0.
-Line 24 or Line 22 (APC): float ParticleSpeedMin: Determines the minimum initial speed of the particles generated.
-Line 25 or Line 23 (APC): float ParticleSpeedMax: Determines the maximum initial speed of the particles generated.
-Line 26 (APR): float ParticleRotSpeed: Determines the rotation speed of the particles generated.
-Line 26 or Line 24 (APC): float ParticleRotSpeedMin: Determines the minimum rotation speed of the particles generated.
-Line 27 or Line 25 (APC): float ParticleRotSpeedMax: Determines the maximum rotation speed of the particles generated.
-Line 28 or Line 26 (APC): float ParticleRotRandam: Determines the rotation variance of the particles generated, represented by a value range of 0.0~1.0
-Line 29 or Line 27 (APC/APR): float ParticleInitPos: Determines the initial position where particles spawn, relative to the accessory x file.
-Line 30 or Line 28 (APC/APR): float ParticleLife: Determines the duration of the particles generated, represented in seconds.
-Line 31 or Line 29 (APC/APR): float ParticleDecrement: Determines when the particles begin to disappear, represented as a ratio to ParticleLife. A smaller value means the particles will disappear sooner.
-Line 30 (APC): float ParticleScaleUp: Determines the intensity of the diffusion layer applied to the particles generated.
-Line 32 or Line 31 (APC) or Line 30 (APR): float OccurFactor: Determines the number of particles generated relative to the movement. A greater number means more particles are generated.
-Line 36 or Line 35 (APC) or Line 34 (APR): float3 GravFactor: Determines the intensity of gravity on the particles generated, represented in a (x, y, z) format.
-Line 37 or Line 36 (APC) or Line 35 (APR): float ResistFactor: Determines the velocity resistance of the particles generated. A greater value means the particles will drag along.
-Line 45 or Line 44 (APC) or Line 43 (APR): float3 vel = float3: Determines the initial velocity of the particles generated. A non-zero value means the particles will be generated even when the accessory x file is not being moved.
Tips
-There are four types of ActiveParticle included in the download:
ActiveParticle.x is the basic form of the effect.
ActiveParticleR.x enables the particles to rotate in a 3D space. The particles will continue to face the camera regardless of what angle they are viewed at, however.
ActiveParticleC.x enables the particles to change size and color while they are generated.
ActiveParticleRC.x combines the features of ActiveParticleR.x and ActiveParticleC.x.
-You can attach the effect to a model's bone and it will follow the bone movement, as displayed in the preview gif.
-Harigane recommends setting this effect to be at the bottom of the accessory draw order.
-By default, the maximum number of particles generated will not exceed 4096. The effect will stop generating new particles until some have disappeared.
-The amount of particles generated is determined by the movement distance, ie. moving the effect a shorter distance will produce fewer particles than moving the effect a farther distance.