Your comments

The "Cull Off" statement in the meta pass is the issue, and that doesn't seem to be impacted by the backface culling field. In fact, it seems like you actually want to have "Cull Off" in the forward pass - not having that seems to cause the post effect shader to only work if the camera is targeting a Render Texture.

Still an issue as of SF v.134 (and Unity 5.5.1). Modifying the "Cull Off" line to be "Cull Back" does fix the issue for me, but the required manual modification to the shader code doesn't make for the smoothest Shader Forge workflow.

As far as I can tell through both looking at the profiler and directly checking material references, you can set any non-texture property of a material through MaterialPropertyBlock without giving it the PerRendererData attribute and it won't create a new instance of the material.


All of Unity's own documentation appears to be consistent with this. Unity also makes mention here of internally using MaterialPropertyBlock to set color, scale, and wind factors on tree materials, and if you go take a look at the built-in tree shaders, you'll see that they aren't using the PerRendererData attribute on any of the color/scale/wind related properties.


For the record, this is all based on what I'm seeing in Unity 5.4. I don't know if this may have been different in previous versions.

OK. After some testing, it looks like I there's a lot of inaccurate info about MaterialPropertyBlock floating around the internet, including about how the PerRendererData attribute should be used.


Apologies for the distraction.

I was under the impression that any shader property that's intended to be set through a MaterialPropertyBlock (https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html) should be given the PerRendererData attribute.


Unity will generally allow you to set any shader attribute through a MaterialPropertyBlock regardless of whether or not it has the PerRendererData attribute, but in the cases where it doesn't, I believe it will create a new material instance, essentially eliminating the benefit of using MaterialPropertyBlock. I may need to do some testing to verify that is in fact the case though.

I haven't dug too deep to try to try to solve it, but I'm having the same issue. Any post effect I put after a post effect produced in Shader Forge doesn't work properly and outputs either a black or blank screen. This occurs with both standard Unity image effects and other post effects produced in Shader Forge.


EDIT: Removing the meta pass from the shader code generated by Shader Forge corrects this issue. Not sure if there's something specific in the meta pass causing the issue or its presence in general.


EDIT 2: It seems all that's actually necessary is to either remove the "Cull Off" line from the meta pass or change it to "Cull Back".