We may earn an affiliate commission when you visit our partners.
Jenny Hide

Learn how to procedurally generate meshes in Unity 5.6 or above. You'll start with simple shapes and work your way up to complex, fractal landscapes. This is a code-along style course where you'll learn how program meshes at each stage.

Learn, Understand and Master Procedural Generation with this Intermediate Unity Course.

Read more

Learn how to procedurally generate meshes in Unity 5.6 or above. You'll start with simple shapes and work your way up to complex, fractal landscapes. This is a code-along style course where you'll learn how program meshes at each stage.

Learn, Understand and Master Procedural Generation with this Intermediate Unity Course.

  • Learn about the different properties of a mesh.

  • Create two and three dimensional shapes.

  • Calculate UVs, normals, tangents and vertex colours.

  • Understand how to use Perlin and fractal noise to generate 2D terrain and 3D landscapes.

  • Learn how to program large and infinite landscapes for you game.

A powerful tool for making games.

In this course, you will learn to procedurally generate meshes from geometric objects to worlds with randomly generated terrain. Many popular games use some form of procedural generation, from Minecraft to Dwarf Fortress. Mesh generation is just one aspect of procedural generation which encompasses topics such as texture generation, object placement, and even story generation.

By the end of this course, you’ll be able to generate unique and impressive landscapes from code ready to use in your games. Source code is included to help you on your way.

I designed this course to be easily understood by intermediate level coders and users of Unity with no previous experience of mesh generation.

I present examples of increasing difficulty designed to help you to understand exactly how mesh generation is done, and guide you through the theory behind it so that you can be confident in creating your own meshes.

For extra support, you can ask questions in the Q&A section, and I’ve provided the completed code examples for download in each Section. You’ll receive a certificate of completion once you finish the course.

Enroll now

What's inside

Learning objectives

  • Use unity to generate complex meshes from code.
  • Create realistic looking landscapes with perlin and fractal noise.
  • Program two and three dimensional shapes.
  • Procedurally generate meshes for both 2d terrain and 3d landscapes.
  • Use your knowledge of meshes to add vertex colours, and calculate uvs, normals and tangents.

Syllabus

Introduction

An introduction to meshes and how they are coded in Unity - get a basic understanding of how things work!

All the Triangles
Read more

Begin to code!

Coding the triangular mesh.

Understand backface culling. Add flexible normals to the triangle model.

More 2D Shapes

Create an abstract base class to make mesh creation easier and your code tidier.

Coding the quad mesh with shared vertices.

Coding the quad mesh with unique vertices.

Coding a general mesh for all regular polygons.

All The Tetrahedrons

Coding a tetrahedron with shared vertices.

Adding a script to display a mesh's normals.

Coding a tetrahedron with unique vertices.

More 3D Shapes

Coding a 3D quad - create any 3D shape with 8 vertices.

Coding any regular prism or frustum.

Adding vertex colours.

Learn how to make a simple shader that will show the vertex colours.

A challenge to test your skills.

UVs

Add simple UVs to the quads we coded in Section 3 so that we can use textured materials.

Add UVs to the regular polygons we coded in Section 3 so that we can use textured materials.

Add UVs to the prisms and frustums we coded in the previous section so that we can use textured materials.

Normals and Tangents

Manually code normals for the regular polygons.

Code tangents for the regular polygons to display materials with normal maps correctly.

Manually code normals for the prisms and frustums.

Code tangents for the prisms and frustums.

Learn the theory behind calculating normals and tangents for any shape.

Coding normals for any shape.

Coding tangents for any shape.

Noise

A quick introduction to using Perlin noise in Unity.

Coding fractal and fBm noise in Unity.

2D Procedural Terrain Generation

Learn how to code a simple, flat, 2D terrain.

Learn how to code make a mesh look like 2D terrain using noise.

Add simple UVs to the terrain and add a texture.

Learn how to code more complex UVs so that a material's texture follows the direction of the landscape.

Procedural Landscape Generation

Code a mesh for a 3D landscape.

Add UVs and vertex colours to the 3D landscape.

Learn how to code fractal island meshes.

Learn how to code fractal island meshes with a low poly look.

Infinite Landscapes

Learn how to create the mesh in chunks for an infinite terrain.

Learn how to calculate the normals correctly for adjacent chunks of terrain.

Learn how to calculate the tangents correctly for adjacent chunks of terrain.

Bonus

A bonus lecture containing £9.99/$9.99 codes for my other courses.

Save this course

Save Coding in Unity: Mastering Procedural Mesh Generation to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Coding in Unity: Mastering Procedural Mesh Generation with these activities:
Review Unity Fundamentals
Solidify your understanding of Unity's core concepts before diving into procedural mesh generation. This will make it easier to grasp how meshes interact with the Unity environment.
Show steps
  • Review Unity's interface and basic components.
  • Practice creating simple scenes and objects.
  • Familiarize yourself with C# scripting in Unity.
Review 'Unity in Action, Third Edition'
Gain a broader understanding of Unity's capabilities and best practices. This will help you integrate procedural mesh generation into larger game projects.
Show steps
  • Read the chapters related to scripting and game object manipulation.
  • Experiment with the code examples provided in the book.
  • Try to apply the concepts learned to your own projects.
Implement Basic Mesh Shapes
Reinforce your understanding of mesh creation by implementing basic shapes from scratch. This hands-on practice will solidify the concepts covered in the course.
Show steps
  • Create a new Unity project.
  • Write scripts to generate a cube, sphere, and cylinder mesh.
  • Experiment with different vertex positions and triangle indices.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Document Mesh Generation Techniques
Deepen your understanding by creating a comprehensive guide to mesh generation techniques. This will force you to organize your knowledge and explain the concepts in a clear and concise manner.
Show steps
  • Choose a specific mesh generation technique (e.g., Perlin noise).
  • Research the technique and gather relevant information.
  • Write a detailed explanation of the technique, including code examples.
  • Create diagrams or illustrations to visualize the concepts.
Procedural Terrain Generator Project
Apply your knowledge to create a fully functional procedural terrain generator. This project will challenge you to integrate different mesh generation techniques and optimize your code for performance.
Show steps
  • Design the features of your terrain generator (e.g., heightmaps, textures).
  • Implement the core mesh generation algorithms.
  • Add features such as texturing, lighting, and collision detection.
  • Optimize your code for performance and scalability.
Review 'Mathematics for 3D Game Programming and Computer Graphics, Third Edition'
Strengthen your understanding of the mathematical principles behind mesh generation. This will enable you to develop more sophisticated and efficient algorithms.
Show steps
  • Review the chapters on linear algebra and geometry.
  • Study the examples related to transformations and coordinate systems.
  • Try to apply the mathematical concepts to your mesh generation projects.
Contribute to a Mesh Generation Library
Enhance your skills by contributing to an open-source mesh generation library. This will expose you to real-world coding practices and allow you to collaborate with other developers.
Show steps
  • Find an open-source mesh generation library on GitHub or GitLab.
  • Study the library's code and documentation.
  • Identify a bug or feature that you can contribute.
  • Submit a pull request with your changes.

Career center

Learners who complete Coding in Unity: Mastering Procedural Mesh Generation will develop knowledge and skills that may be useful to these careers:
Game Developer
A game developer designs and codes video games for various platforms. This role often involves creating and implementing game mechanics, artificial intelligence, and user interfaces. A game developer is responsible for ensuring the functionality, performance, and overall user experience of a game. This course directly helps a game developer by teaching them how to procedurally generate meshes within Unity. With the ability to programmatically create landscapes using Perlin and fractal noise, a game developer can build expansive and unique game worlds. This course teaches not only mesh creation but also how to calculate UVs, normals, tangents, and vertex colors which can greatly enhance the visual appeal of the game. The course's coverage of infinite landscapes is particularly relevant for open world games.
Technical Artist
A technical artist bridges the gap between art and programming in game development. This multifaceted role involves optimizing art assets for performance, creating tools and scripts to streamline the art pipeline, and ensuring visual consistency across a project. The technical artist often works closely with both artists and programmers to solve technical challenges and enhance the visual quality of a game. This course proves valuable for a technical artist by equipping them with the skills to procedurally generate meshes and landscapes. In this course, you will learn how to calculate UVs, normals, and tangents to optimize meshes for performance. You will find particularly useful the ability to programmatically create and manipulate meshes, allowing for efficient creation of optimized art assets.
Virtual Reality Developer
A virtual reality developer creates immersive experiences using VR technologies. The core responsibilities include designing and developing interactive environments, implementing user interfaces, and optimizing performance for VR headsets. You will work with 3D modeling, spatial audio, and motion tracking to create realistic and engaging virtual worlds. This course helps a virtual reality developer by teaching them how to generate 3D landscapes and meshes. You will find the ability to create procedural environments incredibly useful because it allows for the creation of diverse and expansive virtual worlds. The course's lessons on optimizing mesh generation and calculating normals and tangents can prove beneficial here. The knowledge of generating infinite landscapes can also be useful for creating large VR environments.
Augmented Reality Developer
An augmented reality developer creates interactive experiences that overlay digital content onto the real world. You will design and develop AR applications for mobile devices, tablets, and wearable technology. Your duties include the use of computer vision, sensor integration, and 3D modeling to create seamless and engaging AR interactions. This course teaches you how to procedurally generate meshes in Unity, which is a core skill. You will find that the knowledge of creating 3D landscapes and geometric shapes will be vital for building AR environments. The ability to calculate UVs, normals, and tangents will enhance the visual fidelity of AR content. The course's focus on creating optimized meshes will be critical for ensuring smooth performance on mobile devices and wearable technology.
Simulation Developer
A simulation developer creates realistic and interactive simulations for training, research, and entertainment purposes. Your duties include coding and implementing physics, AI, and 3D environments to simulate real world scenarios or create fictional environments. This course can help a simulation developer through the knowledge of procedural mesh generation in Unity. This course can prove useful in creating dynamic and realistic environments for simulations. The ability to generate landscapes with Perlin and fractal noise can be particularly valuable for terrain simulations. In addition, the course covers the skills necessary to optimize mesh creation which can then lead to high performance.
Procedural Content Generation Specialist
A procedural content generation specialist focuses on developing algorithms and systems that automatically create game content, such as levels, textures, and characters. This can reduce development time and create more varied and emergent gameplay experiences. As a procedural content generation specialist, you might find this course valuable. The course focuses entirely on procedural mesh generation, which is a subset of procedural content generation, and this knowledge can be applied to a variety of projects that involve the creation of content through code. The course is particularly useful for its coverage of landscape generation using Perlin and fractal noise. This course will prove useful when creating tools and systems for automated content generation.
3D Modeler
A 3D modeler creates three dimensional assets for video games, films, and other media. Your tasks include creating detailed polygonal models, sculpting high resolution assets, and optimizing meshes for real time rendering. While 3D modelers often use specialized software, the ability to procedurally generate meshes can greatly enhance their workflow. In this course, you will learn to create geometric shapes and landscapes within Unity, which can be used as a base for further refinement in other 3D modeling tools. This course covers how to calculate UVs, normals, and tangents, which are essential for texturing and shading 3D models. The knowledge of mesh optimization can also prove useful for creating efficient and visually appealing models.
Software Engineer
A software engineer designs, develops, and tests software applications for various platforms. Your duties include writing clean and efficient code, debugging software defects, and collaborating with other engineers to deliver high quality products. Although software engineers have diverse roles, this course specifically focuses on coding meshes in the Unity game engine and can be valuable if you are working on projects that require 3D graphics or simulations. The course can help you understand how to generate complex shapes and landscapes programmatically. The knowledge of calculating UVs, normals, and tangents can also be beneficial if you are working on rendering or visualization projects.
Shader Developer
A shader developer writes code that controls how objects are rendered in a game or application. Your tasks include creating visual effects, optimizing rendering performance, and implementing advanced shading techniques. Although shader development is a specialized field, understanding how meshes are generated and manipulated is essential to create efficient and visually appealing shaders. In this course, you will learn how to generate meshes programmatically in Unity, which provides a solid foundation for shader development. The course is particularly useful for its coverage of calculating UVs, normals, and tangents, which are all critical inputs for shaders. A shader developer understands normals, tangents, and vertex colors.
Level Designer
A level designer creates and implements the environments in which games take place. Your work involves designing engaging layouts, scripting events, and ensuring a fun and challenging player experience. This course may provide helpful insight into the procedural generation of landscapes and environments. The course teaches how to generate landscapes using Perlin and fractal noise, something that can be leveraged to create varied and interesting levels. The ability to procedurally generate meshes and terrains can be useful for creating levels which can then be further customized by a level designer.
Data Visualization Specialist
A data visualization specialist transforms raw data into meaningful and interactive visual representations. Your tasks include designing charts, graphs, and other visual aids to communicate complex information effectively. Although data visualization often involves working with two dimensional data, the principles of mesh generation and 3D rendering can be applied to create more immersive and engaging visualizations. This course teaches you how to generate 3D landscapes and geometric shapes in Unity, which can be useful for visualizing spatial data or creating interactive data sculptures. The knowledge of mesh optimization and UV mapping can also enhance the visual appeal of data visualizations.
Robotics Engineer
A robotics engineer designs, develops, and tests robots for various applications. Your duties include coding robot control systems, integrating sensors and actuators, and simulating robot behavior in virtual environments. This course may be helpful to a robotics engineer if you are working on projects that involve simulating robot movement or generating 3D models of robot parts. The course teaches how to generate meshes programmatically in Unity, which can be useful for visualizing robot designs and simulating robot interactions with the environment. This course can help you better model robots and their environment.
Architectural Visualization Specialist
An architectural visualization specialist creates photorealistic renderings and animations of architectural designs. Your duties include creating detailed 3D models, applying textures and lighting, and using rendering software to produce high quality visuals. While architectural visualization typically relies on specialized 3D modeling software, the principles of mesh generation and procedural content creation can be applied to automate the creation of complex architectural elements. The course teaches how to generate meshes programmatically in Unity, which can be useful for creating parametric architectural designs or generating 3D models of landscapes surrounding buildings. The knowledge of UV mapping and texture generation can also enhance the visual appeal of architectural renderings.
Geospatial Analyst
A geospatial analyst uses geographic information systems and remote sensing data to analyze spatial patterns and trends. You will collect, process, and interpret geospatial data to support decision making in various fields, such as urban planning, environmental management, and disaster response. This course can be valuable if you are working on projects that require visualizing terrain data in 3D. The course teaches you how to generate landscapes with Perlin and fractal noise, which can be useful for creating realistic terrain models. The knowledge of UV mapping and texture generation can also enhance the visual appeal of geospatial visualizations.
Product Designer
A product designer designs and develops new products or improves existing ones. Your duties include conducting user research, creating prototypes, and iterating on designs based on feedback. This course may be useful if you are working on products that involve 3D modeling or visualization. The course teaches how to generate meshes programmatically in Unity, which can be useful for creating prototypes of product designs or generating 3D models for marketing materials. The knowledge of mesh optimization can be beneficial for creating efficient and visually appealing product renderings.

Featured in The Course Notes

This course is mentioned in our blog, The Course Notes. Read one article that features Coding in Unity: Mastering Procedural Mesh Generation:

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Coding in Unity: Mastering Procedural Mesh Generation.
Provides a solid mathematical foundation for 3D game programming and computer graphics. It covers topics such as linear algebra, calculus, and geometry, which are essential for understanding mesh generation algorithms. While the course focuses on the practical aspects of coding meshes, this book provides the theoretical background necessary for advanced techniques and optimizations. It useful reference tool for understanding the math behind mesh generation.
Provides a comprehensive guide to Unity development, covering a wide range of topics relevant to game creation. It's particularly useful for understanding the underlying principles of game design and implementation within the Unity engine. While not solely focused on mesh generation, it provides a strong foundation for understanding how meshes fit into the broader context of game development. It is commonly used as a textbook at academic institutions.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser