bad Tangent space when using tesselation

Node-based Shader Editor

bad Tangent space when using tesselation

Postby kurzemnieks » Sat Dec 23, 2017 3:12 pm

When using View Dir (tangent space) or World to Tangent Matrix and turning on tesselation, you get zero on about half of the polygons.
I guess it's something with Vertex Shader + Tesselation ?

Is this anything possible to fix?

Thanks
kurzemnieks
 
Posts: 8
Joined: Sat Dec 23, 2017 3:08 pm

Re: bad Tangent space when using tesselation

Postby Amplify_Borba » Tue Dec 26, 2017 8:03 pm

kurzemnieks wrote:When using View Dir (tangent space) or World to Tangent Matrix and turning on tesselation, you get zero on about half of the polygons.
I guess it's something with Vertex Shader + Tesselation ?

Is this anything possible to fix?

Thanks


Hello kurzemnieks, thank you for getting in touch!

Our developers are currently taking some time off for the holidays, but rest assured that we'll get back to you as soon as possible on this matter.

Apologies for any inconvenience caused.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: bad Tangent space when using tesselation

Postby Amplify_RnD_Rick » Tue Jan 02, 2018 6:21 pm

Hey kurzemnieks,

Thank you for your patience!

First and foremost we would like to wish you an amazing year of 2018!

It's quite strange, tessellation shouldn't influence the View Dir or World To Tangent matrix values.

We did some tests on our end with some Unity native 3D objects and those values were unaltered when switching tessellation on/off (as it should).

If you are working on p.e. android it will turn black because tessellation may not be supported and it will fallback to the default diffuse shader. But on this case everything would go black, not some parts.

Is it possible for you to share your shader, or if possible share a small sample ( scene + shader + material + 3d model ) with the issue occurring?

Also can you let us know your:
- Operating System
- Unity Version
- ASE Version

We're looking forward on your reply so we can solve this as soon as possible!
Amplify_RnD_Rick
 
Posts: 40
Joined: Wed Mar 01, 2017 6:33 pm

Re: bad Tangent space when using tesselation

Postby kurzemnieks » Tue Jan 02, 2018 7:43 pm

Hmm, strange. Ok, I will try to provide sample in next few days. Platform is Windows 10, Unity 2017.2, GPU is 1080Ti.
Maybe it was a specific configuration of Unity project or something.. let's see.
Thanks!
kurzemnieks
 
Posts: 8
Joined: Sat Dec 23, 2017 3:08 pm

Re: bad Tangent space when using tesselation

Postby kurzemnieks » Tue Jan 09, 2018 10:15 am

It seems that the bug is happening only in deferred mode.
I attached the screenshot and link to simple project with stripped shaders.

tessel_bug.jpg
tessel_bug.jpg (110.74 KiB) Viewed 2649 times


Project:
https://ufile.io/sr4om
kurzemnieks
 
Posts: 8
Joined: Sat Dec 23, 2017 3:08 pm

Re: bad Tangent space when using tesselation

Postby Amplify_RnD_Rick » Tue Jan 09, 2018 10:56 am

Hey kurzemnieks,

Thank you so much for sharing the project with us.

The reason why this project in particular is acting strangely is because you have its shader render path set to forward only and you are rendering your camera in deferred.

In order for you shader to work correctly in both shader paths you need to set the Render Path option to All on your Output node properties.
Amplify_RnD_Rick
 
Posts: 40
Joined: Wed Mar 01, 2017 6:33 pm

Re: bad Tangent space when using tesselation

Postby kurzemnieks » Tue Jan 09, 2018 1:16 pm

Oh, I know why - I'm using translucency in the original full shader, and as soon as you turn on translucenty, Shader Editor sets Render Path to "Forward Only". It works fine in deferred mode (If I understand correctly - all forward shaders are just rendered in separate pass, over the deferred pass?) - except when you use turn on the tesselation and use the View Dir node.
Somehow I think this should be fixed in one way or another - because it means I can't use translucency in my case.
Thanks for looking into this!
kurzemnieks
 
Posts: 8
Joined: Sat Dec 23, 2017 3:08 pm

Re: bad Tangent space when using tesselation

Postby Amplify_RnD_Rick » Tue Jan 09, 2018 2:35 pm

No problem at all, we're here to help.

Yes, translucency only works on Forward so, if you connect something to it we automatically change the render path option.

And yes you are somewhat correct, Unity first goes through the deferred rendering path and after that it goes over the Forward rendering path.

One other example of an effect that only works on Forward is rendering semi-transparent objects.

You can see here what is possible on each of the paths:
https://docs.unity3d.com/Manual/RenderingPaths.html

Please don't hesitate on reaching us if you further questions.
Amplify_RnD_Rick
 
Posts: 40
Joined: Wed Mar 01, 2017 6:33 pm

Re: bad Tangent space when using tesselation

Postby kurzemnieks » Tue Jan 09, 2018 4:19 pm

Ok, thanks. But it means that there still is a bug - you can't use tesselation + view dir node (or World To Tangent matrix) in forward rendering only shaders when project is set to deferred mode.
kurzemnieks
 
Posts: 8
Joined: Sat Dec 23, 2017 3:08 pm

Re: bad Tangent space when using tesselation

Postby Amplify_RnD_Rick » Wed Jan 10, 2018 6:54 pm

I don't consider this to be necessarily a bug since, if you set your camera to only render in deferred then all the shaders used to work correctly on your scene must be created with either the Deferred Only or the All option on the Render Path dropdown. Otherwise there will be unexpected results ( not only with tessellation and view dir ) or the object wont be rendered at all.
Amplify_RnD_Rick
 
Posts: 40
Joined: Wed Mar 01, 2017 6:33 pm

Next

Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests

cron