Hello,
Im wondering if someone can help me with the Custom Expression Node. Im not sure why it is not working. Basically Im trying to use it to blend 3 textures together inside a given triangle.
Im my example I broke it down the the smallest components possible.I pass the 3 points of my triangle (a,b,c) and p (vertex position node). I calculate the barycentric coordinates(u, v, w). Then I check if p is inside my triangle by making sure the sum of u+v+w is <=1 (image has typo of * but I use +). If true I return the desired blend weigh (u,v,w) to a Weighted Blend node and a texture index to my texture array.
Im not seeing any affect, I would expect my triangle to have a different color than the surrounding triangles and have a gradient blend.
Please help I not sure if the Nodes are used correctly
Barycentric coordinates in Custom Expression Node
-
francois85
- Posts: 32
- Joined: Thu Oct 04, 2018 2:20 pm
Barycentric coordinates in Custom Expression Node
- Attachments
-
- Screen Shot 2018-10-15 at 7.39.25 AM.png (123.01 KiB) Viewed 7778 times
-
- Screen Shot 2018-10-15 at 7.35.34 AM.png (211.25 KiB) Viewed 7778 times
-
- Screen Shot 2018-10-15 at 7.18.49 AM.png (210.75 KiB) Viewed 7778 times
-
francois85
- Posts: 32
- Joined: Thu Oct 04, 2018 2:20 pm
Re: Barycentric coordinates in Custom Expression Node
Ive narrowed it down to the Custom Expression Node. Either its a bug or I have it setup wrong. In the setup below I try and return a float3 to the summed blend node weight and it renders black but when I connect the same values through a vector it works. Im I doing something wrong in the expression?
- Attachments
-
- Screen Shot 2018-10-16 at 12.19.58 AM.png (180.59 KiB) Viewed 7744 times
-
- Screen Shot 2018-10-16 at 12.12.23 AM.png (252.28 KiB) Viewed 7745 times
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Barycentric coordinates in Custom Expression Node
Hey there!
From what I can tell by the screenshots you've shared, you'll need to specify the type of the values you're assigning to the variables.
Please consider the example shared below:

In this example, I'm declaring a variable within the function's scope, "myVector", which will be returned through the Out port, and a I'm initializing the custom Out0 output as a different value.
Please let me know if this helps, thanks!
From what I can tell by the screenshots you've shared, you'll need to specify the type of the values you're assigning to the variables.
Please consider the example shared below:

In this example, I'm declaring a variable within the function's scope, "myVector", which will be returned through the Out port, and a I'm initializing the custom Out0 output as a different value.
Please let me know if this helps, 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!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
-
francois85
- Posts: 32
- Joined: Thu Oct 04, 2018 2:20 pm
Re: Barycentric coordinates in Custom Expression Node
Very helpful as alway thanks for the reply. I got confuse when the out mode created an input plug but your help got me back on track
Awesome tool love the power it give
Awesome tool love the power it give
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Barycentric coordinates in Custom Expression Node
No problem, happy to know you're having a good time with ASE!
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, every bit helps and your feedback is extremely valuable to us!
Feel free to get back in touch if you have further issues or questions, thanks!
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, every bit helps and your feedback is extremely valuable to us!
Feel free to get back in touch if you have further issues or questions, 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!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!