Coder Social home page Coder Social logo

kyapp69 / unity-fast-dual-contouring Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dmeville/unity-fast-dual-contouring

0.0 1.0 0.0 40.85 MB

Multithreaded C++ plugin to do DC in Unity

C++ 91.44% C 1.22% CMake 0.16% Objective-C 2.04% Smalltalk 0.25% C# 4.46% ShaderLab 0.43%

unity-fast-dual-contouring's Introduction

This code is half broken!

I've been playing around with generating meshes from noise data for about the last week, after trying multiple unity assets and not being satisfied with the results, thought I'd see if I could get DC working quickly. I'm hoping to be able to use this as a base to generate procedural terrains. I don't require the terrains to be modifiable at runtime, but I would like to be able to swap between mesh LoD at will.

Anyways, after reading the paper, and taking a look at the C# port of nickgildeas code here https://github.com/tuckbone/DualContouringCSharp helped me understand. I tried to implement DC using a normal voxel grid instead of an octree and it worked decently well, but it was dreadfully slow. Decided it would be fun to see about getting it to run as a C++ plugin..

Instead of porting my own code I grabbed nickgildea's code from github and after a bit of tinkering and trying to remember how C++ works, I got it working as a plugin in Unity!

Still has a few things I need to figure out like if I'm leaking memory the way I'm sending the generated mesh data to Unity, and why the mesh simplification doesn't seem to be working, but I'm not familiar with C++ much at all so I'm sort of stumbling around..

Feel free to suggest changes or fixes to the code, I don't know how to C++ well so it's probably terrible!

Video of it in action: https://www.youtube.com/watch?v=fAXttypzvIw

@DMeville I have no idea what I'm doing.

unity-fast-dual-contouring's People

Watchers

 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.