TerrainLayer in Unity is not fully opaque

   5389   12   1
User Avatar
Member
169 posts
Joined: April 2014
Offline
We're bringing in a heightfield from Houdini into Unity and assign a .terrainlayer.

It is set via the attribute “unity_hf_terrainlayer_file”.

It keeps coming in at around 50% opacity. If you look at the screenshot below, you can see where we painted in Unity using the brush (right) and it's 100% opacity, and the terrain layer coming in from Houdini which comes in at reduces opacity and blends with what's underneath.



At first we put down a Heightfield Remap to ‘normalize’ the layer in question. But that doesn't help.

Then we used a Volume Wrangle to set mask (before copying it to layer) so that values falling under 0.5 are set 0 and above that to 1.

if (@mask < 0.5)
{
    @mask = 0;
}
else
{
    @mask = 1;
}



That doesn't work either.

Checking the docs for attributes that we have to set in order to get a proper opacity doesn't yield anything either.
https://www.sidefx.com/docs/unity/_attributes.html#AttributesInput_Heightfields [www.sidefx.com]

What is it that we should do in either Unity or Houdini in order to control opacity?

Initially we thought the mask (layer) original opacity controls the opacity in Unity.

Thank you
Edited by firefly9000 - July 10, 2019 17:37:16

Attachments:
h.JPG (36.4 KB)

Winter is coming!
User Avatar
Member
8 posts
Joined: Jan. 2019
Offline
Believe I'm getting this too. Have a base grass layer then add a rock layer on top and its getting green tint from the grass in Unity
User Avatar
Member
29 posts
Joined: Sept. 2017
Offline
Can you both read the alphamaps at a position without full opacity and paste them here? The default unity terrain shader blends all the alphamaps according to their values. I would start there with debugging.
User Avatar
Member
29 posts
Joined: Sept. 2017
Offline
I added more textures to my terrain and now i have some strange effects, too. There is some grass where it shouldn't be:





Is there a feature to show the masks value for a given coordinate in houdini? Should help debug those texture issues.
Edited by daschatten - July 11, 2019 08:26:36

Attachments:
Houdini - Texture Test 04.png (816.9 KB)
Houdini - Texture Test 05.png (3.1 MB)
Houdini - Texture Test 06.png (23.2 KB)

User Avatar
Member
571 posts
Joined: May 2017
Offline
I believe Unity's default terrain shader expects the weights of all splatmaps in the Terrain to sum up to 1 at any coordinate. This is why it is recommended to normalize your non-height and non-mask heightfield layers in Houdini, and have them all sum up to 1.

Note the Houdini mask layer is completely ignored from Houdini 17.5.302 onwards.

There is a strength setting in the HDA's Inspector UI Terrain section for each splatmap layer. This applies a multiplier to each of the splatmap generated from a heightfield layer. Leave this at 1 if you don't want to change your values from Houdini.

After generating the terrain via the cook, if you add a new TerrainLayer and paint on it, you are applying additional weights. This could be causing some issues. Try testing with just the the splatmaps being generated. Perhaps use a custom debug shader in Unity to show the splatmap values directly.

In Houdini, you can use a Heightfield Isolate Layer to see the individual layers.

If there are issues, submit a bug with an hda to reproduce the problem. Thanks.
User Avatar
Member
169 posts
Joined: April 2014
Offline
seelan
I believe Unity's default terrain shader expects the weights of all splatmaps in the Terrain to sum up to 1 at any coordinate. This is why it is recommended to normalize your non-height and non-mask heightfield layers in Houdini, and have them all sum up to 1.

Note the Houdini mask layer is completely ignored from Houdini 17.5.302 onwards.

There is a strength setting in the HDA's Inspector UI Terrain section for each splatmap layer. This applies a multiplier to each of the splatmap generated from a heightfield layer. Leave this at 1 if you don't want to change your values from Houdini.

After generating the terrain via the cook, if you add a new TerrainLayer and paint on it, you are applying additional weights. This could be causing some issues. Try testing with just the the splatmaps being generated. Perhaps use a custom debug shader in Unity to show the splatmap values directly.

In Houdini, you can use a Heightfield Isolate Layer to see the individual layers.

If there are issues, submit a bug with an hda to reproduce the problem. Thanks.

Thank you for the help. This was easily fixed in Vex. The confusion stemmed from watching a tut like the one Kenny Lammers made where he just gets the textures inside Unity correctly by default… so we assumed we were doing something wrong.

Still a bit unsure how he did it though without Vex or a Volume Wrangle

Thanks again

Attachments:
h.JPG (74.9 KB)

Winter is coming!
User Avatar
Member
571 posts
Joined: May 2017
Offline
Kenny's tutorial was using an older version of the plugin (17.5 launch build), so the Unity plugin was doing different things back then. The recent changes have improved and changed the workflow, thanks to feedback from some users.
User Avatar
Member
29 posts
Joined: Sept. 2017
Offline
seelan
If there are issues, submit a bug with an hda to reproduce the problem. Thanks.

I filed a bug report as i suspect issues in splatmap conversion, have no bug id yet. I attached a HDA and a unity project showcasing the issue.
User Avatar
Member
75 posts
Joined: Feb. 2017
Offline
seelan
There is a strength setting in the HDA's Inspector UI Terrain section for each splatmap layer.

I can't seem to find this.. I don't have the section that is shown in the documentation. Is it possible that this isn't in the linux build?
User Avatar
Member
8 posts
Joined: Jan. 2019
Offline
I'm still getting a green (grass) tint to the other layers, not sure if its something I'm doing wrong or not though. You can see the difference when I manually paint over it directly in Unity.

Attachments:
Screen Shot 2019-07-12 at 1.52.22 AM.png (4.0 MB)
TerrainTesting.hip (354.5 KB)

User Avatar
Member
29 posts
Joined: Sept. 2017
Offline
rhamm1320
I'm still getting a green (grass) tint to the other layers, not sure if its something I'm doing wrong or not though. You can see the difference when I manually paint over it directly in Unity.
This happens because you have this red ground layer (=grass) everywhere. Your other layers are just added. So on a random position in the blue box you have grass set to some value and sand set to some value. The default unity terrain shader just blends the available layers -> You have this green touch. You should subtract the green and blue layers from the red one.
User Avatar
Member
28 posts
Joined: June 2019
Offline
firefly9000
seelan
I believe Unity's default terrain shader expects the weights of all splatmaps in the Terrain to sum up to 1 at any coordinate. This is why it is recommended to normalize your non-height and non-mask heightfield layers in Houdini, and have them all sum up to 1.

Note the Houdini mask layer is completely ignored from Houdini 17.5.302 onwards.

There is a strength setting in the HDA's Inspector UI Terrain section for each splatmap layer. This applies a multiplier to each of the splatmap generated from a heightfield layer. Leave this at 1 if you don't want to change your values from Houdini.

After generating the terrain via the cook, if you add a new TerrainLayer and paint on it, you are applying additional weights. This could be causing some issues. Try testing with just the the splatmaps being generated. Perhaps use a custom debug shader in Unity to show the splatmap values directly.

In Houdini, you can use a Heightfield Isolate Layer to see the individual layers.

If there are issues, submit a bug with an hda to reproduce the problem. Thanks.

Thank you for the help. This was easily fixed in Vex. The confusion stemmed from watching a tut like the one Kenny Lammers made where he just gets the textures inside Unity correctly by default... so we assumed we were doing something wrong.

Still a bit unsure how he did it though without Vex or a Volume Wrangle

Thanks again
Image Not Found


Could someone elaborate how this problem was fixed? I am facing the same issue but unsure of the solution.

Thanks
User Avatar
Member
9 posts
Joined: Oct. 2018
Offline
I'm also at the same spot

Sadly I do not find any instructions to clearly manage several HEU layers on Unity.
  • Quick Links