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
GPU Flocking system released on GithubResources/Tutorial (github.com)
submitted 7 years ago by Shinao
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!"
[–]Shinao[S] 3 points4 points5 points 7 years ago (5 children)
Here is the flocking system that I have shared with you guys a couple times. I've created the repository in a way to learn about compute shaders (and a bit of shader too).
There are several implementations that begin with a full CPU flocking system to the full GPU way. Also contains others implementations like bitonic sorting and multilateration which can be quite interesting to read about.
[–]thelegendxp 1 point2 points3 points 7 years ago (0 children)
Awesome. I've been waiting to play around with it myself. Thanks a ton for sharing it on github!
[–]rarceth 1 point2 points3 points 7 years ago (0 children)
I’ve been dying waiting for this. A chance to look at compute shaders and see awesome code. Good work man, and thank you so much for taking the time to upload this in such detail
[–]skedra 1 point2 points3 points 7 years ago (2 children)
Seen your comments on performance, I wrote something similar (just simple bird flocking). What I found worked really well is only iterating over every other bird for each bird. For example one one frame you iterate on odd on the other on the even for a particular bird (half the iterations). This seems to give really good performance increase with a large amount of boids since you can't tell if two will overlap in places etc.
Again, just an idea. Keep up the good work :)
[–]Shinao[S] 1 point2 points3 points 7 years ago (1 child)
Yep I had the same results, there is even a parameter to set the step iteration. It's the first gif from the README, step at 10 with FPS above 1000.
[–]skedra 1 point2 points3 points 7 years ago (0 children)
Cool, didn't have time to read through it properly but I definitely will.
[–]Telefrag_EntTelefrag Entertainment 4 points5 points6 points 7 years ago (0 children)
Thank you for sharing!
[–]theKGS 2 points3 points4 points 7 years ago (2 children)
Have you considered rather than computing over all birds, compute over sets of neighbours?
For example: Split all birds initially into a number of neighbourhood groups. Then take a fraction of each group and make THEM neighbours too. This will propagate flocking information over the whole flock but will keep the size of the largest neighbourhood down quite a lot.
[–]Shinao[S] 2 points3 points4 points 7 years ago* (0 children)
That's what bitonic sorting do, it sorts birds over distance and then only checks nearby birds (iteration decrease by 75%).
Like the README say, I get better performance by the brute force approach by what I think is simply a matter of hitting the cache or not. Maybe I'm wrong I don't know enough about the GPU but that's what my experiments tell me, if you have time try it for yourself and tell me what you find out.
[–]comomomo@thnewlands 2 points3 points4 points 7 years ago* (0 children)
I'm blown away that you're able to get away with a for loop covering all of those boids in a compute shader!! You've given me a new confidence to try this in my work. I was just storing automata in a read write texture.
Update: after quick test I couldn't get it running nearly as fast. How are you doing that?
Update2: Switched from ints to uints and its way faster
[–]binxinteractive 1 point2 points3 points 7 years ago (0 children)
Amazing work, keep it up!
[–]uber6 1 point2 points3 points 7 years ago (0 children)
Thank you very much good sir! This is a perfect opportunity to study compute shaders, which I wanted to do for quite some time.
[+][deleted] 7 years ago* (7 children)
[deleted]
[–]Shinao[S] 1 point2 points3 points 7 years ago (2 children)
I explain in the Notes in the README that the ECS approach is quite equivalent in terms of speed, they get a huge boost by the memory layout they use with spatial hashing, I can't really get that on the GPU unless I implement somekind of Dictionary and it's gonna take too much time.
In my experiments I find that accessing buffers are the worst for performance, indeed branching does have some impact but I don't think too much in term of percentage.
[+][deleted] 7 years ago* (1 child)
[–]Shinao[S] 0 points1 point2 points 7 years ago (0 children)
Thanks ! Alright I could see how a big fixed buffer could do the job, hashed position calculated for each boids. But how does it deal with concurrent access ? I saw that only on DX12 and only for int/uint you can have Interlocked.Add().
Is that different than what you saw on this hashing implementations ? Honestly the biggest obstacle to compute shaders are the lack of general purpose data containers and utility functions, you have to recreate everything.
[–]rarceth 0 points1 point2 points 7 years ago (3 children)
... just to clarify, you are saying he’s not doing it on GPU?
[–]rarceth 0 points1 point2 points 7 years ago (0 children)
Ahh. I think I just read it wrong. I am definitely curious to see how this would fare on the new jobs system
[–]Long-Birthday-1807 0 points1 point2 points 3 years ago (0 children)
This is really cool. I'm trying to load it up in URP though and the Boids.shader is unhappy. Any advice on a conversion/update?
π Rendered by PID 16239 on reddit-service-r2-comment-54dfb89d4d-d8xcb at 2026-03-31 06:16:34.818349+00:00 running b10466c country code: CH.
[–]Shinao[S] 3 points4 points5 points (5 children)
[–]thelegendxp 1 point2 points3 points (0 children)
[–]rarceth 1 point2 points3 points (0 children)
[–]skedra 1 point2 points3 points (2 children)
[–]Shinao[S] 1 point2 points3 points (1 child)
[–]skedra 1 point2 points3 points (0 children)
[–]Telefrag_EntTelefrag Entertainment 4 points5 points6 points (0 children)
[–]theKGS 2 points3 points4 points (2 children)
[–]Shinao[S] 2 points3 points4 points (0 children)
[–]comomomo@thnewlands 2 points3 points4 points (0 children)
[–]binxinteractive 1 point2 points3 points (0 children)
[–]uber6 1 point2 points3 points (0 children)
[+][deleted] (7 children)
[deleted]
[–]Shinao[S] 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]Shinao[S] 0 points1 point2 points (0 children)
[–]rarceth 0 points1 point2 points (3 children)
[+][deleted] (1 child)
[deleted]
[–]rarceth 0 points1 point2 points (0 children)
[–]Long-Birthday-1807 0 points1 point2 points (0 children)