Search Unity

Shader Replacement Example

Discussion in 'Editor & General Support' started by Nevers, Jul 17, 2009.

  1. Nevers

    Nevers

    Joined:
    May 6, 2008
    Posts:
    39
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    yes, shader replacement, as mentioned on its page, requires Unity Pro (its a render texture effect)
     
  3. Alec

    Alec

    Joined:
    Mar 11, 2008
    Posts:
    1,330
    I think that sucks, another sweet feature that I can't afford :(
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    If your project really requires it, then you will find a way to save up the money, I'm sure.
     
  5. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    and of course this does not work on iPhone - correct ?
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    thats a clear thing, the iphone, aside the 3gs, has no programmable pipeline at all
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    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
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    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
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    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 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
     
  10. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    shame over me :oops:
     
  11. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    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 ?