Page 1 of 1

Using Function Nodes inside Custom Expression code box?

PostPosted: Thu Sep 27, 2018 10:31 am
by n2k
Hello,

I'm trying to create a post processing shader, for which I have created several Amplify Shader Functions and using them as nodes in my shader. I was wondering if it's possible to use/reference these in the code box or as input/output of a Custom Expression node. Or maybe I'm looking in the wrong direction, any suggestions are welcome =]

Greets,
n2k

Re: Using Function Nodes inside Custom Expression code box?

PostPosted: Thu Sep 27, 2018 10:50 am
by Amplify_Borba
Hello, thank you for getting in touch and for your support!

You're free to use use a shader function's output data as an input on a Custom Expression node and reference it in the custom code as the input port's name.

Let me know if this helps, if not, please share some additional info and a screenshot of what you've built so far so that we may best help you out, thanks!

Re: Using Function Nodes inside Custom Expression code box?

PostPosted: Thu Sep 27, 2018 11:10 am
by n2k
EDIT:
I think I found a way without using Function Nodes inside the custom expression.
If something changes I'll update this topic =]
Thanks for your response!
----

Sorry I didn't explain properly, it's more complicated.

The Function Nodes need inputs from certain values that only exist inside the custom expression, as they are in a for loop.

Re: Using Function Nodes inside Custom Expression code box?

PostPosted: Thu Sep 27, 2018 11:31 am
by Amplify_Borba
No problem, thank you for elaborating!

The only way to access values that are contained within a custom expression node is through the node's outputs.

It's possible to have several outputs in your Custom Expression node through using the Qualifier parameter of the added Inputs. Please refer to the image below:

Image

We do have a visual issue with the ports and names not showing correctly on the node itself, but they're working as expected. By setting the Qualifier to Out, the new output port continues to stay as an input port, but any values connected to that will be ignored. Also, the parameter name that you set for the Out port might not be correctly displayed on the node, which should also be ignored as it will be working internally.

Please let me know if this helps, I'll be happy to elaborate!