Everyday Unity – Telegram
Everyday Unity
1.11K subscribers
157 photos
59 videos
42 files
2.36K links
A game developer and tech lead in a top grossing company posting Unity, programming, and gamedev related stuff that I find interesting
Website: https://gamedev.center

Most used tags are:
#performance
#shader
#interview

Author: @alexmtr
Download Telegram
Branching on a GPU

- Do not fear branching on a GPU, in many cases it’s completely fine
- Know what you are branching on, and what you are branching around.
- Avoid branching on high frequency data and creating divergent pixels
- Branching around textures requires special care
- Visualize the data so you can see exactly what the GPU is doing
- Order your branches from most likely to cull to least likely if possible.

https://medium.com/@jasonbooth_86226/branching-on-a-gpu-18bfc83694f2

#gpu #shader #branching
Editor Iteration Profiler (EIP)

Monitor and capture profiling data from assembly reload, assembly compilation, and enter playmode.

https://forum.unity.com/threads/introducing-the-editor-iteration-profiler.908390/

#editorprofiler #profiler #editortool
My approach to optimization

Advice about optimization with very interesting points like "Do I really need this state or can I just compute it every frame instead (Computation is fast, memory is slow)?" about which we do not always think in the day to day work

https://medium.com/@jasonbooth_86226/my-approach-to-optimization-bfcafc1f8768

#optimization #tips
Test Driven Indie Game Development

The author doesn't quite use TDD, but the point is still clear: automated tests increase initial development time, but save a lot more time to support code. Given that there are so many game-services now, support becomes 10 times more significant.

https://dbzer0.itch.io/hypnagonia/devlog/335569/test-driven-indie-game-development

#testing #automation #unittest
👍1
Drawing with SDFs in Unity

A simple drawer example with SDF shader

https://bronsonzgeb.com/index.php/2022/01/15/drawing-with-sdfs-in-unity/

#sdf
👍1
Best optimization tips by Unity engineers at Unite

Compilation of best Unity tips gathered at Unite conference. I spent a bunch of time rewatching those talks so you don’t have to.

https://gamedev.center/best-optimization-tips-by-unity-engineers-at-unite/

#unite #tips
👍3
Abusing For Loops In C# For Job Security

Found at r/shittyprogramming, indeed "helps" to become an irreplaceable developer. Still a fun read tho.

https://eddieabbondanz.io/post/c-sharp/abusing-for-loops-for-job-security/
👍1
Like Regular LINQ, but Faster and Without Allocations: Is It Possible?

Article got insights on how LINQ works. As a practical advice I don't find it really useful, because I am pretty sure you are not using LINQ in a hot path. And you gotta be a die-hard fan of it to carry an additional dependency just to use LINQ in critical sections

https://blog.devgenius.io/like-regular-linq-but-faster-and-without-allocations-is-it-possible-3d4724632e2a

#linq #enumerator #reflinq
👍1
When to make LODs

Look in the wireframe view, when it starts to get close to solid, you need to swap to a lower LOD, which significantly reduces the density of the wireframe view.
In many cases, you’re better off with a single LOD and an imposter for the distance, or in some cases no LODs and just an imposter.

https://medium.com/@jasonbooth_86226/when-to-make-lods-c3109c35b802

#rendering #lod
👍1
Procedural Generation with Cellular Automata

A CPU-based approach to procedurally generate cave-like structures. Looks like it can be rewritten with compute shader as an improvement, but don't forget to profile tho if you end up using this or similar algorithm, CPU-based can be absolutely fine performance-wise in your case. And hell of a lot easier to debug.

https://bronsonzgeb.com/index.php/2022/01/30/procedural-generation-with-cellular-automata/

#pcg #generation #cellularautomata
👍1
Protobuf In C# .NET – Performance Comparisons

Series about protobuf. My latest blog post with talks from Unite contains the advice about using binary data serialization if native Unity formats are not suitable for your project. So in such cases you can consider protobuf.

https://dotnetcoretutorials.com/2022/01/18/protobuf-in-c-net-part-4-performance-comparisons/

#serialization #protobuf
👍1
DynamicResolutionSample: A simple, game usable noscript to drive Unity's dynamic resolution implementation.

Dynamic resolution is a technique for scaling render targets to reduce the number of pixels being processed to adapt to GPU performance concerns. It works by allocating the target resources at full resolution and then aliasing scaled versions over the same memory, which is very lightweight on the platforms/graphics APIs where it's supported. The final present target is unscaled so an upscale blit will always have to happen somewhere in the pipeline before that point.

https://github.com/Unity-Technologies/DynamicResolutionSample

#dynamicresolution #gpu #optimization
👍1
18 months of game programming interviews postmortem

One of the best posts in r/gamedev. Three-year old, but became even more relevant due to the global remote work trend, so more and more people got the chance to work in AAA companies.

https://www.reddit.com/r/gamedev/comments/9n847g/18_months_of_game_programming_interviews/

#interview #career
👍1
How bad are small triangles on GPU and why?

Small triangles are bad for performance. Kinda old post, but still holds true. Keep in mind the vertex density when creating LODs for your meshes, most likely you don't need a lot of different LODs wasting memory and reducing performance. And of course don't forget about imposters for distant objects.

https://www.g-truc.net/post-0662.html

#gpu #rendering #performance
👍1