Skip to content

Instantly share code, notes, and snippets.

View bitinn's full-sized avatar
🔜
Personal Project

David Frank bitinn

🔜
Personal Project
View GitHub Profile
@bitinn
bitinn / MainLightDataNode.cs
Last active August 11, 2023 08:15 — forked from ciro-unity/MainLightNode.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")]
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>margin collapse algorithm bug workaround</title>
<style>
body{
margin:0;
}
.example {