From unity
Unity 6 lighting and visual effects guide. Use when working with lights, baked/realtime/mixed lighting, light probes, reflection probes, Adaptive Probe Volumes (APV), global illumination, Particle System, VFX Graph, or post-processing effects. Based on Unity 6.3 LTS documentation.
npx claudepluginhub cdata/aria-skills --plugin unityThis skill uses the workspace's default tool permissions.
Unity provides three light modes controlling how illumination is calculated.
Provides Unity rendering reference for shaders (Shader Graph, HLSL, ShaderLab), pipelines (Built-in, URP, HDRP), lighting/GI, VFX Graph, post-processing, and effects like dissolve, outlines, toon shading.
A render pipeline performs a series of operations that take the contents of a scene and displays them on a screen. Unity provides three render pipelines:
3D graphics, shaders, VFX, lighting, rendering optimization. Create stunning visuals with production-ready techniques.
Share bugs, ideas, or general feedback.
Unity provides three light modes controlling how illumination is calculated.
Important: All baked/mixed modes require Baked Global Illumination enabled. Without it, Mixed and Baked lights behave as Realtime.
Global illumination (GI) simulates how light bounces between surfaces, producing realistic indirect lighting.
Three ambient light sources configured in the Lighting window Environment tab:
Intensity Multiplier (0-8, default 1) controls ambient brightness.
APV is the modern replacement for manual Light Probe placement in URP:
Capture a spherical view of surroundings as a cubemap for reflective materials.
| Type | Description |
|---|---|
| Baked | Captures static GameObjects only; best performance |
| Custom | Allows dynamic object capture with custom textures |
| Realtime | Updates during gameplay; configurable refresh mode |
| Feature | Particle System | VFX Graph |
|---|---|---|
| Simulation | CPU-based | GPU-based |
| Particle count | Thousands | Millions |
| Render pipeline | All pipelines | URP/HDRP only |
| Authoring | Inspector modules | Node-based graph editor |
| Physics | Built-in collision | Custom collision blocks |
| Scripting | Full C# API | Event-based C# API |
| Sub-emitters | Native support | GPU Event contexts |
| Best for | Small/medium effects, mobile | Large-scale effects, high-end |
Decision Guide:
| Module | Purpose |
|---|---|
| Main | Initial state: lifetime, speed, size, gravity, simulation space |
| Emission | Rate and timing of particle spawns |
| Shape | Volume/surface for emission and start velocity direction |
| Velocity over Lifetime | Modify movement over particle age |
| Noise | Turbulence for organic, chaotic motion |
| Limit Velocity over Lifetime | Natural deceleration |
| Force over Lifetime | Simulated physics forces |
| Inherit Velocity | Sub-emitter particles match parent velocity |
| Lifetime by Emitter Speed | Adjust lifespan based on emitter velocity |
| Color over Lifetime / by Speed | Color changes based on age or velocity |
| Size over Lifetime / by Speed | Dimension changes based on time or speed |
| Rotation over Lifetime / by Speed | Orientation changes |
| Collision | Particle collisions with scene geometry |
| Triggers | Designate particles as collision triggers |
| Sub Emitters | Particles that emit other particles |
| Texture Sheet Animation | Texture grid animation frames |
| Trails | Motion trail rendering |
| Lights | Real-time lights on particles |
| External Forces | Wind zones and force fields |
| Renderer | Image/mesh transform, shading, overdraw |
| Custom Data | Attach custom data to particles |
Experimental feature where GPU computes events (vs CPU for normal events). Cannot be customized with Blocks.
using UnityEngine;
public class LightSetup : MonoBehaviour
{
void Start()
{
GameObject lightObj = new GameObject("Dynamic Light");
Light light = lightObj.AddComponent<Light>();
light.type = LightType.Point;
light.color = Color.yellow;
light.intensity = 2.0f;
light.range = 15f;
light.shadows = LightShadows.Soft;
light.shadowResolution = UnityEngine.Rendering.LightShadowResolution.Medium;
}
}
using UnityEngine;
using UnityEngine.Rendering;
public class ProbeSetup : MonoBehaviour
{
void Start()
{
GameObject probeObj = new GameObject("Realtime Reflection Probe");
ReflectionProbe probe = probeObj.AddComponent<ReflectionProbe>();
probe.size = new Vector3(10, 10, 10);
probe.mode = ReflectionProbeMode.Realtime;
probe.refreshMode = ReflectionProbeRefreshMode.EveryFrame;
probe.resolution = 256;
probe.hdr = true;
}
}
using UnityEngine;
public class ParticleController : MonoBehaviour
{
ParticleSystem ps;
void Start()
{
ps = GetComponent<ParticleSystem>();
// Modify emission rate -- cache module in local variable first
var emission = ps.emission;
emission.rateOverTimeMultiplier = 50f;
// Modify main module
var main = ps.main;
main.startLifetime = 3f;
main.startSpeed = 5f;
main.simulationSpace = ParticleSystemSimulationSpace.World;
}
void OnTriggerEnter(Collider other)
{
// Burst emit particles
ps.Emit(100);
}
void OnDisable()
{
ps.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
}
}
using UnityEngine;
using UnityEngine.VFX;
public class VFXController : MonoBehaviour
{
VisualEffect vfx;
VFXEventAttribute eventAttr;
void Start()
{
vfx = GetComponent<VisualEffect>();
eventAttr = vfx.CreateVFXEventAttribute();
// Set exposed properties
vfx.SetFloat("SpawnRate", 100f);
vfx.SetVector3("Direction", Vector3.up);
vfx.playRate = 1.5f;
}
void OnTriggerEnter(Collider other)
{
// Send custom event with attributes
eventAttr.SetVector3("position", other.transform.position);
vfx.SendEvent("OnHit", eventAttr);
}
public void StopEffect()
{
vfx.Stop();
}
}
using UnityEngine;
public class ProbeRefresher : MonoBehaviour
{
ReflectionProbe probe;
void Start()
{
probe = GetComponent<ReflectionProbe>();
probe.refreshMode = UnityEngine.Rendering.ReflectionProbeRefreshMode.ViaScripting;
}
public void RefreshReflections()
{
probe.RenderProbe();
}
public bool IsReady()
{
return probe.IsFinishedRendering(probe.RenderProbe());
}
}
| Member | Type | Description |
|---|---|---|
type | Property | LightType (Directional, Point, Spot, Area) |
color | Property | Emitted light color |
intensity | Property | Brightness multiplier |
range | Property | Max distance (Point/Spot) |
spotAngle / innerSpotAngle | Property | Outer/inner cone angles |
shadows | Property | LightShadows (None, Hard, Soft) |
shadowResolution | Property | Shadow map quality |
shadowBias / shadowNormalBias | Property | Shadow artifact reduction |
bounceIntensity | Property | GI bounce strength |
cookie | Property | Projected texture mask |
cullingMask | Property | Layer-based filtering |
colorTemperature | Property | CCT in Kelvin |
lightmapBakeType | Property | Baking configuration |
bakingOutput | Property | Last bake contribution details |
AddCommandBuffer() | Method | Execute GPU commands at specified points |
| Member | Type | Description |
|---|---|---|
main / emission / shape | Property | Module access structs |
particleCount | Property | Current active particles |
isPlaying / isPaused / isStopped | Property | Playback state |
Play() / Pause() / Stop() | Method | Playback control |
Emit(count) | Method | Immediate particle spawn |
Simulate(time) | Method | Fast-forward simulation |
GetParticles() / SetParticles() | Method | Direct particle data access |
Clear() | Method | Remove all particles |
TriggerSubEmitter() | Method | Activate sub-emitters |
| Member | Type | Description |
|---|---|---|
visualEffectAsset | Property | Assign/change effect graph |
playRate | Property | Simulation speed |
aliveParticleCount | Property | Active particle count |
Play() / Stop() / Reinit() | Method | Playback control |
SendEvent(name, attr) | Method | Trigger graph events |
CreateVFXEventAttribute() | Method | Create event payload |
SetFloat() / SetVector3() / etc. | Method | Set exposed properties |
GetFloat() / GetVector3() / etc. | Method | Read exposed properties |
HasFloat() / HasVector3() / etc. | Method | Check property existence |
ResetOverride(property) | Method | Restore original values |
| Member | Type | Description |
|---|---|---|
mode | Property | Baked/Custom/Realtime |
size / center | Property | Bounding box config |
intensity / importance | Property | Brightness and priority |
boxProjection | Property | Enable box projection |
refreshMode / timeSlicingMode | Property | Realtime update config |
RenderProbe() | Method | Force cubemap refresh |
IsFinishedRendering() | Method | Check time-sliced completion |
BlendCubemap() | Method | Blend two cubemaps |
unity-graphics -- Render pipelines (URP/HDRP/Built-in), shaders, materials, camerasunity-2d -- 2D lighting (URP 2D Renderer), sprite renderingunity-platforms -- Platform-specific lighting quality tiers, mobile optimization