Gaxil / Unity-AlembicToVAT

Alembic to VAT (Vertex Animation Texture) mini tool
MIT License
283 stars 44 forks source link

Android Support #1

Open smkplus opened 4 years ago

smkplus commented 4 years ago

first of all thanks for great plugin but It don't work in android there isn't any texture compression image

Screenshot_20200528-112236_AlembicToVAT Screenshot_20200528-112738_AlembicToVAT

neonascent commented 4 years ago

Override the texture compression settings for the two textures associated with the VAT, so it doesn't fudge up the motion info by compressing the images. image

smkplus commented 4 years ago

@neonascent hey thanks I will try

smkplus commented 4 years ago

@neonascent how did you save it as texture because Gaxil / Unity-AlembicToVAT will save as .asset in

I tried to convert it to png but It work strange!

File.WriteAllBytes(finalExportPath+ExportFilename+"_position.png",  positionTexture.EncodeToPNG ());
File.WriteAllBytes(finalExportPath+ExportFilename+"_normal.png",  normalTexture.EncodeToPNG ());
alapparikh commented 4 years ago

@smkplus I'm facing the same issue. Were you able to figure this out eventually? Tried a bunch of different import settings for the PNG but no luck

smkplus commented 4 years ago

@alapparikh I tried to convert it to png but I had some problems. so I made a tool for converting Alembic on Android and it worked for me. I just set the vertex positions to mesh.

I made these with my plugin:

1

2

what kind of Alembic you have?

alapparikh commented 4 years ago

That's great! I'm not sure what you mean by what kind of Alembic, but it's exported from Oculus Quill so I need to read in the vertex positions and colours and then play it back on Android. The file has a varying number of vertices and eventually needs to run on an Oculus Quest (Android).

I modified the code in this repository to also write out the colour data per sample and it works, but the textures themselves are pretty large in size so as of now that's my main problem.

As I understand, you simply read the Alembic file at runtime on Android and set vertex positions? Or is there an intermediate step? If your plugin is open source or you're willing to share your approach in some more detail that would be amazing.

smkplus commented 4 years ago

That's great! I'm not sure what you mean by what kind of Alembic, but it's exported from Oculus Quill so I need to read in the vertex positions and colours and then play it back on Android. The file has a varying number of vertices and eventually needs to run on an Oculus Quest (Android).

I modified the code in this repository to also write out the colour data per sample and it works, but the textures themselves are pretty large in size so as of now that's my main problem.

As I understand, you simply read the Alembic file at runtime on Android and set vertex positions? Or is there an intermediate step? If your plugin is open source or you're willing to share your approach in some more detail that would be amazing.

Hi I mean what do you want to do? ok fire alembic. my plugin just works for constant vertex numbers, not for simulations I just exported array of vertex positions from alembic and I used in unity this article help you to understand the concept of VAT https://medium.com/tech-at-wildlife-studios/texture-animation-techniques-1daecb316657

can you pull request what you did? because I want to fix the problem

alapparikh commented 4 years ago

Yes sure I can make a pull request. Give me a bit. And thanks for the link.

The code isn't quite complete but you can take a look and see if it's useful to you.

smkplus commented 4 years ago

@alapparikh thank you

alapparikh commented 4 years ago

@smkplus Sorry I haven't had the time to revisit my code, but uploading my script here in case you find it useful. It essentially contains updates to also write out a colour texture asset. The files encoded in png do not work properly.

ATV_Editor.zip

smkplus commented 4 years ago

@alapparikh ok thanks I will check it