# Shader Replacement Example

**URL:** https://discussions.unity.com/t/shader-replacement-example/394997
**Category:** Shaders & Materials
**Created:** [July 17, 2009, 3:10am UTC](https://discussions.unity.com/t/shader-replacement-example/394997 "2009-07-17T03:10:10Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Nevers](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@Nevers](https://discussions.unity.com/u/Nevers)
#### Post date: [July 17, 2009, 3:10am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/1 "2009-07-17T03:10:10Z")

</div>

Hi, I’m trying to use the shader replacement example ([Unity - Manual: Replacing shaders at runtime](http://unity3d.com/support/resources/example-projects/shader-replacement)) and i’m not seeing anything happen. Do i need the pro version to see these effects?

---

<div class="post-metadata">

### Author: ![Dreamora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dreamora/32/91058_2.png) [@Dreamora](https://discussions.unity.com/u/Dreamora)
#### Post date: [July 17, 2009, 6:51am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/2 "2009-07-17T06:51:57Z")

</div>

yes, shader replacement, as mentioned on its page, requires Unity Pro (its a render texture effect)

---

<div class="post-metadata">

### Author: ![Alec](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@Alec](https://discussions.unity.com/u/Alec)
#### Post date: [July 17, 2009, 6:59am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/3 "2009-07-17T06:59:36Z")

</div>

I think that sucks, another sweet feature that I can’t afford ☹

---

<div class="post-metadata">

### Author: ![Dreamora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dreamora/32/91058_2.png) [@Dreamora](https://discussions.unity.com/u/Dreamora)
#### Post date: [July 17, 2009, 7:02am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/4 "2009-07-17T07:02:51Z")

</div>

If your project really requires it, then you will find a way to save up the money, I’m sure.

---

<div class="post-metadata">

### Author: ![spacefrog](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/spacefrog/32/85920_2.png) [@spacefrog](https://discussions.unity.com/u/spacefrog)
#### Post date: [July 17, 2009, 7:29am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/5 "2009-07-17T07:29:11Z")

</div>

and of course this does not work on iPhone - correct ?

---

<div class="post-metadata">

### Author: ![Dreamora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dreamora/32/91058_2.png) [@Dreamora](https://discussions.unity.com/u/Dreamora)
#### Post date: [July 17, 2009, 7:30am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/6 "2009-07-17T07:30:01Z")

</div>

thats a clear thing, the iphone, aside the 3gs, has no programmable pipeline at all

---

<div class="post-metadata">

### Author: ![Eric5h5](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/eric5h5/32/44225_2.png) [@Eric5h5](https://discussions.unity.com/u/Eric5h5)
#### Post date: [July 17, 2009, 7:46am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/7 "2009-07-17T07:46:55Z")

</div>

Shader replacement doesn’t use render textures, and in fact it’s nothing you can’t do manually yourself by going through all objects and changing shaders on pre/post render, but it makes things a lot easier. However most of the examples use render textures to do those particular effects (but not all–I think Show UV Mapping should work on Indie, for example). I haven’t tried it, but it should work on the iPhone as long as you don’t use features not present on the iPhone (such as rendertextures).

–Eric

---

<div class="post-metadata">

### Author: ![Dreamora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dreamora/32/91058_2.png) [@Dreamora](https://discussions.unity.com/u/Dreamora)
#### Post date: [July 17, 2009, 7:57am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/8 "2009-07-17T07:57:59Z")

</div>

sure that they don’t use rendertextures?  
I’m pretty sure that some of them like the dof and color effects use render textures.  
i’m not near my unity box so I can’t check the sample project though

---

<div class="post-metadata">

### Author: ![Eric5h5](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/eric5h5/32/44225_2.png) [@Eric5h5](https://discussions.unity.com/u/Eric5h5)
#### Post date: [July 17, 2009, 8:54am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/9 "2009-07-17T08:54:13Z")

</div>

Read my post again. 😉 Most of them use rendertextures, like I said, but it’s not necessary to use them. Should work on the iPhone if you don’t use features not present there.

OK, just tried it: “Show RenderTypes” shader replacement works fine on the iPhone, as long as you don’t include the terrain stuff naturally. That would also work in Unity Indie. As the note says, it’s not very useful by itself, but it does show how it’s used. [This](http://forum.unity3d.com/viewtopic.php?t=4575&start=9) is something that could be done with shader replacement…perhaps not much point in this particular case given how simple it is, but that’s the general principle.

–Eric

---

<div class="post-metadata">

### Author: ![Dreamora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dreamora/32/91058_2.png) [@Dreamora](https://discussions.unity.com/u/Dreamora)
#### Post date: [July 17, 2009, 9:10am UTC](https://discussions.unity.com/t/shader-replacement-example/394997/10 "2009-07-17T09:10:33Z")

</div>

> [@""](#):
>
> Read my post again. 😉 Most of them use rendertextures, like I said, but it’s not necessary to use them. Should work on the iPhone if you don’t use features not present there.

shame over me 😅

---

<div class="post-metadata">

### Author: ![MaT227](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@MaT227](https://discussions.unity.com/u/MaT227)
#### Post date: [December 24, 2014, 1:47pm UTC](https://discussions.unity.com/t/shader-replacement-example/394997/11 "2014-12-24T13:47:16Z")

</div>

Hi @Eric5h5 and @Dreamora  
I’ve just read what you said and I am quite interested. I would like to know how can I use shader replacement with Unity free. From what I’ve tested, it seems that I need to assign a targetTexture on my camera to see the replacement shader. But maybe I am missing something, could you provide an example which might work ?
