+1

alpha clip

vincent 10 years ago updated by mrBeam 8 years ago 9
Although the alpha clip works a lot better than before there still seem to be some problems with the image effects. Like in the second image you see the ssao is not blocked by the plant. This seems the same with the depth of field, the plant becomes blurry (first image).Image 204Image 203
And I use forward rendering and my shader look like this. The settings are all default.
Well the problem I have with an alpha clip shader I created in Shader Forge is that is doesn't seem to work with the image effect the way the default Unity cutout shader works. As you can see in the screenshots. The shader does not render correct with the SSAO and the Depth of Field.
Did you have a look at the image effect scripts related to your problem?
I know of a slightly similar issue. SF writes 1 into the alpha channel of opaque shaders. With the legacy Glow image effect this leads to the whole scene glowing as the effect highly depends on the alpha values of the final frame buffer.
For our game I copied the Alpha threshold functionality of the legacy Glow into the newer Bloom image effect (which required changes to the image effect script, the image effect editor script and the associated postprocessing shaders) and made sure to write meaningful Alpha values into the opaque shaders once SF iterations on the object shader were done.
Maybe you'd have to do similar things for now.

See this report for more image effects related issues regarding Alpha values:
http://shaderforge.userecho.com/topic/412056-default-alpha-to-zero-in-opaque-geometry-shader/
Yes it is a possibility to adjust the image effects. I just hoped it is something that can be fixed in shader forge because basically I just use a cutout shader. So nothing to fancy. And the normal cutout shader does not have this problem. So if it cannot be fixed I will look into adjusting the image effects, thx:)
The thing is, I've tried to fix this before, and it has caused other issues to pop up instead. I don't know of a straightforward solution to this yet, because it seems to be a bit of a minefield.
Hmm that's to bad. How is it possible that the default Unity cutout shader doesn't have this problem? I have downloaded some more cutout shaders before Shader Forge and most of them have the same problems.. Hopefully you find a solution for this since I'm working on a diving game and we need a lot of plants and depth of field ;p
+3
Hi, after some test I found out that for an alpha clip shader to work properly with Image Effect's you need to multiply a Color node with the Diffuse texture and put the alpha slider to 1. This only works when the node is named 'Color' any other name does not seem to work? And the Diffuse should be called MainTex.
The only thing that still is broken comes when you use a vertex animation. Then the problem is the same as with an other bug http://shaderforge.userecho.com/topic/428362-vertex-offset-depth-buffer/ 

Hi Vincent! Did you get the vertex animation to work? Because I'm having the same problem as you =)

We're moving to Unity 5 on the next project and maybe it's resolved there.