Refraction - GrabPass in Forward Rendering (505345)

Hi,

I am trying to create a refraction effect in Unity 4 Pro.
First, I use GrabPass for a simple transparency effect. Next, I will apply the bump refraction effect. But I have some questions.

  • What is the difference between the two GrabPass syntax ? GrabPass { } and GrabPass { “TextureName” }. I don’t get why one is optimized and the other isn’t.
  • Another important question is why GrabPass doesnt work in forward rendering ? Is there a way to implement GrabPass in forward rendering ?

Thanks a lot for your answers !

1.GrabPass without Texture parameter will be done for each rendered object which is costly.
If you set a texture, GrabPass will be done only once per frame, each object uses the shared texture which is more efficient.
2. GrabPass should work fine in forward rendering. However you have to be careful about your render queue as a GrabPass in “Geometry” might be empty as nothing was rendered before.

Thanks a lot for your answer ! But about 2. even if I change de RenderQueue greater than geometry, the GrabPass Texture is empty.

[EDIT] My bad, if you change the RenderQueue in the subshader it works.

Thanks !