…works fine on PC (e.g., playing in editor) but is ignored on Android. I.e., I can comment out the line and it makes no difference on Android (Ouya, actually).
Anyone know? I’m not a shader expert so I’m not even sure I’m asking the right question…
the functionality in itself is platform-agnostic as far as i can see. Please check logcat for possible error messages (like, shader not supported, or smth like that)
I’ve got the almost same issue on Unity 4.3.4f1 with Android Pro. In editor everything works fine, but when running on real device (Samsung Galaxy S2) nothing is rendered to render texture with SetReplacementShader. Not errors in logcat. When SetReplacementShader is commented, normal scene is rendering to render texture. Could this be a bug in Unity or I’m doing something wrong?
Additional Information about setup:
There is separate camera with attaches/binded RenderTexture asset (512x512), then when normal camera is rendered, objects use this RenderTexture in theirs materials. In editor sampled color is correct, but on real device sampled color is always clearcolor, so its look like nothing is rendered.
Actually it’s a bug, do not work in latest Unity 5.2.1, the same setup and usecase as @gribbly and @MarcinM described above.
Workaround: It seems Unity can’t find reference to this shader in scene so do not want to include it in Android build. But you can assign the material with replacement shader to something in Hierachy (this object can be turned off).
This solved the problem for me.