Uw opmerkingen

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
Joachim showed me that you can already do that: just create a "PlayerPos" Vector4 property in your shader and then create a script (which you'll put on the transform with the mesh/material). That script will feed the player position to the shader in an Update function like so:

objectMeshWithTheShader.renderer.material.SetVector("_PlayerPos", playerTransform.position);

That being said if there could be a way of directly accessing a transform node (drag and drop the node the same way you can a texture asset) and have access to its Position, Rotation and Scale that would be great. But again I'm not entirely sure that would be feasible or even if it's a good idea...
It might be a very naive question, but would it be possible to have this feature also work with point lights?
> So that line fixes it in some cases, and breaks it in others. The question is in which cases does it break?

After some more tests I re-implemented the _cutoff line in the shader source (but made it visible in the inspector) and it turns out playing with the slider does not actually change the cutout transition (?!).

But if I set the slider just a pixel under the mid-point (something like 0.49) everything looks fine, but setting it to or above 0.5 triggers the problem I reported in this very thread.

> Also, is depth blending set to Alpha blended or Off? (Should be off)
It's set to Off.
Yes I am plugin the alpha channel of the main texture into the Alpha Clip port.

And for now manually removing that _cutoff line by hand every time I recompile the shader...


Well, the saga continues... I saw the last comment on this page: http://shaderforge.userecho.com/topic/305397-doubl... and so I opened my shader source code and commented out the line saying:

[HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5

And now Alpha Clip is working again (with correct depth of field and no more transparency/alpha problem)!
(Since I can't modify the post I'll just reply to it)

Update:
For now I'll switch to Unity's Ambient Obscurance post-effect (instead of SSAO), which doesn't exhibit the same problem.
Ok, I believe there might be something amiss with the way Alpha Clip works in 0.22. This is my shader with nothing in the Alpha Clip port:



And the exact same shader with the diffuse texture's alpha plugged into the Alpha Clip port:



Please note as well that this looks exactly like the tessellation problem I mentioned before (http://shaderforge.userecho.com/topic/372272-tesse...), although no tessellation is involved in this shader.

Another telling symptom on the second picture is the fact that depth of field is much too strong (same setting on both pictures though); it really feels like Unity's getting confused as to the real distance at which the sphere is.