Skip to content

Instantly share code, notes, and snippets.

View crl's full-sized avatar
🍊
Out sick

carl crl

🍊
Out sick
View GitHub Profile
@crl
crl / FlowMap.shader
Created May 23, 2019 16:17 — forked from TarasOsiris/FlowMap.shader
Flow Map Shader for Unity3D. Used with Sprites.
Shader "Custom/Flow Map"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
// Flow
_FlowMap ("Flow Map", 2D) = "white" {}
_FlowSpeed ("Flow Speed", float) = 0.05
@crl
crl / UI-DitheredClip.shader
Created August 20, 2021 17:42 — forked from Kink3d/UI-DitheredClip.shader
An alpha clip version on Unity's default UI shader with a dithered variant
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "UI/DitheredClip"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
@crl
crl / dependency_test.md
Created September 30, 2021 16:17 — forked from QXSoftware/dependency_test.md
资源依赖正确性测试

资源依赖正确性测试

本次测试包含对AssetDatabase.GetDependenciesEditorUtility.CollectDependencies这两个获取资源的依赖资源的 API 的测试,以及对于meta残留对打AssetBundle的影响。

AssetDatabase.GetDependencies

输入资源路径,例如Assets/Material/demo.mat,以路径形式返回该资源依赖的资源列表,例如Assets/Texture/demo.jpg

这个 API 返回的结果是“错误”的,也就是带残留的。比如某个材质,原本的shader引用了4个纹理,然后切换其shader为新的shader使之只引用一个纹理,这时AssetDatabase.GetDependencies返回的结果还是4个纹理。

@crl
crl / pre-commit.sh
Created December 11, 2021 10:10 — forked from uhziel/pre-commit.sh
Subversion server pre-commit hook for Unity3D .meta file. 约束 Assets 目录下添加、删除、移动、改名文件或目录时,必须要携带对应 .meta 文件。 如果提交的 log 中包含"The Shawshank Redemption",可以逃避此规则。
#!/bin/bash
REPOS="$1"
TXN="$2"
SVNLOOK=svnlook
MAGICWORD='The Shawshank Redemption'
# Magic Word: The Shawshank Redemption.
# via http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-repository-hooks.html
@crl
crl / gist:f4598e9a4a56f57316c3aca22055f7e1
Last active October 25, 2023 12:47 — forked from Artein/gist:d91e9280838ea5a464fd861081645490
AndroidSymbolsShrinkerPostProcessor updates Android debug symbols to decrease the size via 7z
#if UNITY_EDITOR && UNITY_ANDROID
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
@crl
crl / StartExternalProcess.cs
Created May 29, 2023 09:41 — forked from ParanoidMann/StartExternalProcess.cs
System.Diagnostics.Proccess.cs wrapped sources for IL2CPP
#if UNITY_STANDALONE_WIN
using Microsoft.Win32.SafeHandles;
using System;
using System.Security;
using System.Security.Permissions;
using System.Runtime.InteropServices;
using System.Runtime.ConstrainedExecution;
@crl
crl / LightFlickerEffect.cs
Created September 15, 2024 15:08 — forked from sinbad/LightFlickerEffect.cs
Unity simple & fast light flicker script
using UnityEngine;
using System.Collections.Generic;
// Written by Steve Streeting 2017
// License: CC0 Public Domain http://creativecommons.org/publicdomain/zero/1.0/
/// <summary>
/// Component which will flicker a linked light while active by changing its
/// intensity between the min and max values given. The flickering can be
/// sharp or smoothed depending on the value of the smoothing parameter.
@crl
crl / BlurEffect.compute
Created September 19, 2024 12:35 — forked from ArieLeo/BlurEffect.compute
Unity URP custom render feature for UI Blur
#pragma kernel Downscale
#pragma kernel GaussianBlurVertical
#pragma kernel GaussianBlurHorizontal
#pragma kernel BoxBlur
Texture2D<float4> _Source;
RWTexture2D<float4> _Dest;
float _Amount;
float2 _Size;
@crl
crl / GrabPassBlit.shader
Created October 23, 2024 09:32 — forked from Refsa/GrabPassBlit.shader
Grab Screen Feature for URP 2.0
Shader "Hidden/GrabPassBlit"
{
Properties { }
SubShader
{
Tags { "RenderType"="Opaque" }
Pass
{
Name "FinalBlit"
@crl
crl / GrabPassBlit.shader
Created October 23, 2024 09:32 — forked from Refsa/GrabPassBlit.shader
Grab Screen Feature for URP 2.0
Shader "Hidden/GrabPassBlit"
{
Properties { }
SubShader
{
Tags { "RenderType"="Opaque" }
Pass
{
Name "FinalBlit"