Skip to content

Instantly share code, notes, and snippets.

View capperstrnd's full-sized avatar

Casper Strand capperstrnd

  • Lund, Sweden
  • 16:06 (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")]
@capperstrnd
capperstrnd / TwitchTvEmbedOnlyWhenLive.html
Last active March 11, 2022 21:01
A simple script for embedding Twitch stream only when the channel is live, otherwise it is hidden.
<html>
<head>
<style>
.hide { display:none; }
/* Optional: The following css just makes sure the twitch video stays responsive */
#twitch {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;