+2
Under review

Tessellation silhouette problem with Global Fog

Lionel Gallat 11 years ago updated by Freya Holmér (Developer) 11 years ago 9
There seems to be a problem with the tessellation shaders output by Shader Forge and Unity's GlobalFog.js post-effect camera script:



The displaced silhouette is not taken into account. It looks like a Z depth problem. This doesn't happen with the default Unity tessellation shaders.
Are you using deferred or forward rendering?
Forward. This time I triple-checked. ;)
I suspect the post FX itself might be forcing it to be rendered in deferred, hm. I'll have to look into this, thanks for the report :)

(The game looks neat by the way!)
Thank you! I just redid all my shaders with Shader Forge. It's so great to just drag and drop nodes and have a visual feedback right away...
Hehe, great! And yeah, visual feedback is important, which is where I thought the previous node-based shader solutions were lacking, among other things :)
Hey I just wanted to add that the problem is not exclusive to the GlobalFog script. Even without it, just using a skybox the problem is still there:



It is only compounded by using the fog script...

(I'm on Beta 0.22 and I'm in Linear color space)
A bit hard to tell what's going on there - what's the setup, and what's the easiest way for me to reproduce it starting with an empty scene?
The way to reproduce it is to:

1) Put a skybox on the game camera (to make things clearer).
2) Create a simple tessellation shader (with a height map) in SF.
3) Assign it to 2 cubes and place them next to each-other, so that only the tessellated parts nearly touch (not the cube base meshes themselves).

You should be able to see that the tessellated parts (which should fully occlude the skybox) look transparent.

And here's the shader settings I use:



Hi Joachim,

I'm sorry to be insistent but I still haven't found a way to get SF's Tessellation shaders to work with Global Fog and SSAO. As you can see on the first picture GlobalFog also affects the default tessellation shader from the demo scene so it's not just linked to my own tessellation shader.

(I added the red dots to highlight the issue)



The issue is very much compounded by the use of Unity's SSAO filter:



You can see for yourself just by opening the Shader Forge demo scene, create a camera and put GlobalFog and SSAO post effects on it:



I know you're gearing up towards 1.0 release and you are constantly being assaulted with new feature requests, but this is a very important issue for any project who wants to use Shader Forge for a DX11 game...

Thanks,
Lionel