Skip to content

Instantly share code, notes, and snippets.

View baglayan's full-sized avatar
🤖
You will soon have your god, and you will make it with your own hands.

Meriç Bağlayan baglayan

🤖
You will soon have your god, and you will make it with your own hands.
  • İstanbul Technical University
  • Istanbul, Turkey
  • 17:22 (UTC +03:00)
View GitHub Profile
@simonbroggi
simonbroggi / MainLightNode.hlsl
Last active May 14, 2024 14:09
Unity Shadergraph custom function node for main light data
#ifndef MAINLIGHT_INCLUDED
#define MAINLIGHT_INCLUDED
void GetMainLightData_float(out half3 direction, out half3 color, out half distanceAttenuation, out half shadowAttenuation)
{
#ifdef SHADERGRAPH_PREVIEW
// In Shader Graph Preview we will assume a default light direction and white color
direction = half3(-0.3, -0.8, 0.6);
color = half3(1, 1, 1);
distanceAttenuation = 1.0;