-
Notifications
You must be signed in to change notification settings - Fork 36
Particle Shader
The Particle Shader (Mochie/Particles) is a VFX shader for Unity Particle Systems (Shuriken), with soft particles, flipbook blending, distortion, AudioLink, and optional PBR lighting.
| Variant | Description |
|---|---|
Mochie/Particles |
The core particle shader. |
Mochie/Particles X |
Adds UV modes (Polar and Panosphere), Cutout Rim, Emission Light Reactivity, Dissolve, Random Hue, Rim Light, and Outlines. |
The shader needs a specific vertex stream layout on each Particle System's Renderer module: Position, Normal, Tangent, Color, UV, UV2, AnimBlend, AnimFrame, Center, AgePercent, and StableRandom.xyzw, in that order. If any Particle System in the open scene uses the material with incorrect or missing streams, a warning at the top of the inspector lists them. Click Fix Vertex Streams to apply the correct layout to all of them.
Every texture in the inspector has UV settings below it once a texture is assigned.
- Particles: Tiling, Offset, and Scrolling (how fast the texture moves on each axis).
-
Particles X: A UV Mode:
-
Default: Tiling, offset, and scrolling. -
Polar: Wraps the texture around the center of the particle, so its horizontal axis runs around in a circle and its vertical axis runs outward. Useful for vortices, magic circles, and shockwaves.- Radius: How far the texture stretches outward. Higher values repeat it more times between the center and the edge.
- Rotation: Rotates the texture around the center. 1 is a full turn.
- Rotation Speed: How fast the texture spins around the center.
-
Panosphere: Maps the texture around the viewer based on the direction they're looking, like a panorama, with tiling, offset, and scrolling.
-
-
Blending Mode: How the particle combines with what's behind it.
-
Alpha: Standard transparency using the particle's alpha. -
Premultiplied: Premultiplied alpha blending, which keeps soft edges clean. -
Additive: Adds the particle's color to the scene, brightening it. Good for fire, sparks, and glows. -
Soft Additive: Like Additive, but brightens dark areas more than bright ones, so it's less likely to blow out to white. -
Multiply: Multiplies the scene by the particle's color, darkening it. -
Multiply x2: Multiplies the scene by double the particle's color. Mid-gray leaves the scene unchanged, darker colors darken it, and brighter colors brighten it. -
Opaque: No transparency. Writes to the depth buffer like regular geometry.
-
-
Alpha Source (non-opaque modes, or with Cutout): Where the particle's alpha comes from: the
Base Colortexture's alpha, or a separateAlpha Mask. - Opacity (non-opaque modes): Multiplies the particle's alpha.
- Cutout: Discards pixels whose alpha is below the threshold, giving hard edges. Works in every blending mode.
- Softening (non-opaque modes): Fades out the edges of particles where they intersect with opaque geometry to hide harsh cutoffs. The value sets how far the fade extends; higher values give a softer, wider fade. Requires the depth texture (in VRChat, the Depth Light prefab).
- Flipbook Blending: For particles using the Texture Sheet Animation module. Fades between frames instead of immediately cutting to make the animation smoother. It applies to the Base Color, Alpha Mask, and normal maps.
-
Cutout Rim (π Particles X, with Cutout): Draws a colored edge along the boundary of the cut-out area.
- Rim Width: How wide the edge is.
- Rim Color: The HDR color of the edge. Its alpha sets how strong it is.
-
Rim Blend: How the edge combines with the particle:
Addbrightens it with the color, andMultiplytints it.
- Base Color: The particle's main texture and HDR tint. It's also multiplied by the particle's color from the Particle System (such as Start Color and Color over Lifetime).
-
Secondary Color: A second texture and HDR tint, combined with the Base Color using Blending:
-
Lerp: The secondary color shows behind the base color, wherever the base color is transparent. -
Add: Adds the secondary color on top. -
Sub: Subtracts the secondary color. -
Mult: Multiplies by the secondary color.
-
- Alpha Mask (when Alpha Source is Alpha Mask): A separate texture for handling opacity. Black is transparent, white is opaque. The dropdown selects which channel is used.
Enabled with its toggle. Makes the particles respond to the scene's lighting, with optional PBR shading. For full lighting support, also enable the lighting options at the bottom of the Particle System's Renderer module.
-
Workflow: How the metallic, roughness, and occlusion maps are provided.
-
Metallic: Each is its own texture. -
Packed Metallic: All three are packed into the channels of one texture, which improves performance and file size.
-
- Normal Map: Determines how light behaves on the surface, faking small details and bumps. The value sets its strength.
- Metallic (Metallic): How metallic the particle looks. Higher values decrease visibility of the base color in favor of reflective color, like metal. The value multiplies the map.
- Roughness (Metallic): How rough or smooth the surface looks. Rougher surfaces have blurrier reflections and broader highlights. The value multiplies the map.
- Occlusion (Metallic): Extra shading that simulates contact shadows in crevices. The value sets its strength.
- Pack Textures (Metallic): Packs the separate maps into one texture (occlusion in red, roughness in green, metallic in blue) and switches to the Packed Metallic workflow with matching channel settings.
-
Packed Map (Packed Metallic): The texture holding metallic, roughness, and occlusion in its channels.
- Metallic Channel, Roughness Channel, and Occlusion Channel: Which channel holds each value.
- Metallic Strength and Roughness Strength: Multiply the packed values.
- Occlusion Strength: How strongly the packed occlusion darkens the particle.
- Emission: Enables emission, which adds color after all lighting calculations, so the particle glows even in the dark.
-
Light Reactivity (π Particles X): Fades the emission out in bright lighting, so particles only glow in the dark.
- Lighting Threshold: The range of scene brightness over which emission fades. At or below the minimum, emission is at full strength; at or above the maximum, it's gone.
- Color: The emission map and its HDR color.
- Environment Reflections: Reflections of the world's reflection probes. The value sets their strength.
-
Specular Highlights: GGX specular highlights from realtime lights. The value sets their brightness.
- Sharp Highlights: Posterizes the highlights into a set number of brightness steps, for a toon look. The value sets how many steps.
- Spherical Harmonics: Lights the particles with ambient light from the scene's light probes. When off, ambient light is treated as full white, so the environment never darkens the particles.
Enabled with its toggle. Color adjustments applied to the final color.
-
Hue Mode: The method used to shift hue.
-
HSV: Standard hue shift. -
Oklab: A more subtle, less saturated hue shift that better preserves perceived brightness.
-
- Auto Shift: Automatically shifts the hue over time based on the Speed parameter. When off, set the Hue manually.
- Mono Tint: Forces all colors to the same hue, varying only in brightness and saturation.
- Hue: Shifts every color around the color wheel. 0 and 1 are both the original colors.
- Saturation: The color intensity. 0 is grayscale, 1 is unchanged, and higher values are more vivid.
- Brightness: Multiplies the brightness.
- Contrast: 1 is unchanged. Higher values increase contrast, and lower values flatten colors toward gray.
- HDR: Blends toward a gamma-expanded version of the colors, which darkens midtones and deepens colors.
Enabled with its toggle. Distorts the scene behind the particle using a normal map, for effects like heat haze and shockwaves.
-
Normal Map: The distortion texture.
- Distort UVs: Also distorts the particle's own textures.
- Strength: How far the distortion shifts things. It's scaled by the particle's alpha and color brightness, so particles that fade out also stop distorting.
- Mesh Refraction: Includes mesh normals in refraction calculations, like a lens, which is useful for mesh particles. The value is the IOR (index of refraction): 1 doesn't bend at all, and higher values bend more. Do not use on flat surfaces.
- Blend (non-opaque modes): How much of the particle's color is replaced by the distorted view of the scene behind it. At 0 only Distort UVs has an effect; at 1 the particle shows only the distorted scene.
When the material is opaque, only UV distortion works.
Enabled with its toggle. Dissolves the particle away with a noise pattern.
-
Mode: What drives the dissolve.
-
Particle Lifetime: Particles dissolve as they age. -
Manual: A fixed amount, which you can animate.
-
-
Noise: The dissolve pattern. Darker areas dissolve first.
- Random Offset: Randomly offsets UVs on a per-particle basis, so each particle dissolves in a different pattern.
- Dissolve Amount (Manual): How much of the particle is dissolved. At 0 it's whole; at 1 it's gone.
- Age Threshold (Particle Lifetime): The part of the particle's life over which it dissolves, where 0 is when it spawns and 1 is when it dies. It starts dissolving at the minimum and is fully gone at the maximum.
-
Rim Blending: How the glowing edge combines with the particle:
Addbrightens it with the color, andMultiplytints it. - Rim Color: The HDR color of the edge along the dissolve. Its alpha sets how strong it is.
- Rim Width: How wide the edge is.
Enabled with its toggle. Gives each particle a random color.
-
Mode: The method used to shift hue:
HSVorOklab(a more subtle, less saturated hue shift). - Mono Tint: Forces all colors of each particle to its random hue, varying only in brightness and saturation.
- Hue Range: The range the random hue shift is picked from. 0 and 1 are both the original colors.
- Saturation Range: The range the random saturation is picked from, where 0 is grayscale and 1 is unchanged.
Enabled with its toggle. Lights the edges of the particle where its surface turns away from the viewer. Most useful with mesh particles, since flat billboards face the viewer.
-
Color: The rim's texture and HDR color, with Blending to choose how it combines with the particle:
Add,Sub,Mul,Mulx2,Overlay,Screen, orLerp. - Strength: How strongly the rim shows.
- Sharpness: How hard the rim's inner edge is. Higher values give a sharper edge.
-
Width: How far the rim reaches in from the edges. With Scale by Lifetime on, this is replaced by:
- Starting Width and Ending Width: The rim width at the start and end of the Age Threshold.
- Age Threshold: The part of the particle's life over which the width changes, where 0 is when it spawns and 1 is when it dies.
- Scale by Lifetime: Changes the rim width over the particle's life.
Enabled with its toggle. Only available for opaque materials. Draws an outline around mesh particles by pushing a copy of the mesh outward.
- Color: The HDR outline color. It's also multiplied by the particle's color.
- Thickness: How far the outline extends from the mesh.
- Stencil Mode: Will only display the outline outside the mesh, so it doesn't draw over the particle itself. Turning it on or off changes the stencil settings to match.
Enabled with its toggle. Pulses the particle's opacity over time. In Opaque mode, it pulses the brightness instead.
-
Waveform: The shape of the pulse.
-
Sin: Fades smoothly in and out. -
Square: Switches abruptly between on and off. -
Triangle: Fades in and out at a constant rate. -
Saw: Fades in, then drops off instantly. -
Reverse Saw: Appears instantly, then fades out.
-
- Strength: How much the pulse fades the particle at its lowest point. At 1 it fades out completely.
- Speed: How fast the pulse repeats.
Non-opaque modes only. Enabled with its toggle. Fades particles based on their distance from the camera, measured from each particle's center. Particles that have fully faded out are skipped, which saves performance.
- Far Min Range: The distance, in meters, within which particles are fully visible.
- Far Max Range: The distance, in meters, beyond which particles are invisible. They fade out between Far Min Range and Far Max Range.
- Near Min Range: The distance, in meters, within which particles are invisible, so they don't block the camera up close.
- Near Max Range: The distance, in meters, beyond which particles are fully visible. They fade in between Near Min Range and Near Max Range.
Drives effects from VRChat AudioLink frequency bands (Bass, Low Mids, Upper Mids, Highs).
- Global Strength: Multiplies the Strength of every effect below.
- Global Remap: The range of audio levels every effect responds to. A level at the minimum gives each effect the low end of its own Remap, and a level at the maximum gives the high end.
The Filtering, Distortion, Opacity (non-opaque modes), Cutout, Outlines (π Particles X, Opaque mode), and Emission subsections each have a Band, a Strength (how much the music controls the effect), and a Remap (the range of the effect's response). Each drives the matching feature:
- Filtering: Fades the Filtering adjustments in and out.
- Distortion: Scales the distortion strength.
- Opacity: Scales the opacity.
- Cutout: Cuts the particle away when the band is quiet and reveals it as it gets louder.
- Outlines: Scales the outline thickness.
- Emission: Scales the emission brightness.
Only shown with Lighting on. Support for VRChat Light Volumes, which provide higher quality, more localized baked lighting than Unity's light probes. Enabled by default.
- Strength: How much light volumes replace regular light probe lighting.
- Specular Highlights: Specular highlights derived from VRC Light Volumes. The value sets their brightness.
- Bias: Offsets the sampling position of the light volume along the surface normal to help avoid light leaking.
- Render Queue Offset: Offsets the render queue by this value, to change when the particles draw relative to other objects. The resulting Render Queue is shown below it. Non-opaque modes start from the Transparent queue (3000); Opaque starts from Geometry (2000), or AlphaTest (2450) with Cutout.
-
Culling: Which sides of the particle are drawn:
Offdraws both sides,Fronthides front faces, andBackhides back faces. -
ZTest: How the particle is depth tested against other objects. The default,
LessEqual, hides it behind closer objects;Alwaysdraws it on top of everything. -
Stencil: Advanced settings for the stencil buffer, which lets materials mask each other. Outlines' Stencil Mode changes these automatically.
- Reference Value: The value compared against and written to the stencil buffer.
- Pass Operation: What happens to the stencil buffer when both the stencil and depth tests pass.
- Fail Operation: What happens when the stencil test fails.
- Z Fail Operation: What happens when the stencil test passes but the depth test fails.
- Compare Function: How the Reference Value is compared against the stencil buffer to decide whether the particle draws.
Mochie's Shaders β’ Created by Mochie β’ GitHub β’ Found an issue? Submit a report