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
You might be thinking about shader performance wrong

Another rant on how memory access is slow, but has absolutely stunning animations quality, which the author made in Unity. Not really sure if this approach is faster than doing the same in some video editor, but definitely looks awesome

https://youtu.be/7YPPFIqUN84

#gpumemory #performance
An interesting benchmark of multiple Where vs && in Linq

#linq #performance
Intro to Jobs/Burst/DoD.

How performance of a common MonoBehaviour approach can be improved by x200 with jobs and burst. Of course it's kind of artificial example, but on the large scale performance gains look awesome. And the author is a real "heavyweight" engineer from Unity, definitely worth checking his other posts.

https://medium.com/@jasonbooth_86226/intro-to-jobs-burst-dod-66c6b81c017f

#jobs #burst #performance #dod
Stalling a GPU

- Remember that a shader is more like a bunch of jobs than serial GPU code, even though the syntax looks like serial code
- Avoid introducing extra dependencies between those jobs, and understand the dependencies you have as they can hint to additional optimizations
- The cost of certain operations can be completely masked by this parallelism.
- The cost of all texture samples are not the same

https://medium.com/@jasonbooth_86226/stalling-a-gpu-7faac66b11b9

#shader #optimization
How to unit test a class that uses static API

Unit tests validate code in isolation, but if it uses statics you cannot mock this dependency, therefore a subject under test cannot be properly isolated and unit tested. This trick makes the code testable, as well as introduces an important principle that improves your architecture by making it cleaner and more flexible.

https://gamedev.center/how-to-unit-test-a-class-that-uses-static-api/

#testing #cleancode #architecture #testrunner
👍1
4 tips for refactoring your code for readability

As I work in a big team on a game-service I cannot emphasize more how these principles are extremely important:
- Consistency
- Conventions
- Intent
- Brevity
Well, even if you work alone it still applies, since most likely you will read it many times in the future. These principles will save you a bunch of time later.

https://youtu.be/7oZBfpI_hxI

#cleancode #readability #refactoring
Const Strings – a very convenient way to shoot yourself in the foot

Const can be dangerous if you have your code base split into DLLs and one references consts of another

https://www.stum.de/2009/01/14/const-strings-a-very-convenient-way-to-shoot-yourself-in-the-foot

#const #readonly #dll
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