Skip to content

Instantly share code, notes, and snippets.

View LizzyFox-code's full-sized avatar
:octocat:
Programming

LizzyFox-code

:octocat:
Programming
  • Somewhere in an orbit of the Planet Earth
View GitHub Profile
@olegmrzv
olegmrzv / PlayerLoopCleaner.cs
Created April 4, 2024 13:07
PlayerLoop Disable Unity Modules
using System;
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
public static class PlayerLoopCleaner
{
private static readonly Type[] typesToRemove = new Type[] {
typeof(EarlyUpdate.Physics2DEarlyUpdate),
// Physics 2D
@LizzyFox-code
LizzyFox-code / collections.md
Last active July 19, 2024 02:56
Unity.Collections cheat sheet

Unity.Collections cheat sheet

The collections provided by this package fall into three categories:

  • The collection types in Unity.Collections whose names start with Native- have safety checks for ensuring that they're properly disposed and are used in a thread-safe manner.
  • The collection types in Unity.Collections.LowLevel.Unsafe whose names start with Unsafe- do not have these safety checks.
  • The remaining collection types are not allocated and contain no pointers, so effectively their disposal and thread safety are never a concern. These types hold only small amounts of data.

Allocators

@LizzyFox-code
LizzyFox-code / mathematics.md
Created January 24, 2024 15:54
Unity.Mathematics cheat sheet
@LizzyFox-code
LizzyFox-code / ContentScaler.cs
Last active April 5, 2024 13:11
Content scaler for Unity Noesis GUI
#if UNITY_5_3_OR_NEWER
#define NOESIS
using Noesis;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#endif
namespace NoesisGUI.Extensions.Scaling
@elringus
elringus / RenderMyCustomPass.cs
Last active April 26, 2023 11:12
Example for adding custom render passes via renderer features for lightweight render pipeline (LWRP)
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.LWRP;
// Inheriting from `ScriptableRendererFeature` will add it to the
// `Renderer Features` list of the custom LWRP renderer data asset.
public class RenderMyCustomPass : ScriptableRendererFeature
{
private class MyCustomPass : ScriptableRenderPass
{
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active July 17, 2024 10:54
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@elringus
elringus / BlendModes.c
Last active March 11, 2024 11:32
Popular blend mode algorithms implemented in Nvidia's Cg. https://elringus.me/blend-modes-in-unity/
fixed3 Darken (fixed3 a, fixed3 b)
{
return min(a, b);
}
fixed3 Multiply (fixed3 a, fixed3 b)
{
return a * b;
}