Git Product home page Git Product logo

marching-cubes's People

Contributors

seblague 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  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

marching-cubes's Issues

Placement Objects System

Hello, I am interested in the terrain system and I wanted to implement a placement of objects (for example trees) these consist of frequency (how much probability that trees appear), size and prefab, all in arrays to edit each prefab , I tried to find the coordinates of each chunk to place the objects but it didn't work for me.

Applying to DICOM Files

I am thinking of to apply this Project on DICOM Files. Do you think this would be possible?

I am learning the marching cubes currently, thats why I can not really understands, where in code (e.g. MeshGenerator) the algorithm takes place.

Have anyone an advice for me?

Planet

how to get the same effect as in 4:28 because you came out the planet in the movie and I have a circle

Realtime Editing

Hi I was wondering if you could shed some light on how to edit single voxels in realtime similar to 7 days to die or minecraft, I have created a voxel engine in the past but could not get marching cubes working and I have no experience with compute shaders. I cannot figure out how to edit the "voxel array" and update the chunk. I believe that the pointsBuffer holds the information I need however I don't know where it is safe to edit it and also what type of "Array" it is. I have tried

float[] voxels = new float[meshGen.pointsBuffer.count]; meshGen.pointsBuffer.GetData(voxels);

however it returns system.single[] and i do not know how to fix this. I tried making a 2d array but i threw a memory exception error. Any help would be greatly appreciated thank you for your time.

No Collider in Terrain on non-Fixed-Map

Hey, at first: great work.
problem: if i generate colliders automatically in terrain mode and use a non fixed map, the collider isn't active. if I disable and enable the chunk or the meshcollider component of the cunk in playmode, the collider works.

how to fix this?

there a no problems in fixed map mode.

blocking wait for GetComputeBufferData

I've been trying to speed this thing up on my fork and render out further. Increasing the chunk size helps, but I noticed something in the performance window:

image

The main reason larger chunks take longer is because they take longer on the GPU. But the CPU and GPU are different devices, so they can operate concurrently. Unity has a function called AsyncGPUReadback that solves this, though it adds some latency. I think adding that to UpdateChunkMesh would work.

HLSL build-in triangle object instead of the Triangle struct ?

There is a build in triangle object in HLSL.

Would it be faster than using the created struct? it look like the triangle object is just a array of 3 float3 and could save the need of this loop :

for (int i = 0; i < numTris; i++) {
     for (int j = 0; j < 3; j++) {
         meshTriangles[i * 3 + j] = i * 3 + j;
         vertices[i * 3 + j] = tris[i][j];
     }
 }

I'm not 100% sure of the loop removal opportunity but might be worth investigating

Error: Unable to link compute shader

Hi

When I check out the project I get the following error:

-------- GLSL link error: Compute info
------------
0(53) : error C5041: cannot locate suitable resource to bind variable "TempArray0". Possibly large array.
0(14) : error C5041: cannot locate suitable resource to bind variable "ImmCB_0_0_1". Possibly large array.

I'm on Ubuntu 18.04 and Unity 2018.3.0f2. My graphics API is OpenGLCore.

Kernel at index (0) is invalid

Running it with Unity 2019.1.0f2 - Linux, I've got this error message :

Kernel at index (0) is invalid
UnityEngine.ComputeShader:Dispatch(Int32, Int32, Int32, Int32)
MeshGenerator:UpdateChunkMesh(Chunk) (at Assets/Scripts/MeshGenerator.cs:199)
MeshGenerator:InitVisibleChunks() (at Assets/Scripts/MeshGenerator.cs:166)
MeshGenerator:Run() (at Assets/Scripts/MeshGenerator.cs:85)
MeshGenerator:Update() (at Assets/Scripts/MeshGenerator.cs:67)

Problems by checking out the project

I just checked out the project, and I run into some problems:

First I had to convert the project from 2018.3.2f1to 2018.3.8f1

After this was done, I was greeted by the following error message:

Compute Shader: The destination buffer in CopyComputeBufferCount is not of type Raw or IndirectArguments. DX11 only supports CopyComputeBufferCount to these types.

While trying to execute the scenes, or just looking around the scene, I got often this message:

OutOfMemoryException: Out of memory
MeshGenerator.UpdateChunkMesh (Chunk chunk) (at Assets/Scripts/MeshGenerator.cs:201)

And when inspecting the components in the scenes, I saw 2 components that had a "missing script" warning. The "Main Camera" in the submarine scene, and the "Chunk holder" in the terrain scene.

image

image

What could this be hapenning?

Injecting Noise

This is not perhaps the correct way to ask such a question, I'm trying to use your engine for some research in immersive analytics. I've been trying to use the existing unity implementation of FastNoiseSIMD as a source of noise, as it offers multi-layered 3D cellular noise (I'm not making a minecraft clone, but I do need interconnected caves).
I've managed to use the noise library to deform the "density sphere" mesh by deforming the mesh filter on the chunk. What I would like to do is actually get it to define the initial coordinates of the vertices. What I gather is that I need a custom density generator with the specific noise source.
Do I need to use a Compute Shader similar to noisedensity and do it within that, or is there a way of determining pointbuffer id coordinates in the C# script and use a more basic density compute shader?!? I would prefere the second option, as I'm not familiar with compute shader syntax...

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.