Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bgk-'s full-sized avatar

bgk bgk-

View GitHub Profile
@bgk-
bgk- / InputDetection.cs
Created July 29, 2023 22:50
Gamepad UI Module - Input Detection
public class InputDetection : MonoBehaviour
{
[SerializeField] private GamepadUIInputModule gamepadUIInputModule;
[SerializeField] private InputSystemUIInputModule inputSystemUIInputModule;
public enum Type
{
Gamepad,
Keyboard
}
@bgk-
bgk- / Notes.md
Last active January 8, 2022 19:48
17.waves Tower Radius Display

Branching

Some people feel branching is too slow, even for modern gpus, if so and you really want to optimize you can always change the branching to something like

bool ring = isRing(i.worldPos, _RingPositions[index], _RingRadii[index]);
o.Albedo = lerp(o.Albedo, RingColor, ring);
o.Emission = lerp(o.Emission, RingColor, ring);