Search - User list
Full Version: Turn On GPU Instancing on Terrain Detail Prefabs
Root » Houdini Engine for Unity » Turn On GPU Instancing on Terrain Detail Prefabs
artchapter
according to the help menu:
https://www.sidefx.com/docs/unity18.0/_terrain.html#Terrain_Scatterring [www.sidefx.com]

It does not have an option to turn on the GPU instancing for the detail prefab,
I can scatter detail prefab using: "unity_hf_detail_prototype_prefab", but I cannot turn the prefab GPU instancing on and it should be on in most cases.

https://docs.unity3d.com/ScriptReference/DetailPrototype.html [docs.unity3d.com]

I checked on the Unity scripting document for terrain details. It also do not have an optional to turn on the GPU instancing. is that impossible to turn in on by default? thank you
andylewisart
I would also like to know if it's possible to enable this property via Houdini. Am currently just enabling it manually every time I rebuild.
ctrl
Looks like this option was added on the Unity side in 2022.1
https://docs.unity3d.com/ScriptReference/DetailPrototype-useInstancing.html [docs.unity3d.com]

Would be nice to have this as an attribute on the Houdini side,
gave a shot at using the following

unity_hf_detail_prototype_useInstancing - Set a Primitive Integer attribute with a value or 1
or
unity_hf_detail_prototype_useInstancing - Set a Primitive String attribute with a value of true

but no dice.
sharksleepy123
ctrl
Looks like this option was added on the Unity side in 2022.1
https://docs.unity3d.com/ScriptReference/DetailPrototype-useInstancing.html [docs.unity3d.com]

Would be nice to have this as an attribute on the Houdini side,
gave a shot at using the following

unity_hf_detail_prototype_useInstancing - Set a Primitive Integer attribute with a value or 1
or
unity_hf_detail_prototype_useInstancing - Set a Primitive String attribute with a value of true

but no dice.

you can open houdini plugins scrips in Assets/Plugins/HoudiniEngineUnity/Scripts/Utility/HEU_TerrainUtility.cs
and add the

#if UNITY_2021_3_OR_NEWER
if (detailPrototype.renderMode == DetailRenderMode.VertexLit)
{
detailPrototype.useInstancing = true;
}
#endif

below these code

detailPrototype.dryColor = heuDetail._dryColor;
detailPrototype.healthyColor = heuDetail._healthyColor;
detailPrototype.maxHeight = heuDetail._maxHeight;
detailPrototype.maxWidth = heuDetail._maxWidth;
detailPrototype.minHeight = heuDetail._minHeight;
detailPrototype.minWidth = heuDetail._minWidth;
detailPrototype.noiseSpread = heuDetail._noiseSpread;
detailPrototype.renderMode = (DetailRenderMode)heuDetail._renderMode;


more detail is here [zhuanlan.zhihu.com].
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB