Hi,
I've been using Houdini (using regular hdas and PDG) to scatter prefabs with the unity_instance attribute on Unity terrain, but as you would expect, scattering 100 000+ prefabs in a Unity scene brings it to its knees because it create so many game objects in its scene hierarchy.
I was wondering if it would be possible to output data from Houdini Engine right into the Unity Terrain TerrainData [docs.unity3d.com], so that the points we output get picked up by Unity's native terrain.
This way, we would more efficiently scatter trees and details on terrain, and we could even use the regular painting tools to add/remove some scattered objects.
I know some plugins on the asset store like Map Magic [assetstore.unity.com] are able to spawn trees and grass, so I hope we can do the same kind of things with all the Houdini power behind it
Thanks,
Alex
Scattering Trees and Details on Unity Terrain
11251 9 5- chekboom
- Member
- 29 posts
- Joined: 3月 2015
- Offline
- seelan
- Member
- 571 posts
- Joined: 5月 2017
- Offline
That is something I can investigate. Please submit an RFE for it.
In the mean time, I wonder if you can try grouping your assets instead of creating them as individual trees (so instance sets of trees). One (experimental?) feature that Unity blogged about was hierarchical LODs which might help with something like this as well, though I don't think its supported natively yet.
In the mean time, I wonder if you can try grouping your assets instead of creating them as individual trees (so instance sets of trees). One (experimental?) feature that Unity blogged about was hierarchical LODs which might help with something like this as well, though I don't think its supported natively yet.
- javadgholami1369
- Member
- 1 posts
- Joined: 11月 2019
- Offline
it's so simple to do the thing with unity tree prefab in terrain ( you can use tree prototype to convert your data to unity standard tree prefab) check out Houdini unity plugin doc in below link it will give you the base idea of that
https://www.sidefx.com/docs/unity/_terrain.html [www.sidefx.com]
https://www.sidefx.com/docs/unity/_terrain.html [www.sidefx.com]
- Edwin88
- Member
- 5 posts
- Joined: 1月 2021
- Offline
- anthonyt2
- Member
- 100 posts
- Joined: 12月 2020
- Offline
- Edwin88
- Member
- 5 posts
- Joined: 1月 2021
- Offline
- papsphilip
- Member
- 385 posts
- Joined: 7月 2018
- Offline
- anthonyt2
- Member
- 100 posts
- Joined: 12月 2020
- Offline
For people still experiencing this problem, I added the point attribute "unity_hf_tile" in Houdini 18.5.589 to specify which tile unity_instance should be applied on: https://www.sidefx.com/docs/unity/_attributes.html [www.sidefx.com]
- pungerart
- Member
- 1 posts
- Joined: 6月 2021
- Offline
Hi,
I am learning to build terrains for a student project. I have trouble understanding the part of documentation regarding scattering objects with detailed layers. I successfully scattered trees and gave them random scale, rotation, etc. I have a nice texture and terrain layers, but I can not find any tutorial regarding this specific topic and I am not understanding well the highlighted section(by me) of the quote from the documentation. I am a beginner so I hope my question is not inappropriate. I would be thankful if somone create test network like the 1st here regarding tree protoypes.
Thank you!
I am learning to build terrains for a student project. I have trouble understanding the part of documentation regarding scattering objects with detailed layers. I successfully scattered trees and gave them random scale, rotation, etc. I have a nice texture and terrain layers, but I can not find any tutorial regarding this specific topic and I am not understanding well the highlighted section(by me) of the quote from the documentation. I am a beginner so I hope my question is not inappropriate. I would be thankful if somone create test network like the 1st here regarding tree protoypes.
papsphilip-For regular mesh you should use unity_instance attribute. unity_hf_tree_prototype could be used only on higfield/terrain.
What if its not a heightfield but a regular mesh?
it doesnt seem to work for me! Is there some attribute that is missing?
Thank you!
Detail Layers
For smaller sized environment details such as grass, shrubs, etc., height field layers can be specified to be converted to Unity terrain's detail layers for efficient drawing.
A Unity terrain detail layer contains a map of integer values that specify the number of instances for the area covered by each value in the height field. These values must be integers between 0 and 16, so the float values from the height field will be simply converted to integers as they are. For a point in the height field, a value of 0 denotes no instances, while values between 1 and 16 denote the number of desired instances for the area covered by the height point. The area covered by each height point is determined by dividing the terrain size by the Detail Resolution, which is inferred from the size of the height field layer. For example, a terrain of size 1024x1024 with the Detail Resolution of 256 means that for each height point in a detail layer, it covers a 4x4 area.
Note that the Detail Resolution cannot be set via attribute. It is inferred from the detail layer's size, which must be a square size between 0 and 4048, as required by Unity. Therefore all specified detail layers must be of the same size.
In order to use detail layers, the height field network requires setting detail properties, as described below.
Detail Layer Properties:
The height field layer to be converted to detail layer must be marked as detail type. This is done by setting a Primitive String attribute named unity_hf_layer_type on the layer with the value detail.
On the same heigthfield layer, a DetailPrototype must also be specified via the following attributes:
To use a prefab, set a Primitive String attribute named unity_hf_detail_prototype_prefab on the layer with the path to the prefab or mesh to instantiate, relative to Assets/.
Or to use a texture, set a Primitive String attribute named unity_hf_detail_prototype_texture on the layer with the path to the texture, relative to Assets/.
Optionally:
unity_hf_detail_prototype_bendfactor - Set a Primitive Float attribute with a bend factor value.
unity_hf_detail_prototype_drycolor - Set a Primitive Color (4 float) attribute with dry color value.
unity_hf_detail_prototype_healthycolor - Set a Primitive Color (4 float) attribute with healthy color value.
unity_hf_detail_prototype_maxheight - Set a Primitive Float attribute with maximum height value.
unity_hf_detail_prototype_maxwidth - Set a Primitive Float attribute with maximum width value.
unity_hf_detail_prototype_minheight - Set a Primitive Float attribute with minimum height value.
unity_hf_detail_prototype_minwidth - Set a Primitive Float attribute with minimum width value.
unity_hf_detail_prototype_noisespread - Set a Primitive Float attribute with a noise spread value.
unity_hf_detail_prototype_rendermode - Set a Primitive Integer attribute with a DetailRenderMode value of 0 for GrassBillboard, 1 for VertexLit, and 2 for Grass (Default).
Global Detail Properties:
On the height layer, the following attributes can be specified to set the detail values for the generated TerrainData:
unity_hf_detail_distance - Set a Detail Integer attribute with value from 0 to 250 for Detail Distance.
unity_hf_detail_density - Set a Detail Float attribute with value from 0 to 1 for Detail Density.
unity_hf_detail_resolution_patch - Set a Detail Integer attribute with value from 8 to 128 for Density Resolution Per Patch.
- ZReeder
- Member
- 4 posts
- Joined: 8月 2020
- Offline
pungerart
Hi,
I am learning to build terrains for a student project. I have trouble understanding the part of documentation regarding scattering objects with detailed layers. I successfully scattered trees and gave them random scale, rotation, etc. I have a nice texture and terrain layers, but I can not find any tutorial regarding this specific topic and I am not understanding well the highlighted section(by me) of the quote from the documentation. I am a beginner so I hope my question is not inappropriate. I would be thankful if somone create test network like the 1st here regarding tree protoypes.
Google brought me here because I'm having the same problem. After a couple hours I was able to (kind of) get this to work.
I'm able to make it add either a grass texture or a detail mesh, but not both at the same time. Although it does add both detail layers, and I can then manually paint them on the terrain in Unity.
I attached the HDA I came up with.
-
- Quick Links