We have already seen how to apply gradient ascent, descent and contour lines to heightfield like planar geometry. The same concept can be applied to heightfields.

Because heightfields are volumes, getting the gradient is very easy by using the volumegradient function. The normal of a heightfield is (0, 1, 0) if the heightfield is an XZ volume, meaning facing up. Getting the cross product of both of these vectors will give you the contour lines.



Senior FX Technical Director @ Industrial Light & Magic | Feature film credits include The Lord of the Rings: The Rings of Power, Marvel's Eternals, Star Wars: The Rise of Skywalker, X-Men: Dark Phoenix, X-Men: Apocalypse, Aquaman, Alien: Covenant, Pirates of the Caribbean, Justice League and many more.

More from Yunus Balcioglu


  • There are currently no comments

Please log in to leave a comment.