Skip to content

Instantly share code, notes, and snippets.

View naritaii's full-sized avatar
🏳️‍⚧️

Lily H naritaii

🏳️‍⚧️
View GitHub Profile
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class GlitchRenderFeature : ScriptableRendererFeature {
class CustomRenderPass : ScriptableRenderPass {
private Settings settings;
private FilteringSettings filteringSettings;
private int getSnakeSlot(int slot) {
final int horizontalLength = 2;
final int verticalLength = 5;
final int patternLength = 2 * (horizontalLength + verticalLength);
final int patternNo = slot / (patternLength + 1); // 10 -> 1, 8/10 -> 1, 12/10 -> 2
int slotNoInPattern = slot % (patternLength + 1); // 8/10 -> 8, 12/10 -> 2
final boolean isInReversedPattern = slotNoInPattern > patternLength / 2;
@hamza-cskn
hamza-cskn / Gradient.java
Last active May 23, 2023 02:43
Gradient Colored Text Animation API
import net.md_5.bungee.api.ChatColor;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Gradient {
List<String> gradient;
@sneha-belkhale
sneha-belkhale / Fbm.cginc
Last active January 21, 2026 17:06
Fractal Brownian Motion function to include in Unity Shader
float hash (float2 n)
{
return frac(sin(dot(n, float2(123.456789, 987.654321))) * 54321.9876 );
}
float noise(float2 p)
{
float2 i = floor(p);
float2 u = smoothstep(0.0, 1.0, frac(p));
float a = hash(i + float2(0,0));
using UnityEngine;
using UnityEngine.UI;
/*
Radial Layout Group by Just a Pixel (Danny Goodayle) - http://www.justapixel.co.uk
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
/// <summary>
/// Curved Layout Group Created by Freezy - http://www.ElicitIce.com
/// Posted on Unity Forums http://forum.unity3d.com/threads/script-curved-layout.403985/
///
/// Free for any use and alteration, source code may not be sold without my permission.
/// If you make improvements on this script please share them with the community.
///
/// </summary>
namespace UnityEngine.UI.Extensions
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
namespace UnityEngine.UI
{
[RequireComponent( typeof( RectTransform ) ), RequireComponent( typeof( Graphic ) ), DisallowMultipleComponent, AddComponentMenu( "UI/Flippable" )]
public class UIFlippable : MonoBehaviour, IMeshModifier
{
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
[RequireComponent( typeof( Text ), typeof( RectTransform ) )]
public class CurvedText : BaseMeshEffect
{
public AnimationCurve curveForText = AnimationCurve.Linear( 0, 0, 1, 10 );
public float curveMultiplier = 1;
public RectTransform rectTrans;
@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;
@Happsson
Happsson / CornerPin.shader
Created October 12, 2017 09:08
Four corner pin unity shader
Shader "Distort/CornerPin"
{
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_DLx("Down Left x", Range(-2.0,2.0)) = 0
_DLy("Down Left y", Range(-2.0,2.0)) = 0
_DRx("Down Right x", Range(-2.0,2.0)) = 0
_DRy("Down Right y", Range(-2.0,2.0)) = 0