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

Issue transferring Terrain Layer data to Houdini in H20.5 / Unity 6 #32

Open
owenhindley opened this issue Dec 6, 2024 · 0 comments
Open

Comments

@owenhindley
Copy link

owenhindley commented Dec 6, 2024

I'm trying to make a tool where an artist can paint on a Terrain using Terrain Layers inside of Unity, assign this to an HDA, and for these maps (Splatmaps?) to appear on the HeightField alongside the height and mask volumes.

I've been unable to find a combination of Terrain Width/Height, Heightmap Resolution, Control Texture Resolution etc that doesn't throw a "Setting VolumeInfo Data : Invalid argument given: length is out of range." error when uploading the data to Houdini Engine.

I did, however manage to get it to work by editing the source (HEU_InputInterfaceTerrain.cs::UploadAlphaMaps() (line 436 on the latest version), removing this line :

alphaMapsConverted[m] = HEU_TerrainUtility.ResampleData(alphaMapsConverted[m], sizeX, sizeY, heightsSizeX, heightsSizeY);

.. which I was finding was producing a float[] that was the wrong size for the volume created a few lines earlier using CreateHeightfieldInputVolumeNode.

It looked like the HEU_TerrainUtility.ResampleData is resampling the Splatmap to the same dimensions as the heightfield (which is [power of 2] + 1 x [power of 2] + 1), but the Splatmap is just ([power of 2] x [power of 2]).

This meant that, with a splatmap of 512 x 512, Unity was telling Houdini to create a volume of dimension 512x512, but then sent it a float[] of size 513 x 513, resulting in the out of range error.

Is it possible that Unity 6's terrain system is now returning an extra heightmap of the wrong size, which makes earlier calculation of heightSizeX/Y incorrect ? Or do I simply have the wrong settings for terrain dimensions?

Here's my terrain settings for reference :

image

Thanks for the great work otherwise, this Unity->Houdini bridge is allowing us to do some amazing things, and our artists are very happy!

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