S&box Wiki
Home
/
Edit Understanding Particle Editor
View
Edit
History
No Category
Developer Overview
The Project System
Publishing To Asset Party
Getting Started With Hammer
Mapping Basics
Mapping Entities
Advanced Mapping Techniques
Getting Started with Modeldoc
Animgraph & Animation
Physics
Modeldoc Nodes
Advanced Modelling
UI Basics
Styles & Stylesheets
Razor Templates
Game Menus
Materials
Built In Shaders
Shaders
Shader Reference
Sounds & Audio
Particles
Getting Started
Making Games
Input
Networking
Physics
Rendering
Editor & Tools
VR
Misc
Playing Guides
Console Commands & Variables
Dedicated Server
Log in to edit
Understanding Particle Editor
<cat>Particle.Intro</cat> <title>Understanding Particle Editor</title> # Introduction This is here to help share and understand what everything does in terms of making particles. It's recommended that you first read through [Creating your first particle effect](Creating_your_first_particle_effect). # Emitters Emitters are what create the particles, they control the amount created, etc. ## Constant / Continuous Emitter Within this emitter it will do a constant spew of particles, it won't look at the amount of particles already emitted, it will just constantly create them within the specified amount of particles per second. - **Duration**: how long it should keep spewing out particles. - **Start time offset**: how long it should wait before activating. - **Emit rate**: the amount of particles created per second. ## Instant / Instantaneous Emitter Will just create a certain amount of particles specified, will not loop. - **Emit count**: amount of particles created. - **Start time offset**: how long it should wait before activating. ## Standard Emitter Like a smart version of Constant, it will constantly create particles, only up till a specified amount though, e.g., if there is a cap of 100, it will only make 100 particles, it will never activate again if the total stays at 100, or if you delete them and the tot drops below 100, it will shoot out particles again until it's at 100 again. - **Max particles**: the max amount of particles it will ever allow to exist and emit up to. - **Emit rate**: the amount of particles created per second. - **Start time offset**: how long it should wait before activating. # Initializers This is the information that each particle will have with it on creation, you can specify: - The **location** it should be created in - **Size** - **Color** - **Rotation** - **Speed** in a direction - The length of its **lifespan** Basically all the information it will use to display itself once it's created. These will only be assigned on creation. If you wanted a big, randomly placed particle that should have speed pushing it in a certain direction as soon as it spawns, it will all be specified in here, aka initialized on creation. ## Position in _ There are various "position in _" initializers. These will set the position of the particle to a certain point in the world, or a certain point on an object. ![the list](https://i.imgur.com/xERlmLz.png) ### Position In Sphere ![sphere](https://i.imgur.com/hP58pa1.png) ### Position In Box ![box](https://i.imgur.com/zmZvm8q.png) | Property | Description | | ------------- |:-------------:| | distance min | minimum distance from the center of the sphere particles will spawn (anything more than 0 will cause a gap in the middle where nothing will spawn) | | distance max | max distance away from a point particles will spawn bigger number, bigger area, if you want them to shoot from one point, set min and max to 0 | | distance bias | will give a bias where particles can be spawning in a flat circle if you set to 1, 1, 0 and so on. | | distance bias absolute value | causes the particles to prefer or only spawn in certain parts of the sphere, setting first 2 to 0 and leaving last at 1 will cause them to only spawn in the top half like a dome | | Control point number | changes what control point its center is at | | speed min | minimum amount of speed it will have shooting out away from the center of the sphere | | speed max | maximum amount of speed it will have shooting out away from the center of the sphere | | speed random exponent | another bias, for if it should bias towards speed min or speed max | | bias in local system | When enabled, if the particle is attached to an entity or object with rotations that are different from just placing the particle in the world, the particle's properties in this initializer will align with the rotation and position of that entity. | | randomly distribution growth time | not sure please fill it in if you find out | | speed in local coordinate system min | adds minimum velocity on the particle on a certain axis, e.g. 0, 0, 100 will cause to min amount of speed that it shoots upwards | | speed in local coordinate system max | adds maximum velocity on the particle on a certain axis, e.g. 0, 0, 100 will cause to max amount of speed that it shoots upwards | | output vector | the vector it will output from (just leave this alone) | | velocity vector | the vector for its velocity (just leave this alone) | This is the main way you will be making your particles move and spawn in a specific place. <warning> If you want to view and test this initializer, make sure to add the movement basic in the operators. If you want to mess around on a new particle, add basic render sprites in the renderers. </warning> ## Set Float (Per Particle) This allows you to put an input for everything that will affect the particle, so it can change the base rotation it spawns at, the base size, the life duration and so on. Within this you can click the button next to the value to give a list of different input types. ![input types](https://i.imgur.com/vQ4mvKK.png) The most useful input types are the top 3: 1. **Literal Float**: a single number, so will have a constant rotation, scale, life duration on every single particle. 2. **Random Uniform**: will randomly give an output between 2 numbers, each particle will have a random number between these 2. 3. **Random Biased**: will also randomly give an output between 2 numbers, but you can push a bias towards one number, lets say if you wanted big particles with only a small amount of smaller particles you do that with this. Here are the main targets you will be using, also what operators are needed for them to actually work. | target | use | inputs needed | operators needed | | ------------- |:-------------:| -----:| | life duration | how long a particle will exist for in seconds | any number you want, it controls time | either Alpha fade and decay or Lifespan decay | | radius | changes the size of each particle | any number you want, bigger number bigger size | nothing needed | | roll | this controls the rotation the particle spawns at | 0 - 360 | nothing needed | | roll speed | controls the amount of continuous rotation is has once after spawns | any number, but keep it low unless you want to spin REALLY quick | rotation basic | ## Set Vector (Per Particle) This controls pretty much color, it does do other things, but you will only ever really use it for the color. Instead of a value input like the float this takes a vector input. ![vector input example](https://i.imgur.com/9XfeADD.png) Although some of these options can be adjusted by a value input like the last option, the color gradient. ![value input on vector input](https://i.imgur.com/6ajJxQ7.png) ### Example Here's an example: you can cause it to spawn with a random color between 2 colors - let's say black and white. Using a color gradient input, you can then use random uniform on the value option just below the gradient option to spawn randomly between the 2 colors. ![example](https://i.imgur.com/iywBKCt.png) # Operators Operators are what control and tell the particle what to do after its creation, either it does it based on its own inputs, or inputs receive from the initializers. Here is a list of the operators you will commonly be using and what their purpose is. | operator | use | initializer needed | | ------------- |:-------------:| -----:| | movement basic | This will allow the particle to move after creation, it will receive an input from an initializer and allow it to move, You can add gravity to the particle on whatever strength and direction you want and also add DRAG to the particle to cause it to slow down after the initial speed it had so it comes to a stop| Position in sphere / move particle between 2 points (also set vector but I don't recommend using that at all) | | alpha fade and decay | will cause the particle to fade in and fade out of existence (you can change it to also just pop it and fade out or fade in and pop out) | needs Set Float - life duration OR it will auto set to 1 second | | Lifespan decay | also causes the particles to come in and out of existence, but instead pop in and out instead of fading | needs Set Float - life duration OR it will auto set to 1 second | | Lifespan endcap timed decay | Causes the particle to live indefinitely until an endcap (destroying) event is triggered on the particle (either through code, or in the particle through some function). You can give it a delayed time before the particle disappears after being triggered. Generally, this operator is used for particles that do not require continuous emission or that do not fade/die unless some event is triggered in-game. | needs Set Float - life duration OR it will auto set to 1 second. Life duration in this context simply refers to the amount of seconds before all operators in the particle finish or reset their cycle (but does not necessarily kill the particle) | | rotation basic | will cause the particles to rotate at a constant rate | needs Set Float - roll speed | | rotation spin roll | will cause the particle to spin starting at one speed and then switching to a 2nd speed but a certain amount of time | needs no input | # Constraints These in simple terms can cause extra stuff to happen while the operators are doing stuff, they can allow collisions and interactions with stuff external to the particle. | Constraint | Purpose | | ------------- |:-------------:| | Collisions via traces | this allows your particles to interact with geometry up to a certain point, mainly allowing them to stick to walls and bounce off of walls if needed | <warning> Collision via traces is a very laggy operator, so try and avoid overusing it. </warning> # Renderers This is how the particle will physically display and render as game as, although the initializers can change the colour, everything about how it looks is all done here. You will be using Render sprites pretty much every single time. This meaning how it is shaped (STENCIL TEXTURE), how lighting will work, uv stuff, animation on the particle, normal stuff, orientation that the particle is facing, and extra color adjustment related stuff. The main options in there you probably will use are: 1. Stencil texture. 2. Color blend. 3. Radius scale. 4. Alpha scale. 5. Self illum amount. 6. Orientation type. If you want to use custom sprites (stencil textures) please head over to <page>using_custom_sprites</page> And if you want to learn how to make animated sprites (stencil textures) check out <page>creating_animated_sprites</page> # Snapshot A .vsnap (valve particle snapshot file) is used by the particle system as a reference for control point data. Generally a .vsnap is a collection of vectors such as vertices from a model, and can be used for example to position particles in a certain manner. They can hold information you can use like, Position, Color, Radius, Creation Time and many more, This is done by storing them on the vertex data. They can also be animated along with the mesh (this can be seen in Half-Life Alyx G-Man Speech scene). To create a .vsnap File you can use ModelDoc. Just add a VSNAPFile operator in modeldoc and select the mesh you want to convert. When compiled this will save a .vsnap file in your particles folder. # Example Here's an example using a lot of what has been explained here. <upload src="70317/8d91a26971f9a18.mp4" size="1688476" name="2021-05-18 18-54-50_Trim.mp4" /> ## Emitters 1. Emit standard - is creating a constant 100 particles max, once they die it creates another 100. ## Initializers 1. **Position in sphere** - spawning the particles in a sphere at a distance, then moving them outwards and upwards. 2. **Set Float - Roll speed** - setting a random rotation speed value for the operators to use for each particle. 3. **Set Vector - Color** - setting a random color from white to black on each particle. 4. **Set Float - life duration** - setting the life of the particles to all be 5 seconds. ## Operators 1. **Alpha fade and decay** - causing the particles to fade in and out at the start and end of the lifespan given by the Set Float - life duration initializer 2. **Movement basic** - Is grabbing the speed input from the position in a sphere, then also adding some drag and gravity onto it to slow them down in the air and drag them down to the ground. 3. **Rotation spin roll** - is just giving a rotation at the start and stopping it after a certain amount of seconds. ## Constraints 1. **Collision via traces** - this is causing the particles to hit and bounce the ground and then eventually also slide away at the end. ## Renderers 1. **Render sprites** - This is just applying the star texture I have given, I am also setting the self illum so no shadows can be cast upon it and also adding some slight alpha onto it so it's slightly transparent.
S&box Wiki
Development
Developer Overview
6
Editor Overview
General FAQ
System Requirements
The s&box wiki
Troubleshooting
Useful Links
The Project System
4
Adding Assets
Creating a Game Project
Project Settings Window - Games
Project Types
Publishing To Asset Party
2
Uploading assets
Uploading projects
Hammer
Getting Started With Hammer
3
Getting Started With Hammer
Making Your First Map
Mapping Resources
Mapping Basics
7
Cordons
Hotspot Materials
Selection Sets
Standard Mapping Dimensions
Tool Materials
Tools Visualisation Modes
Using Entities That Require a Mesh
Mapping Entities
2
Creating a Door
Light Entities
Advanced Mapping Techniques
8
Collaborating With Prefabs and Git
Instances
Prefabs
Quixel Bridge Plugin
Tilesets
Tilesets-Advanced
Tilesets-Proxies
VIS Optimizations
Models & Animation
Getting Started with Modeldoc
7
Automatic Model Setup
Breakpieces
Creating a Model
Guide to Models
Importing Rust Weapons
LODs
ModelDoc FAQ & best practices
Animgraph & Animation
4
Animations without Animgraph
AnimEvents, AnimGraph Tags, Attachments
Animgraph
Delta Animations
Physics
3
Cloth Physics
Collisions, Physics & Surface Types
Jiggle Bones
Modeldoc Nodes
1
Custom ModelDoc nodes
Advanced Modelling
6
Bodygroups
Citizen
First Person
IKChains and Stride Retargeting
Morphs
Vertex Normals
User Interface
UI Basics
6
Custom Fonts
Embedding Websites
Enabling Pointer Events
Events and Input
UI Basics
UI with Components
Styles & Stylesheets
1
Video Backgrounds
Razor Templates
4
A Razor Overview
Aliases and SetProperty Attributes
Generic Components
Templates
Game Menus
1
Making a Custom Pause Screen
Materials & Shaders
Materials
5
Guide to Materials
Material Attributes
Material Resources
Texture Settings
Using Dynamic Expressions
Built In Shaders
2
Foliage Shader
Glass Shader
Shaders
4
Compute Shaders
Constant Buffers
Material API
Shading Model
Shader Reference
5
Anatomy of Shader Files
Getting rid of Tex2D macros
Shader Reference
Shader States
Texture Format Cheat-Sheet
Other Assets
Sounds & Audio
4
Guide to Sounds
Sound Events
Sound Occlusion
Soundscapes
Particles
5
Creating animated sprites
Creating your first particle effect
Understanding Particle Editor
Using custom sprites
Using particle systems from C#
Coding
Getting Started
5
Cheat Sheet
Learning Resources
Setting up Rider
Setting up Visual Studio
Setting up Visual Studio Code
Making Games
2
Components
GameObjects
Input
4
Commands
ConVars
Input System
Speech Recognition
Networking
7
Auth Tokens
Http Requests
Lobby System
Networked Types
Networking Basics
RPCs
WebSockets
Physics
5
Collisions
Hitboxes
Joints
Traces
Triggers
Rendering
3
Render Tags
RenderHooks
Scenes
Editor & Tools
5
Guide to Widgets
Hammer API
Hammer Gizmos
Hotload Performance
Widget Docking
VR
3
Getting Started
VR Input
VR Overlays
Misc
10
Asset Types
Attributes and Component Properties
Backend API
Code Accesslist
CPU Performance Profiling
DisplayInfo
package/find
Setting Up A Navigation Mesh
Threaded Tasks
TypeLibrary
Playing
Playing Guides
3
Default Keybinds
Proton
s&box on macOS (Experimental)
Console Commands & Variables
1
Launch Arguments
Dedicated Server
1
Dedicated Servers