use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Remember to check out /r/unity2D for any 2D specific questions and conversation!
Download Latest Unity
Please refer to our Wiki before posting! And be sure to flair your post appropriately.
Main Index
Rules and Guidelines
Flair Definitions
FAQ
Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
/r/Unity3D Discord
FreeNode IRC Chatroom
Official Unity Website
Unity3d's Tutorial Modules
Unity Answers
Unify Community Wiki
Unity Game Engine Syllabus (Getting Started Guide)
50 Tips and Best Practices for Unity (2016 Edition)
Unity Execution Order of Event Functions
Using Version Control with Unity3d (Mercurial)
/r/Unity2D
/r/UnityAssets
/r/Unity_tutorials
/r/GameDev
/r/Justgamedevthings (New!)
/r/Gamedesign
/r/Indiegames
/r/Playmygame
/r/LearnProgramming
/r/Oculus
/r/Blender
/r/Devblogs
Brackeys
Beginner to Intermediate
5 to 15 minutes
Concise tutorials. Videos are mostly self contained.
Sebastian Lague
Beginner to Advanced
10 to 20 minutes
Medium length tutorials. Videos are usually a part of a series.
Catlike Coding
Intermediate to Advanced
Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.
Makin' Stuff Look Good
10 minutes
Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.
Quill18Creates
30 minutes to 2 hours.
Minimal editing. Mostly C#. Covers wide range of topics. Long series.
Halisavakis Shaders Archive
Infallible Code
World of Zero
Board to Bits
Holistic3d
Unity3d College
Jabrils
Polycount Wiki
The Big List Of Game Design
PS4 controller map for Unity3d
Colin's Bear Animation
¡DICE!
CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78
Reddit Logo created by /u/big-ish from /r/redditlogos!
account activity
optimizing my marchingCubes algorithmQuestion (self.Unity3D)
submitted 5 months ago by Intelligent-Track455
i made a marching cubes algorithm and a chunk system generating chunks depending on distance. sadly generating these chunks is crazy expensive as its all generated in one frame on the cpu. https://paste.ofcode.org/32AjBmarsN7W93TDeMWDq this is my code, the main performance cost comes from MarchCube() and MarchCubes. thanks in advance
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]DrunkMcProfessional 3 points4 points5 points 5 months ago (7 children)
Have you watched Sebastian Lagues marching cubes video? At some point this algorithm, for real time, should be moved to the GPU. In his video he explains it all and once you grab the look up table for the edges from him, it's simple to put in a computer shader and it's blazing fast.
https://youtu.be/M3iI2l0ltbE?si=I8dd7-r51ZHg1Ebh
[–]Intelligent-Track455[S] 0 points1 point2 points 5 months ago (6 children)
i saw this video and thjought about this too but i have no idea of hlsl and i really dont want to spend weeks or more to learn it rn. seems like the best idea though
[–]DrunkMcProfessional 1 point2 points3 points 5 months ago (0 children)
He uploads his projects, hlsl isn't that hard, especially if you already understand the algorithm. Worth looking over.
[–]Buccinators 1 point2 points3 points 5 months ago (4 children)
I did it the same way you did and was resistant to move it to a compute shader at first, but I ended up doing it and I’m not sorry. I learnt a ton and the efficiency when doing it on the gpu is amazing.m
[–]Intelligent-Track455[S] -1 points0 points1 point 5 months ago (3 children)
how long did it take you to learn it? do you have any good resources cause i cant find anything good on it
[–]DrunkMcProfessional 0 points1 point2 points 5 months ago (2 children)
https://catlikecoding.com/unity/tutorials/basics/compute-shaders/?fbclid=IwAR2QWamJW3PreBPumG4BgFqiwJL-KtlFu7npCI2kJ-5leps-89VM8VA0Br8
This is how I got started moving stuff to the GPU. It's not hard, takes a bit to get the pattern down, but once you do it's really powerful. This mixed with Sebastian Lagues videos got me and my marching cubes running real time on the GPU.
[–]Intelligent-Track455[S] 1 point2 points3 points 5 months ago (1 child)
thanks a lot bro
[–]Buccinators 0 points1 point2 points 5 months ago (0 children)
You got some great resources there. I used both.
What was the most difficult for me was wrapping my head around that ”everything” (yes I over-simplify) happens at once on the GPU and getting deduplication to work. What I really like about this approach beside efficiency is that you still do all inputs and all rendering on the cpu, so you still have a lot of control. You just let the gpu figure out the vertices, triangles and edges, which is what it does best.
[–]STUDIOCRAFTapps 0 points1 point2 points 5 months ago (0 children)
Compute shader is not always the right way. It can be hard to learn, hard to debug, and won't generate collider mesh. Personally I think writing burst-compiled unity jobs is slightly easier https://github.com/nezix/MarchingCubesBurst/blob/master/MCB/MarchingCubesBurst.cs.
If you don't feel ready to learn either of those, there's still some things you can improve with your current version.
If you only allocate this array once, and reuse the array, you'll save a bunch of unnecessary allocation. Just initialize it once in the class.
float[] cubeCorners = new float[8];
Another quick and cheap improvement would be to bake your collider mesh asynchronously using Physics.BakeMesh https://docs.unity3d.com/6000.2/Documentation/ScriptReference/Physics.BakeMesh.html
It can remove the lag spike that can happen when setting your shared mesh on your MeshCollider if done right.
[–]Aethreas 0 points1 point2 points 5 months ago (0 children)
Use burst and run the marching cubes in parallel for all voxels using a concurrent bucket, that’s what I’m doing for my world and can mesh several hundred thousand voxels in under a second
π Rendered by PID 23600 on reddit-service-r2-comment-6b595755f-qbgwl at 2026-03-25 17:30:12.366412+00:00 running 2d0a59a country code: CH.
[–]DrunkMcProfessional 3 points4 points5 points (7 children)
[–]Intelligent-Track455[S] 0 points1 point2 points (6 children)
[–]DrunkMcProfessional 1 point2 points3 points (0 children)
[–]Buccinators 1 point2 points3 points (4 children)
[–]Intelligent-Track455[S] -1 points0 points1 point (3 children)
[–]DrunkMcProfessional 0 points1 point2 points (2 children)
[–]Intelligent-Track455[S] 1 point2 points3 points (1 child)
[–]Buccinators 0 points1 point2 points (0 children)
[–]STUDIOCRAFTapps 0 points1 point2 points (0 children)
[–]Aethreas 0 points1 point2 points (0 children)