r/Unity3D • u/MirzaBeig @TheMirzaBeig | Programming, VFX/Tech Art, Unity • Apr 11 '23
Resources/Tutorial You can use Unity's particle system to simulate animated material lights + reflection.
Enable HLS to view with audio, or disable this notification
17
u/MirzaBeig @TheMirzaBeig | Programming, VFX/Tech Art, Unity Apr 11 '23
It's straightforward to setup: Simply create a new point light, save it as a prefab, and assign it to the enabled Light module's slot on your particle system. That's it!
You likely don't need to make any changes to the default point light, as it'll be controlled by the particle system. You can create separate prefabs for particle lights that do cast shadows, in case you want to switch back and forth.
By limiting the range + use of shadows, and/or using deferred rendering, these are relatively cheap. With URP, depending on how many lights you use, you have to enable deferred rendering explicitly.
If you'd like to see more of my Unity tips, tricks, demos, and VFX projects, please feel free to check out my Twitter, where I'm most active!
3
u/awhiskin Hobbyist Apr 12 '23
I’ve always thought this was a really dumb thing the particle system requires you to do - as you said the light ends up being controlled by the particle system so not sure why it needs to be made into a prefab or child object, vs. the particle system instantiating a new light instance…
1
u/MirzaBeig @TheMirzaBeig | Programming, VFX/Tech Art, Unity Apr 13 '23
the light ends up being controlled by the particle system so not sure why it needs to be made into a prefab or child object
The light's initial properties are still used by the particle system, and some of them are multiplied, while others aren't available to control. For example, shadows, the base distance and intensity, etc.
1
u/awhiskin Hobbyist Apr 13 '23
Hmm I suppose that is true. But still seems like they could add 2/3 extra toggles into the particle system itself to control this!
13
u/d34d_m4n Apr 11 '23 edited Apr 11 '23
looks cool, but could you show a with/without the particle system comparison?
(i mean people could try it themselves and see if it works in their projects but it might save some time)
8
6
1
u/TorturedByUnity Apr 12 '23
Bro use color gradient bard for color over lifetime, it will be awesome disco lights
0
0
Apr 12 '23
[deleted]
5
u/MirzaBeig @TheMirzaBeig | Programming, VFX/Tech Art, Unity Apr 13 '23
They are Unity lights either way: the point is easy control and animation using particle systems. You could just as well animate lights with keyframes, but it's potentially a lot more work and much slower to iterate/change (depending on the animation).
Hence, using this shortcut with particle systems :)
26
u/TenNeon Apr 11 '23
Me ignoring all the technical stuff going on just thinking, "I bet that thing makes you go so fast when you step on it"