Hi,
We have an HDA using the landscape components in UE4 as input and it scatters objects using the heightfield scatter node.
When using multiple landscape components, it only scatters correctly on one of the volumes.
I first suspected the bug is with the UE4 plugin so I ran the scene in the houdini engine debugger, in there I verified that the output from the scatter node is incorrect. I've attached a screenshot from the debug scene, showing that the scattering only works on the left part of the HF.
So, is it an known issue that the scatter node doesn't work under this kind of setup?
Thanks
Heightfield scatter node doesn't work with merged height volumes
2007 5 0- andcesaro
- Member
- 9 posts
- Joined: May 2018
- Offline
- Andr
- Member
- 900 posts
- Joined: Feb. 2016
- Offline
- andcesaro
- Member
- 9 posts
- Joined: May 2018
- Offline
- Andr
- Member
- 900 posts
- Joined: Feb. 2016
- Offline
- Andr
- Member
- 900 posts
- Joined: Feb. 2016
- Offline
Hi, the problem seems to be that when you do the merge of the 2 heightfields you end up with 2 different ‘height’ volumes with the same name.
And later on in the “adjust_by_height1” wrangle node inside the ‘scatter’, the code is trying to sample from the ‘height’ volume. You have 2 of them, but only one would be sampled from.
This is the vex code:
Solutions I can see:
1)you find a way to do an actual merge, so you end up with a single height volume.
2)Or you could rename to ‘height2’ the height volume of one of the heightfields. Then in the vex code you could put some conditionals to identify which volume to sample from (height or height2)
Given that you know the position and the size of the first volume you could replace the last line with something like:
3) There might be a even simpler way to fix your scene that I'm not aware of, since I'm not very practical with volumes handling
And later on in the “adjust_by_height1” wrangle node inside the ‘scatter’, the code is trying to sample from the ‘height’ volume. You have 2 of them, but only one would be sampled from.
This is the vex code:
vector updir = normalize(volumeindextopos(1, 'height', {0, 0, 1}) - volumeindextopos(1, 'height', {0, 0, 0})); @P -= updir * dot(@P, updir); @P += updir * dot(vector(point(1, 'P', primpoint(1, nametoprim(1, 'height'), 0))), updir); @P += updir * volumesample(1, 'height', @P);
Solutions I can see:
1)you find a way to do an actual merge, so you end up with a single height volume.
2)Or you could rename to ‘height2’ the height volume of one of the heightfields. Then in the vex code you could put some conditionals to identify which volume to sample from (height or height2)
Given that you know the position and the size of the first volume you could replace the last line with something like:
if(@P.x < 100) // 100 in case of a heightfield centered in 0, and with width of 200 { @P += updir * volumesample(1, 'height', @P); } else { @P += updir * volumesample(1, 'height2', @P); }
Edited by Andr - July 22, 2019 04:06:23
- andcesaro
- Member
- 9 posts
- Joined: May 2018
- Offline
-
- Quick Links