Skip to content

Instantly share code, notes, and snippets.

View HappyMaki's full-sized avatar
🦒
Feeby!

Brandon Ling HappyMaki

🦒
Feeby!
View GitHub Profile
@HappyMaki
HappyMaki / AnyValue.cs
Created January 21, 2025 21:05 — forked from adammyhre/AnyValue.cs
Serialized Callback System
using System;
using UnityEngine;
public enum ValueType { Int, Float, Bool, String, Vector3 }
[Serializable]
public struct AnyValue {
public ValueType type;
// Storage for different types of values
Shader "Custom/holographic_foil" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_FlowTex("flow)", 2D) = "white" {}
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
_Distance("Grating distance", Range(0,10000)) = 1600 // nm
_DiffractionRepeat("Num Diffraction Repeat", Range(1, 20)) = 8
}
// This one is tied up with JMO toon shading, so I can't just past the shader :/
half _SmushMinZ;
half _SmushXYOffset;
half4 _SmushCenterPos;
half4 initWorldPos;
// Vert
o.initWorldPos = worldPos;
half dist = _SmushMinZ - o.initWorldPos.z;
if(worldPos.z < _SmushMinZ)
// This one is tied up with JMO toon shading, so I can't just past the shader :/
half _SmushMinZ;
half _SmushXYOffset;
half4 _SmushCenterPos;
half4 initWorldPos;
// Vert
o.initWorldPos = worldPos;
half dist = _SmushMinZ - o.initWorldPos.z;
if(worldPos.z < _SmushMinZ)
@HappyMaki
HappyMaki / RenderPipelineHelper.cs
Created December 18, 2020 13:11 — forked from andreiagmu/RenderPipelineHelper.cs
RenderPipeline helper class
// RenderPipelineHelper
// by Andy Miira (Andrei Müller), November 2020
using UnityEngine;
using UnityEngine.Rendering;
namespace MirrorMirai.Helpers
{
public enum RenderPipelines
{
@HappyMaki
HappyMaki / MToonToRealToonShaderSwapper.cs
Created December 18, 2020 13:11 — forked from andreiagmu/MToonToRealToonShaderSwapper.cs
MToon to RealToon Shader Swapper for Unity
// MToon to RealToon Shader Swapper for Unity
// by Andy Miira (Andrei Müller), October 2019
//
//
// [IMPORTANT]
// You must add the file RenderPipelineHelper.cs to your project, linked below:
// https://gist.github.com/andreiagmu/b862ae47ef91be05f61ae2da26627a01
//
//
// [INSTRUCTIONS]