Skip to content

Instantly share code, notes, and snippets.

View SudoCat's full-sized avatar
🎉
HYPE

Robin Neal SudoCat

🎉
HYPE
View GitHub Profile
@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing

How to Use?

GUIStyle mystyle = new GUIStyle("some string from the list below");


UnityEditor.ConsoleWindow.Constants

  • "CN Box"
  • "Button"
@mcnamee
mcnamee / bitbucket-pipelines.yml
Last active December 14, 2023 03:57
Bitbucket Pipelines - Deploy via FTP to shared hosting
# Installation ---
# 1. In Bitbucket, add FTP_USERNAME, FTP_PASSWORD and FTP_HOST as environment variables.
# 2. Commit this file (bitbucket-pipelines.yml) to your repo (in the repo root dir)
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will
# push everything and initialize GitFTP)
#
# Usage ---
# - On each commit to master branch, it'll push all files to the $FTP_HOST
# - You also have the option to 'init' (see 'Installation' above) - pushes everything and initialises
# - Finally you can also 'deploy-all' (from Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:deploy-all)
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active July 8, 2024 08:35
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
@mattatz
mattatz / Easing.hlsl
Created January 19, 2018 04:37
Easing functions for HLSL.
#ifndef _EASING_INCLUDED_
#define _EASING_INCLUDED_
float ease_linear(float x) {
return x;
}
float ease_in_quad(float x) {
float t = x; float b = 0; float c = 1; float d = 1;
return c*(t/=d)*t + b;
@LotteMakesStuff
LotteMakesStuff / EditorExtensionMethods.cs
Last active April 28, 2023 09:50
A reimplementation of the logic in the Unity Editor that draws an inspector for a component. We can use this to learn how unity actually draws the inspector. for more info see https://www.patreon.com/posts/16724128
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
public static class EditorExtensionMethods
{
// Public reimplmentation of extention methods and helpers that are marked internal in UnityEditor.dll
@totallyRonja
totallyRonja / MaterialGradientDrawer.cs
Last active September 26, 2023 09:46
A Material Property Drawer for the [Gradient] attribute which lets you edit gradients and adds them to the shader as textures. More information here: https://twitter.com/totallyRonja/status/1368704187580682240
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
public class MaterialGradientDrawer : MaterialPropertyDrawer {
private int resolution;
@d7samurai
d7samurai / .readme.md
Last active June 9, 2024 01:22
Minimal D3D11 bonus material: pixel art antialiasing

Minimal D3D11 bonus material: pixel art antialiasing

A minimal Direct3D 11 implementation of "antialiased point sampling", useful for smooth fractional movement and non-integer scaling of pixel art AKA "fat pixel" aesthetics.

Also view below side-by-side point sampling comparison on YouTube (video is zoomed in to counter implicit downsampling & compression artifacts and make aa effect more apparent) or check out the Shadertoy.

skull

The actual sampler is set to bilinear filtering (the default D3D11 sampler state) in order to utilize single texture-read hardware interpolation, then emulating point sampling in the shader and applying AA at the fat pixel boundaries. Use with premultiplied alpha textures* and keep a one pixel transparent border around each sprite/tile.