Jump to content
shrowbrow

Detailed Terrain with a road cutting through it

Recommended Posts

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.

  1. How exactly did the curve snap to the underlying heightfied.
  2. 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

Share this post


Link to post
Share on other sites

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.

hf_road.jpg.faa7edb21df26e17344e9f481ad6788b.jpg

  • 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

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

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.

 terrain_roads_small.thumb.jpg.a973960d15829fd035526bac2f3cfe1a.jpg

heightfield_roads.hiplc

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×