Coder Social home page Coder Social logo

javier-garzo / marching-cubes-on-unity-3d Goto Github PK

View Code? Open in Web Editor NEW
331.0 331.0 41.0 11.41 MB

Terrain voxel engine with the use of Marching Cubes implemented in Unity 2020.3.17f1 (LTS).

License: MIT License

C# 93.80% ShaderLab 6.20%
marching-cubes terrain-generation voxel-engine

marching-cubes-on-unity-3d's People

Contributors

javier-garzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marching-cubes-on-unity-3d's Issues

Alternative Biome Selection

Hey just an idea, but wouldn't it be better to pick a biome by generating 3 sets of float2 perlin or simplex noise, then you can treat those 3 noise values at every place as an rgb colour. Each biome can have a user set colour, whichever biome is closest to that colour at any given point is chosen as the biome. Due to it being perlin or simplex noise this gives quite satisfying biome blobs. But beware that some colours that the eye thinks look different, might actually be quite close in terms of distance! Hope ya have a great day!

Get Byte data from a vertex (placement objects)

Hi, I am trying to implement a vegetation system (not seed yet), but I have not fully understood how the bytes work to obtain if a vertex is grass or snow for example.

The trees are placed on the ground not by biome, but by the type of vertex it is (material), but it does not work quite well

Is there any way to get the byte of a certain vertex with raycast?

This is an image of the progress:
Biome Vegetation

How to prevent interpolation?

Hi @Javier-Garzo,
I am building a voxel game and I managed to make cubes but I couldn't find a way to prevent interpolation between ground and placed cube.
image
I want to combine Minecraft-looking blocky voxels combined with a marching cube but this ugly-looking interpolation prevents me, how can I solve this?

Too much vertices?

Hi, I have been having fun with your code, and making some changes. I realized on flat planes mesh has 1536 vertices, and 512 triangles. Shouldn't there be 289 vertices since plane is 17 * 17. I just wanted to ask if i could improve performance by reducing the number of vertices somehow.

Questions

I have two questions.

  1. How and where can I add the code to smooth the terrain.
  2. Does this support underground generation for example ores.

UV issue

There seems to be an issue with UV. Sometimes texture gets stretched
image

Changing VOXEL_SIDE Error

I'm changing the voxel side to 0.5f and the result is, How to subdivide chunk to get more vertices?
image

Getting deeper

Hi, thanks for your project!
Ater changing to HDRP and using the lit texture on terrain I have this weird problem where I can only light up in one direction.
Something like this.
helpas
Do you have any clue what happened there?

Is there any option to do voxels smoother?

Hi, I suppose I can speak in Spanish but I'll keep talking in English for the community.

Is there any option to make voxels shape smoother? I think yes, but I'm a little bit newbie with voxels.

I bought FastNoise (https://assetstore.unity.com/packages/tools/particles-effects/fastnoise-70706) in the past which could help me to make me an idea about this, so when I have it available I'll come with a PR.

PD: Also I have this tutorial: https://github.com/z3nth10n/AlexStv-Unity-Voxel-Block-Tutorial so I'll be investigating, I'll like to do some kind of procedural cave system with this: https://github.com/z3nth10n/AlexStv-Unity-Voxel-Block-Tutorial

In the meanwhile, you can add me on discord: @z3nth10n#0775

Thanks for your attention!

Chunks are saved even when SAVE_GENERATED_CHUNKS is false.

First off, imo this is one of the best unity marching cubes repos that exists. It's just so damn good.

I was playing around with the FPS scene digging craters and making hills, and the edits I made stay afterwards, even if I close the editor and come back. if the seed is changed, it still keeps that chunk and it leads to that specific memorized chunk having huge holes where the neighbors are supposed to connect and it just doesnt match the surrounding chunks at all.

I read the repo and it said saved files will show up in Application.persistentDataPath+"/chunks". no chunks folder exists. I assume this is due to Save_generated_chunks being false. however, instead there's a worlds folder containing a default folder which has reg files. Im not really sure why this is, or how to make it stop.

Is this intentional?
Is there a way to tell it to clear those reg files on playmode exit?
Or, at the very least, is there a way to have it only load reg files with the same seed?

Again, this system is great and I thank you for it. So much hard work obviously went into this.

Is the overhang right above slopes expected?

image

I have really enjoyed looking through this project, but it seems that there is an overhang that appears immediately above slopes like the image above. These overhangs look a little strange, but they also interfere with a character attempting to walk up these slopes. Is that overhang intentional?

Sphere world generation

Hi, how can I make spherical world shape? What should I change in marching cube algorithm to make world spherical?

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.