Custom expression gets optimized away. Bug?/Feature request

Node-based Shader Editor

Custom expression gets optimized away. Bug?/Feature request

Postby vector3 » Tue Dec 04, 2018 4:11 pm

Hi,

I encountered an incorrect behaviour in shader compilation:

I have a custom expression implementing the clip() function. The custom expression's mode is set to "Call".
If I now do NOT connect the output of the custom expression (in-)directly to the master node, the whole custom expression graph gets compiled away for the final shader file.

I guess the logic behind this is that nodes, that are not somehow connected to the master node, are treated as non-relevant and therefore get stripped.

To avoid this incorrect behaviour, can you please add a setting that lets us mark nodes as "relevant"? Relevant nodes then should not get optimized away no matter what.


Cheers.
vector3
 
Posts: 3
Joined: Tue Dec 04, 2018 1:51 pm

Re: Custom expression gets optimized away. Bug?/Feature requ

Postby Amplify_Borba » Mon Dec 10, 2018 12:09 pm

Hello, unfortunately we can only auto-register the Custom Expression node in order to register functions.

In call mode, we must know where to inject the code, be it somewhere in the fragment or in the vertex shader, so it must be connected to the node graph.

In this specific situation, could you consider using the Clip node rather than a Custom Expression?
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