Skip to content

Instantly share code, notes, and snippets.

View baukeJansen's full-sized avatar

Bauke baukeJansen

View GitHub Profile
@baukeJansen
baukeJansen / MainLightNode.shadersubgraph
Last active September 10, 2019 16:50
Modified Light Node (OG by @CiroContns on twitter) for Shader Graph 5.13.0 as a Subgraph (requires https://gist.github.com/baukeJansen/e2cf05f734a910aa13175b490942b4e6)
{
"m_SerializedProperties": [
{
"typeInfo": {
"fullName": "UnityEditor.ShaderGraph.BooleanShaderProperty"
},
"JSONnodeData": "{\n \"m_Name\": \"Use custom position?\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"e5f43fd4-7aff-4db7-a2f3-97156369e26b\"\n },\n \"m_DefaultReferenceName\": \"Boolean_F1F66C13\",\n \"m_OverrideReferenceName\": \"\",\n \"m_Value\": false\n}"
},
{
"typeInfo": {
@baukeJansen
baukeJansen / MainLightNode.hlsl
Last active May 2, 2022 21:08
Modified Light Node (OG by @CiroContns on twitter) for Shader Graph 5.13.0
// Warning, because of a bug the code below marks UnityInput.hlsl and Lighting.hlsl as imported but only adds the required functionality
// Reason = error with redefined variables
//===============================================================================================================================================================================
// Stripped down version of: https://github.com/Unity-Technologies/ScriptableRenderPipeline/blob/master/com.unity.render-pipelines.lightweight/ShaderLibrary/UnityInput.hlsl
//===============================================================================================================================================================================
#ifndef LIGHTWEIGHT_SHADER_VARIABLES_INCLUDED
#define LIGHTWEIGHT_SHADER_VARIABLES_INCLUDED
// Light Indices block feature