Particles sprites vs DOF

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
User avatar
Robert
Posts: 277
Joined: 21 Jan 2012, 09:25
Location: Toulouse - France
Contact:

Particles sprites vs DOF

Post by Robert » 25 Oct 2018, 13:51

Hi,

Is it possible to use DOF with sprite's particles ?

Regards,

R

User avatar
stephen
Posts: 67
Joined: 06 Aug 2013, 14:11

Re: Particles sprites vs DOF

Post by stephen » 30 Oct 2018, 09:25

Hi Robert,

yes. The Depth of Field simply uses the Depth Buffer to calculate the Amount of Blur. By default the Sprite Renderer does not write anything to the Buffer, but you can enable that in the Renderer's Material's ZBuffer Options. If "Write" is enabled it will work with DoF.

Note that this affects the Occlusion Test of the Particles so that some Particles are rendered after Particles that occlude them. This produces artifacts if you use half transparent textures on your particles. So make sure to also enable Sorting on your Sprite Renderer, to make sure the particles are rendered from the back to the front.

Best
Stephen

User avatar
Robert
Posts: 277
Joined: 21 Jan 2012, 09:25
Location: Toulouse - France
Contact:

Re: Particles sprites vs DOF

Post by Robert » 31 Oct 2018, 15:08

Hi Stephen,

Thank you very much !

Robert

Post Reply