Skip to content

Instantly share code, notes, and snippets.

@Kink3d
Kink3d / BumpedLightmappedDiffuse
Last active September 12, 2018 04:36
A port of the "Bumped Lightmapped Diffuse" shader in Source Engine
// ----------------------------------------
// Source Engine Bumped Lightmapped Diffuse
// Replace all values in full captials (not vertex semantics) with constants from the renderer
// Replace all functions in full captials with equivalent samplers
VertexInput
{
float3 position : POSITION;
float3 normal : NORMAL;
@Kink3d
Kink3d / MainLightNode.cs
Created May 8, 2018 00:13
A custom lighting node example for Shader Graph and Lightweight Render Pipeline
using UnityEngine;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
{
[Title("Input", "Lighting", "Main Light")]
public class MainLightNode : AbstractMaterialNode, IGeneratesBodyCode
{
public MainLightNode()
{
@Kink3d
Kink3d / UI-DitheredClip.shader
Created February 18, 2018 11:08
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