# Depth of Field - not include certain objects

**URL:** https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891
**Category:** Post-Processing
**Tags:** Scripting
**Created:** [September 10, 2009, 7:55pm UTC](https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891 "2009-09-10T19:55:00Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![DigitalAdam](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/digitaladam/32/193131_2.png) [@DigitalAdam](https://discussions.unity.com/u/DigitalAdam)
#### Post date: [September 10, 2009, 7:55pm UTC](https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891/1 "2009-09-10T19:55:00Z")

</div>

Is there a way to use the Depth of Field scripts in the example project but allow certain objects to not be effected by it? I don’t want the DOF to effect the skybox.

Thanks!

---

<div class="post-metadata">

### Author: ![jmunozar](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jmunozar/32/44194_2.png) [@jmunozar](https://discussions.unity.com/u/jmunozar)
#### Post date: [September 10, 2009, 11:36pm UTC](https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891/2 "2009-09-10T23:36:21Z")

</div>

Hello!

We need kinda more info 😛 Which example project are you referring to?, what does it means DOF? 🙂

---

<div class="post-metadata">

### Author: ![DigitalAdam](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/digitaladam/32/193131_2.png) [@DigitalAdam](https://discussions.unity.com/u/DigitalAdam)
#### Post date: [September 10, 2009, 11:52pm UTC](https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891/3 "2009-09-10T23:52:56Z")

</div>

This would be in the Shader Replacement examples. And DOF mean Depth of Field. 🙂

---

<div class="post-metadata">

### Author: ![anon\_34881616](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@anon\_34881616](https://discussions.unity.com/u/anon_34881616)
#### Post date: [November 4, 2009, 11:36am UTC](https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891/4 "2009-11-04T11:36:40Z")

</div>

> [@""](#):
>
> Hello!
> 
> We need kinda more info 😛 Which example project are you referring to?, what does it means DOF? 🙂

A technical writer does not know what DOF means? :shock:

DOF in Unity is found in the shader replacement but I hate it!!! It is too puny for Alphas (whether cutout style or blended)

---

<div class="post-metadata">

### Author: ![SrBilyon](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/srbilyon/32/327544_2.png) [@SrBilyon](https://discussions.unity.com/u/SrBilyon)
#### Post date: [August 15, 2010, 10:52pm UTC](https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891/5 "2010-08-15T22:52:37Z")

</div>

BUMP (I would like to know the answer for this also…)

---

<div class="post-metadata">

### Author: ![divone](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@divone](https://discussions.unity.com/u/divone)
#### Post date: [September 29, 2010, 1:15pm UTC](https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891/6 "2010-09-29T13:15:55Z")

</div>

Hi,

I have exactly the same problem there… Does anyone have a solution ?

---

<div class="post-metadata">

### Author: ![anon\_24886461](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@anon\_24886461](https://discussions.unity.com/u/anon_24886461)
#### Post date: [September 30, 2010, 8:00am UTC](https://discussions.unity.com/t/depth-of-field-not-include-certain-objects/397891/7 "2010-09-30T08:00:48Z")

</div>

hey,

the skybox is at max depth. so you could for instance early out in the shader that computes the “bluriness” factor (aka “coc”) if you encounter something at maximum depth.

have a look at the 3.0 std assets / image effects (shader: “PreDepthOfField”) and add something like “if(d\>0.9999) return 0;” to see the effect …

ole
