Execution Order Problems

Node-based Shader Editor

Execution Order Problems

Postby HellGate » Wed Jan 10, 2018 3:47 pm

i was wondering how screendepth / surfacedepth can create values <0 untill i looked into the generated code.

it turns out that the surface depth is calcuated in the vertex shade before the vertex offset is applied

Example:
Code: Select all
o.eyeDepth = -UnityObjectToViewPos( v.vertex.xyz ).z;
v.vertex.xyz += float3(4,4,4);


i think this problem can occur on multiple occasions and might need some special execution priority.
(for example passing world position before and after vertex offset into the pixel shader using vertex to fragment node)
HellGate
 
Posts: 7
Joined: Wed Nov 29, 2017 3:53 pm

Re: Execution Order Problems

Postby Amplify_Borba » Thu Jan 11, 2018 11:30 am

Hello HellGate, thank you for bringing this to our attention, we're going to investigate it on our side and fix it as soon as possible!

Please don't hesitate to get back in touch if you run into any further issues, thanks!
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: Execution Order Problems

Postby Amplify_RnD_Rick » Mon Jan 22, 2018 10:22 am

Hey HellGate,

We first would like to apologize on our delay in providing you a fix.

On our latest build we added a new input port to both Surface Depth and Camera Depth Fade so you can place a custom vertex position and it will do its calculation according to that instead of the current vertex position.

You can download it over here:
https://amplify.pt/download/

So, to use Screen Depth with a custom vertex offset you can do something like this:

CustomVertexOffsetDepth.jpg
CustomVertexOffsetDepth.jpg (146.29 KiB) Viewed 1069 times


Please notice that we changed the Vertex Output option on the Node Properties from Relative to Absolute as we are specifying a final vertex position and not an offset.

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

Re: Execution Order Problems

Postby HellGate » Tue Jan 30, 2018 9:47 pm

Sorry for the late reply. The fix worked fine for me so thanks a lot for that.
HellGate
 
Posts: 7
Joined: Wed Nov 29, 2017 3:53 pm

Re: Execution Order Problems

Postby Amplify_Borba » Wed Jan 31, 2018 9:54 am

No worries, glad we could be of assistance!

Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback.

Please don't hesitate to get back in touch if you run across any further issues, thanks!
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


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests