Shader Replacement Example

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

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

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

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

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

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

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

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

Read my post again. :wink: 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 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

shame over me :sweat_smile:

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 ?