Page 1 of 1

Custom expression gets optimized away. Bug?/Feature request

PostPosted: Tue Dec 04, 2018 4:11 pm
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.

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

PostPosted: Mon Dec 10, 2018 12:09 pm
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?