scrawk / marching-cubes-on-the-gpu Goto Github PK
View Code? Open in Web Editor NEWA implementation of the marching cubes algorithm on the GPU in Unity.
License: MIT License
A implementation of the marching cubes algorithm on the GPU in Unity.
License: MIT License
I know this is old but you mention this in your readme, why is that so ? I am fairly new to compute shaders and have no idea why this is the case.
Shader warning in 'MarchingCubes': Program 'CSMain', warning X4714: sum of temp registers and indexable temp registers times 512 threads exceeds the recommended total 16384. Performance may be reduced at kernel CSMain (on vulkan).
What do i do to fix this (I don't understand this error code)
I experiment with your code. Firstly I provisionally removed perlin noise to work with simply plain or cube. I've just overwritten m_perlinNoise shader result.
float[] verts = new float[SIZE];
m_noiseBuffer.GetData(verts);
for (int z = 0; z < N; z++)
for (int y = 0; y < N; y++)
for (int x = 0; x < N; x++)
{
verts[x + y * N + z * N * N] = 1;
if (z < 3)
verts[x + y * N + z * N * N] = -1;
}
m_noiseBuffer.SetData(verts);
But Igot a black plain. I've checked that all generated vertices have NaN vector normals (using your ReadBackMesh func).
I've also found a clue. This displays a color:
float[] verts = new float[SIZE];
m_noiseBuffer.GetData(verts);
for (int z = 0; z < N; z++)
for (int y = 0; y < N; y++)
for (int x = 0; x < N; x++)
{
verts[x + y * N + z * N * N] = 1;
if (z == 3)
verts[x + y * N + z * N * N] = 0.9f;
if (z < 3)
verts[x + y * N + z * N * N] = -1;
}
m_noiseBuffer.SetData(verts);
Normals depend on deeper vertices and those have to have different values?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.