Custom expression gets optimized away. Bug?/Feature request

Node-based Shader Editor
Post Reply
vector3
Posts: 3
Joined: Tue Dec 04, 2018 1:51 pm

Custom expression gets optimized away. Bug?/Feature request

Post by vector3 »

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.
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

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

Post by Amplify_Borba »

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!
Post Reply