Loading...
Loading...
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 skill4agent add nice-wolf-studio/unity-claude-skills unity-lighting-vfx| 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 |
| 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 |
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 |
|---|---|---|
| Property | LightType (Directional, Point, Spot, Area) |
| Property | Emitted light color |
| Property | Brightness multiplier |
| Property | Max distance (Point/Spot) |
| Property | Outer/inner cone angles |
| Property | LightShadows (None, Hard, Soft) |
| Property | Shadow map quality |
| Property | Shadow artifact reduction |
| Property | GI bounce strength |
| Property | Projected texture mask |
| Property | Layer-based filtering |
| Property | CCT in Kelvin |
| Property | Baking configuration |
| Property | Last bake contribution details |
| Method | Execute GPU commands at specified points |
| Member | Type | Description |
|---|---|---|
| Property | Module access structs |
| Property | Current active particles |
| Property | Playback state |
| Method | Playback control |
| Method | Immediate particle spawn |
| Method | Fast-forward simulation |
| Method | Direct particle data access |
| Method | Remove all particles |
| Method | Activate sub-emitters |
| Member | Type | Description |
|---|---|---|
| Property | Assign/change effect graph |
| Property | Simulation speed |
| Property | Active particle count |
| Method | Playback control |
| Method | Trigger graph events |
| Method | Create event payload |
| Method | Set exposed properties |
| Method | Read exposed properties |
| Method | Check property existence |
| Method | Restore original values |
| Member | Type | Description |
|---|---|---|
| Property | Baked/Custom/Realtime |
| Property | Bounding box config |
| Property | Brightness and priority |
| Property | Enable box projection |
| Property | Realtime update config |
| Method | Force cubemap refresh |
| Method | Check time-sliced completion |
| Method | Blend two cubemaps |
unity-graphicsunity-2dunity-platforms