Page 1 of 1

Custom Render Texture + Vertex Positions

PostPosted: Fri Jan 18, 2019 7:26 pm
by Osteel
Hi ASE,

I have a bit of a complicated question, and I might butcher explaining what I'm trying to achieve. Essentially, we're deforming a plane and would like to generate a readable texture that maps the vertex positions onto the RGB channels to be read by a script. By doing this, we want to be able to position world objects at specific vertices by simply reading the texture's pixel values.

After some research, we did stumble across this post http://amplify.pt/forum/viewtopic.php?f=8&t=752 about how ASE now supports the use of custom render textures.

So my question is: how would you approach creating this RBG texture based on vertex positions of a plane in ASE? From there, following your existing example of how to pass it into a custom RT seems quite simple.

Thank you!

Re: Custom Render Texture + Vertex Positions

PostPosted: Mon Jan 21, 2019 4:49 pm
by Amplify_Borba
Hello!

Although I'm not entirely sure how you would build the render texture from the values, perhaps you could define min and max values of height, length and depth for each of the x, y and z coordinates in local space, and then convert those values into a range of 0 to 1 for each.