Skip to content

Instantly share code, notes, and snippets.

@TheHelpfulHelper
TheHelpfulHelper / UdonSharpCustomClassPattern.cs
Created January 15, 2024 01:31
U# Fake Custom Classes Pattern
// NOTE: The current U# compiler will log an error, it however still compiles and functions correctly!
public class MyCustomClass : DataDictionary
{
public static MyCustomClass ctor() // you can call this whatever you want, New(), Create(), or here ctor()
{
var instance = (MyCustomClass)new DataDictionary();
instance["player"] = new DataToken(Networking.LocalPlayer); // Example of something you might want to do in the constructor
@herohiralal
herohiralal / EdgeDetection.shader
Created June 29, 2021 02:20
URP Sobel Edge Detection
Shader "Universal Render Pipeline/Post-Processing/EdgeDetection"
{
Properties
{
[Toggle(ENABLED)] __enabled("Enabled", Float) = 1
[MainTex] [HideInInspector] _MainTex ("Base Map", 2D) = "white" { }
[MainColor] _Color ("Color", Color) = (1, 1, 1, 1)
_Thickness ("Thickness", Float) = 0
@27Cobalter
27Cobalter / Unlit_Alpha_Trans_hide.shader
Last active October 27, 2022 04:22
KawaiiCameraをカメラで映らなくするシェーダ+最前面表示
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Unlit alpha-blended shader.
// - no lighting
// - no lightmap support
// - no per-material color
Shader "Custom/Unlit_Alpha_Trans_hide" {
@h3r
h3r / noise.inc
Last active October 29, 2024 22:19
hlsl Noise generator functions
/*
Most of this code hasn't been made by me (maybe partially tweaked to fit) and just collected those snippets from many sources
across the internet. I haven't saved some of the original author names and all the credits
should go to them. I'm pretty some of you may find optimizations to them, feel free to leave a comment.
HPlass ([email protected]) - 2020
Source:
https://thebookofshaders.com/11/
https://thebookofshaders.com/edit.php#11/lava-lamp.frag
using System;
using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDKBase;
using VRC.Udon;
public class TakeMyHand : UdonSharpBehaviour
{
VRCPlayerApi[] players = new VRCPlayerApi[0];
@EddieCameron
EddieCameron / EdgeDetect.cs
Created September 3, 2017 00:08
EdgeDetection in new Unity Postprocessing Stack
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
[Serializable]
[PostProcess( typeof( EdgeDetectRenderer ), PostProcessEvent.BeforeStack, "Custom/EdgeDetectNormals" )]
public sealed class EdgeDetect : PostProcessEffectSettings {
public enum EdgeDetectMode {
Shader "Hidden/ScreenSpaceLocalReflection"
{
Properties
{
_MainTex("Base (RGB)", 2D) = "" {}
}
SubShader
{
@aras-p
aras-p / Projector Light.shader
Last active September 9, 2024 14:33
Projector shaders without fixed function
Shader "Projector/Light" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Cookie", 2D) = "" {}
_FalloffTex ("FallOff", 2D) = "" {}
}
Subshader {
Pass {
ZWrite Off