shrowbrow Posted May 3, 2020 Share Posted May 3, 2020 Hello everyone, I am a native Maya user and currently I am working on a project which needs a massive terrain and a road cutting through it. I have found the following tutorial the result of which is exactly what I need, but it's a bit difficult for me to understand given my level of knowledge of Houdini. https://galaxy.works/houdini-procedural-roads/ If someone can breakdown the following steps for me, that would be wonderful. How exactly did the curve snap to the underlying heightfied. How exactly was the road ribbon created so that the y axis always point straight up and doesn't twist which it changes direction. Thanks Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 3, 2020 Share Posted May 3, 2020 Hi ShrowBrow, ideally roads and height fields mutually affect each other. So you would sample off the terrain's height, smooth it along the curve and blend it back to the terrain. Sampling height values from the height field (with an option to lift or sink the road): float lift = chf('lift'); f@h = volumesample(1, 'height', v@P) + lift; Smoothing the sampled height attribute: Attribute blur node Blending the smoothened height values into the height field: float width = chf('width'); float padding = chf('padding'); float ro = chf('rolloff'); int prim_hit; vector uvw_hit; float dist = xyzdist(1, v@P, prim_hit, uvw_hit); float height_curve = primuv(1, 'h', prim_hit, uvw_hit); float blend = smooth(width, width + padding, dist, ro); f@height = lerp(height_curve, f@height, blend); //f@mask = 1.0 - blend; heightfield_road.hipnc 2 2 Quote Link to comment Share on other sites More sharing options...
shrowbrow Posted May 3, 2020 Author Share Posted May 3, 2020 Awesome, it looks great. It will take me some time to digest it Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted February 8, 2021 Share Posted February 8, 2021 A more elaborate example for cutting roads through height fields: Identifies flat areas for settling locations Connects them to a road network Bends and resamples paths into avoiding slopes Smoothes out height variations and blends them into the terrain. heightfield_roads.hiplc 1 2 Quote Link to comment Share on other sites More sharing options...
vinyvince Posted March 28, 2022 Share Posted March 28, 2022 @konstantin magnus Heightfield distort is an expansive node, Konstantin im Wonder did you have a try to find a cheap and efficient alternative in Vex? Sliding the mask on the 2d volume according to a noise.. Quote Link to comment Share on other sites More sharing options...
vinyvince Posted March 28, 2022 Share Posted March 28, 2022 (edited) @konstantin magnus Also not related to my previous question, I also still puzzled, for your meander part, this is your code, and second picture is more what i will do myself, did i miss something Konstantin? cheers and second picture My way Edited March 28, 2022 by vinyvince Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.