Everyday Unity – Telegram
Everyday Unity
1.1K 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
This media is not supported in your browser
VIEW IN TELEGRAM
Hot reload: a tool which lets you skip all compile times in Unity

It uses a custom C# compiler integration, and only compiles the code that was changed. That output is used to patch up the existing C# code while it's running. It works both inside and outside of playmode.
There shouldn't be any serious risk as you can always just recompile the code normally to reset any bad changes which may have failed to apply (i.e. when using some unsupported features).
It doesn't currently support changes that would require vtable modifications like having a type implement another interface or adding an override to an existing virtual method. There are some other unsupported features that can be checked in the docs, but generally it covers a lot of use cases and can be really useful.

https://www.reddit.com/r/Unity3D/comments/10v66xi/we_just_released_a_free_tool_which_lets_you_skip/

Website: https://hotreload.net/

#editortool #hotreload
👍7
Energy Shield Hologram in Unity Shader Graph

A really great post that brakes down a complex shader into the list of smaller effects

https://danielilett.com/2023-02-09-tut6-3-energy-shield/

#urp #shadergraph #forcefield
👍4
Addressables: Planning and best practices

A helpful overview of what Addressables is (hope everyone knows it by this point anyway) and how to use it effectively. Provides strategies when and how to organize your content. As well as handy cheatsheets for a few common use cases:
- A mobile game with frequent content updates
- A standalone, self-contained desktop or console game
- A VR game built for Meta Quest 2

https://blog.unity.com/technology/addressables-planning-and-best-practices

#addressables #assetbundle
👍7
Demystifying Floating Point Precision

Floating point numbers have limited precision. You have likely encountered bugs where things start breaking after too much time has elapsed, or after something has moved too far from the origin.
This post aims to show you how to answer the questions:
What precision do I have at a number?
When will I hit precision issues?

https://blog.demofox.org/2017/11/21/floating-point-precision/

#float
👍3
water-shader-unity: Simulation of water in Unity

Realistic water was achieved by implementing selected water effects:
- Reflection
- Refraction
- Caustics
- Waves
- Flow
- Underwater fog

https://github.com/leonjovanovic/water-shader-unity

#water #shader
👍2
TextureMerge: Software to merge (or pack) textures into image channels, producing one image with up to four textures.

The tool to prepare assets for a very common optimization technique where you pack up to 4 grey scale textures into one by using different channels to save memory.

https://github.com/Fidifis/TextureMerge

#texturepacker #optimization #memory
👍4
Unity Threading; Provides helper APIs for multithreading in Unity.

Provides:
- Simple Threading
- Async Threading: helper methods to access to the Unity main thread or background threads using an async/await style
- Unity Coroutines: helper methods to reduce allocations in Unity coroutines.
- New Coroutines: a reimplementation of Unity coroutines that returns a value type instead to avoid allocations.
- Unity Jobs: helper methods to execute jobs in the Unity Job system.


https://github.com/Enderlook/Unity-Threading

#async #thread
👍5
UnityURP-MobileDrawMeshInstancedIndirectExample

A simplified sample that demonstrates DrawMeshInstancedIndirect API on mobile platforms. Only contains a simple CPU frustum culling (not even a quadtree) -> minimum compute GPU frustum culling (no Acceleration Algorithms), then just 1 DrawMeshInstancedIndirect call.
It also contains a RendererFeature(GrassBendingRTPrePass.cs) to render an offscreen RT(R8), which renders top-down view grass bending area (by trail renderer following moving objects)

https://github.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample

#drawmesh #instancing #grass #shader #compute
👍4
BurstCollections: Burst friendly (special) native collections for Unity

Contains:
Native2dTree
NativeAccumulatedProduct{T, Op}
NativeArray2d{T}
NativeBoundingVolumeTree{T}
NativeIndexedArray{Id, T}
NativeIndexedList{Id, T}
NativePointQuadtree
NativeStack{T}
NativeStackedLists{T}

In the repo there are use cases when these collections can be used to solve particular tasks.

https://github.com/andywiecko/BurstCollections

#burst #native #jobsystem
👍9
Improving and expanding use cases: Physics changes in Unity 2022.2

New physics features to squeeze more performance:
- Batches physics queries
- A lot faster OnContact callbacks

https://blog.unity.com/technology/physics-changes-in-unity-2022-2

#physics
👍2