Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include NativeArray in custom VoxelDataGenerator #60

Closed
ZeroByter opened this issue Jan 28, 2022 · 1 comment
Closed

Include NativeArray in custom VoxelDataGenerator #60

ZeroByter opened this issue Jan 28, 2022 · 1 comment

Comments

@ZeroByter
Copy link

Hello, I am currently writing my own data generator which will generate the marching cubes data based off a pre-made model.

I am planning to accomplish this by first scanning the model in a seperate Unity scene, writing all the float data values to a file, and then at a seperate time, loading the values from the asset file and passing the floats data to the generator.

I am passing the float data as a NativeArray<float>.

So finally, my question: how to dispose of the NativeArray I created after the job is completed?

PS. Yes, I realize I am sort of creating an unnecessary step here by loading the float data to a multi-threaded job, only to return that same data, but at the moment I don't see another way of generating the marching cubes from a model.

@ZeroByter
Copy link
Author

Nevermind, I looked at the heightmap data generator and used that as inspiration for how to properly create/dispose a NativeArray.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant