Giter Site home page Giter Site logo

p-svacha / meshbuilderlib Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 125.94 MB

Unity library aiming to assist in procedural mesh generation. Includes example projects that use the library for both in-editor mesh generation and runtime mesh generation.

C# 100.00%
mesh-generation mesh-library procedural-mesh procedural-meshes unity unity-3d unity-mesh

meshbuilderlib's Introduction

About

This project contains a Unity library assisting in procedural mesh generation. It's aim is to automate processes that have to be repeated often when dealing with (procedural) mesh generation in unity.

Main Features

  • Usable both in-editor and at runtime (examples for both included)
  • Easy instancing, changing and applying meshes to GameObjects
  • Meshes are created 100% in code, no prefabs needed
  • Functions to easily add basic and more complex geometric shapes to a mesh (planes, cylinders, spheres, rooms, paths and more) with full UV support
  • Implementation in URP with working detailed example materials
  • Full submesh support, allowing for different materials in 1 mesh

How to Use

All the needed files are in Assets/Scripts/MeshBuilderLib. To use the library simply copy that folder into your project and import it by "using MeshBuilderLib". To use the functionalities create a new MeshBuilder object. You can then manipulate the mesh by using the several functions of the meshbuilder. When you're done, use the ApplyMesh function to update the mesh in the scene.

The repo also includes some example projects that use the library and a MeterialHandler with some basic ready-to-use materials. To correctly use the example projects and materials also copy Assets\Resources\Materials into your project.

Editor example projects

You'll find multiple generators that create meshes in-editor using the library. They can be found within the default scene in "EditorGenerators". Simply press the "Generate" button on their GameObjects to try them out. Additional ones can be set up the same way.

Runtime example project - Liminial Dungeon Generator

The repo also includes a bigger test project that uses the library - the LiminalDungeonGenerator. This generator showcases how the library can also be used for runtime mesh generation. It can generate a whole simple dungeon, consisting of simple rooms and corridors using the MeshBuilder library and a basic dungeon generator algorithm to create and connect modules/rooms.

Here's a screenshot of how that looks.



meshbuilderlib's People

Contributors

p-svacha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.