Skip to content

Instantly share code, notes, and snippets.

View capperstrnd's full-sized avatar

Casper Strand capperstrnd

  • Lund, Sweden
  • 22:11 (UTC +02:00)
View GitHub Profile
@capperstrnd
capperstrnd / MainLightDataNode.cs
Created December 30, 2018 04:22 — forked from bitinn/MainLightDataNode.cs
A custom node for Unity's ShaderGraph to capture lighting and use it into the shader. Works as of Dec 2018, but the APIs might change!
using UnityEngine;
using UnityEditor.ShaderGraph;
using System.Reflection;
// IMPORTANT:
// - tested with LWRP and Shader Graph 4.6.0-preview ONLY
// - likely to break in SG 5.x and beyond
// - for HDRP, add your own keyword to detect environment
[Title("Custom", "Main Light Data")]