https://github.com/AlexMerzlikin/Unity-BatchRendererGroup-Boids
A sample BRG project for the blog post @ https://gamedev.center
https://github.com/AlexMerzlikin/Unity-BatchRendererGroup-Boids
batchrenderergroup unity
Last synced: 3 days ago
JSON representation
A sample BRG project for the blog post @ https://gamedev.center
- Host: GitHub
- URL: https://github.com/AlexMerzlikin/Unity-BatchRendererGroup-Boids
- Owner: AlexMerzlikin
- Created: 2022-02-23T21:48:49.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-22T19:47:19.000Z (over 2 years ago)
- Last Synced: 2024-06-06T23:38:45.829Z (over 1 year ago)
- Topics: batchrenderergroup, unity
- Language: C#
- Homepage: https://gamedev.center/trying-out-new-unity-api-batchrenderergroup/
- Size: 8.63 MB
- Stars: 52
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- anything_about_game - Unity-BatchRendererGroup-Boids
README
# Unity-BatchRendererGroup-Boids
A simple example how to use the new BatchRendererGroup API to render boids made for my blog at https://gamedev.center/trying-out-new-unity-api-batchrenderergroup/.

For calculating boids behaviour I used [ta-boids](https://github.com/ThousandAnt/ta-boids).
However, for me this boids solution turned out to be a bit unstable, as even little performance dips or interaction with the editor breaks the __centerFlock_ pointer, leaves it as (NaN, NaN, NaN) and boids stop working both for my BRG variant, as well as GameObject and Instanced variants provided in the boids repo.
So in the editor I could only test boids with a small amount of objects up to 2k. When I have found out this issue, it was already too late and I was too lazy to find a new boids lib and redo BRG variant again.
Anyway it suits my goal to test BRG compared to GameObjects and Instancing.
All samples are present in the sample scene: [BoidBRGScene](https://github.com/AlexMerzlikin/Unity-BatchRendererGroup-Boids/blob/master/Assets/Scenes/BoidBRGScene.unity). Just turn on and off the ones you would like to check.
# Custom Universal Render Pipeline Shader With DOTS Instancing Support
The repo also contains the most basic example of [a custom URP shader](https://github.com/AlexMerzlikin/Unity-BatchRendererGroup-Boids/blob/master/Assets/Shaders/CustomURPUnlit.shader) thats supports DOTS instancing and therefore can be used with BRG.

# References
https://forum.unity.com/threads/new-batchrenderergroup-api-for-2022-1.1230669/
Examples by Unity: https://github.com/Unity-Technologies/Graphics/tree/master/TestProjects/BatchRendererGroup_URP/Assets/SampleScenes