Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

Hi everyone! πŸ‘‹

The second part of the tutorial series about topographical maps in Unity is finally out! This article will cover the edge detection, which is the first step necessary to create real-time maps:

This is a technique that shares a lot of similarities with games such as "Sable" and "Bird Alone" (below):

The source code and resources are also available for download to all $25+ patrons here.

As always, thank you for your support and feel free to get in touch if you have any question!

πŸ™

πŸ§”πŸ»

Files

Previews only

Topographical Maps in Unity: Edge Detection - Alan Zucconi

This tutorial will teach you how to recreate a very popular effect in games: topographical maps. This is a two-part series, which will cover all the necessary aspects-from the Maths to the shader code-to make this possible: In this second part, we will focus on the edge detection algorithm that will be used to draw the contours of the terrain.

Comments

Tom Kail

This is wonderful! I'm using an adapted version of this to render gravitational fields. I had a question though - what's the best way to control line thickness with this approach?

Alan Zucconi

Hi! πŸ‘‹ It's... tricky! πŸ˜… Because technically speaking, those are not lines! The shader has no idea that there are lines, as they only work at the pixel/fragment level. So for a well defined edge, you should get a line of 1 or 2 pixels. If you want it to be bigger, the best thing is to use a second level of postprocessing to "expand" on that line. For instance, any black pixel nearby a white pixel becomes white. And this effectively makes all lines one pixel thicker. There are probably more esoteric solutions, but this is pretty easy to code given the existing scripts!