Special Textures
Quantum Particles make use of a variety of special textures for different settings or to store different types of data. Some of these Textures have to be created manually through provided scripts, while others are automatically generated by the shader. There are future plans to make the creation of these textures more user-friendly and integrated into the editor. For now, you can find the script to create these textures at the top of the Unity Editor in Tools > Quantum > Particles
.
Render Texture
Stored under Quantum/Particles/Resources/RenderTextures
.
Render Textures are used to store the particle data in a texture format. This allows for the data to be easily manipulated and used in the shader.
To ensure the data is stored in it's full accuracy, the Render Texture should be set to the R32G32B32A32_SFLOAT
format.
Each pixel will either store a particles space-time position or velocity, a detailed breakdown of the data layout can be found below.
In addition, the first few pixels of the position and velocity sections are used for simulator data instead of particle data.
This simulator data includes the position and rotation of the simulator game object.
Data Layout
The data is stored in the following layout:
- Lower Half (uv.y < 0.5):
- First
SimCount
pixels:- RGB: Simulator XYZ Position
- A: Reserved
- Remaining Pixels:
- RGB: Particle XYZ Position
- A: Age relative to max lifetime
- First
- Upper Half (uv.y >= 0.5)
- First
SimCount
pixels:- RGBA: Simulator Rotation Quaternion
- Remaining Pixels:
- RGB: Particle XYZ Velocity
- A: Aging speed per second
- First
Shape Texture
Stored under Quantum/Particles/Resources/Shapes
.
Shape Textures are used to store particle data for initializing or spawning particles, and more.
They follow the same layout as the Render Texture (except for the simulator data), therefore they need to use the RGBAFloat
format.
This means they can often be used interchangeably with Render Textures for certain settings.
Currently Shape Textures can be created from Images, Meshes or a basic sphere shape with the provided script (Tools > Quantum > Particles
).
Offset Texture
Stored under Quantum/Particles/Resources/Offsets
.
Offset Textures are used to store the offset data for particles as relative integer values and need to use the RFloat
format.
These integer values represent offsets to the index of the particle in the Render Texture and can be used to create interesting structures or patterns, where particles connect or move to very specific other particles.
Currently the provided script (Tools > Quantum > Particles
) can only generate a tree-like structure, but more options will be added in the future.
Gradient Texture
Stored under Quantum/Particles/Resources/Gradients
.
Gradient Textures are used to store color data for particles. The channels used depend on the setting they are used in, but they are often used to store the full rgba color or just alpha values.
These Textures are always read from left to right, but in some cases the vertical position can be used to give different values to different particles.
Currently these textures are created automatically when a gradient setting in the shader is edited, but any texture can be used as a gradient texture.
Curve Texture
Stored under Quantum/Particles/Resources/Curves
.
Curve Textures are used to store curve data for particles. The channels used depend on the setting they are used in but they always require a Float format.
These curves can represent different values like rotation or size and can be used to give particles a more dynamic behavior.
Even though technically any texture can be used here, because of the accuracy required for curves, it is recommended to generate these textures by using the curve editors in the shader editor.