Skip to content

Instantly share code, notes, and snippets.

View ColinLeung-NiloCat's full-sized avatar

ColinLeung-NiloCat ColinLeung-NiloCat

View GitHub Profile
@CarlLee
CarlLee / Bloom.shader
Last active May 16, 2023 10:28
UE4 bloom for unity
Shader "Hidden/Bloom"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
struct appdata
@alexanderameye
alexanderameye / DepthNormalsFeature.cs
Created December 23, 2019 11:04
DepthNormalsFeature
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class DepthNormalsFeature : ScriptableRendererFeature
{
class DepthNormalsPass : ScriptableRenderPass
{
int kDepthBufferBits = 32;
private RenderTargetHandle depthAttachmentHandle { get; set; }
@phi-lira
phi-lira / UnlitTexture.shader
Last active March 23, 2024 18:12
URP Unlit Texture example
Shader "Custom/UnlitTexture"
{
Properties
{
[MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1)
[MainTexture] _BaseMap("BaseMap", 2D) = "white" {}
}
// Universal Render Pipeline subshader. If URP is installed this will be used.
SubShader
@JimmyCushnie
JimmyCushnie / UnityGraphicsBullshit.cs
Last active May 23, 2024 12:13
Exposes some Unity URP graphics settings that are (for some stupid fucking bullshit reason) private.
using System.Reflection;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using ShadowResolution = UnityEngine.Rendering.Universal.ShadowResolution;
/// <summary>
/// Enables getting/setting URP graphics settings properties that don't have built-in getters and setters.
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@Refsa
Refsa / GrabScreenFeature.cs
Last active May 21, 2024 09:01
Unity URP custom grab pass
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class GrabScreenFeature : ScriptableRendererFeature
{
[System.Serializable]
public class Settings