Skip to content

Instantly share code, notes, and snippets.

View xCyborg's full-sized avatar
🐢
Focusing

Sami Benx xCyborg

🐢
Focusing
  • Arcadia. 00.
View GitHub Profile
@xCyborg
xCyborg / CustomLighting.hlsl
Last active March 16, 2023 07:57
Unity URP Custom Lit ShaderGraph - BlinnPhong (Wire in the inputs, then add Diffuse + Specular)
#ifndef CUSTOM_LIGHTING_INCLUDED
#define CUSTOM_LIGHTING_INCLUDED
/* IN(5): SpecColor(4), Smoothness(1), WPos(3), WNormal(3), WView(3) */
/* OUT(2): Diffuse(3), Specular(3) NdotL(1) for toon ramp: point fltr +clamp mode */
void CalculateLights_half(half4 SpecColor, half Smoothness, half3 WPos, half3 WNormal, half3 WView,
out half3 Diffuse, out half3 Specular, out half NdotL)
{