Matrix Array in custom expression for

Node-based Shader Editor

Matrix Array in custom expression for

Postby HammerCG » Tue Aug 21, 2018 12:16 pm

Hi, i need to send and array of matrix4x4 from script to shader and then pass it to a custom expression and use in "for" bucle.
I send with " oceanMat.SetMatrixArray(waves_shaderPropertyID, matrixGerstnerWaves); "
and shader have his global array node.
ok,no error,i think its correct.

Well the problem its to use in custom expresion,i want connect this array to custom expresion and then use it like

for(int i = 0; i<matrixArray.Lenght;i++){
float4x4 matrix = matrixArray[i];
matrix[0][0]
matrix[1][0]
matrix[2][0]
etc....
}

Then the question is, how i can connect array to a custom expresion, i dont find any compatible type in custom Expression node, i try custom type with no results.
For iterance limit in "for" bucle i can manage in other ways sending extra "int",but i dont know hoy connect the array to use in custom expresion

Thanks, sorry for my english, its low.
HammerCG
 
Posts: 2
Joined: Tue Aug 21, 2018 12:01 pm

Re: Matrix Array in custom expression for

Postby Amplify_Borba » Tue Aug 21, 2018 4:03 pm

Hello, thank you for getting in touch and for your support!

Unfortunately, it's not possible to pass arrays into custom expression nodes at this time, but you did raise an interesting point and we'll definitely investigate for a possible workaround for this.

Hopefully we'll have a working solution ready in the next build and will get back in touch with you through this post!
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

Re: Matrix Array in custom expression for

Postby HammerCG » Tue Aug 21, 2018 9:25 pm

Hey! hi,thanks for answer, good to hear,any improvements are welcome.

I manage a workaround that fits my goal.

Simply, globalArrayNode--->breakComponentsNode, just take one value---->multiplyNode by zero ----> AddNode to something( adding zero,no effects)

With that i get ASE compiling globalArray variable into shader, then i can get the variable from custom expression without problems

I create the globalArrayNode with max Lenght, 16 in my case its enought,put an [unroll(16)] before "for" in my custom expresion, and pass "int" to determine iterations,never excess the max lenght,and its ok if its below for low quality.

Again sorry if my english its low :)
Attachments
Sin título-1.jpg
Sin título-1.jpg (142.46 KiB) Viewed 1050 times
HammerCG
 
Posts: 2
Joined: Tue Aug 21, 2018 12:01 pm

Re: Matrix Array in custom expression for

Postby Amplify_Borba » Wed Aug 22, 2018 8:56 am

That's an interesting workaround that you've come up with, thank you for sharing it with us!

Nevertheless, we're still going to try and find an easier solution that allows for this type of operations, we'll be sure to get back in touch as soon as we do!
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

Re: Matrix Array in custom expression for

Postby Amplify_Borba » Thu Nov 22, 2018 4:57 pm

Hello, I'm getting back in touch to let you know that we've recently added several improvements to the 'Global Array' node, including the addition of a 'Auto Register' parameter to allow passing Arrays into Custom Expressions

Feel free to download the latest ASE build from our website and let us know if you come across any issues, 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!
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