From 2099885a6114cdbd6d183670e86c7992e9da3ae9 Mon Sep 17 00:00:00 2001 From: Vladislav Kantaev Date: Thu, 7 Jul 2022 21:26:59 +0300 Subject: [PATCH] Add TOON_SHADER_HOOK_RAMP_BRIGHTNESS --- .../ToonShader/Shaders/Custom/CustomToonShaderHookType.cs | 1 + .../Assets/DELTation/ToonShader/Shaders/ToonShader.shader | 2 ++ .../Assets/DELTation/ToonShader/Shaders/ToonShaderUtils.hlsl | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/Custom/CustomToonShaderHookType.cs b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/Custom/CustomToonShaderHookType.cs index 109f543..68a68be 100644 --- a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/Custom/CustomToonShaderHookType.cs +++ b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/Custom/CustomToonShaderHookType.cs @@ -14,5 +14,6 @@ public enum CustomToonShaderHookType TOON_SHADER_CUSTOM_CBUFFER, TOON_SHADER_HOOK_FORWARD_PASS_V2F, TOON_SHADER_HOOK_VERTEX_OUTPUT, + TOON_SHADER_HOOK_RAMP_BRIGHTNESS, } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShader.shader b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShader.shader index 1a3d606..cd51cdb 100644 --- a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShader.shader +++ b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShader.shader @@ -153,7 +153,9 @@ // TOON_SHADER_HOOK_VERTEX_INPUT // TOON_SHADER_HOOK_VERTEX_OUTPUT + // TOON_SHADER_HOOK_FRAGMENT_ALBEDO + // TOON_SHADER_HOOK_RAMP_BRIGHTNESS #include "Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderInput.hlsl" #include "Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderForwardPass_AppData.hlsl" diff --git a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderUtils.hlsl b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderUtils.hlsl index 6502ae8..a65d916 100644 --- a/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderUtils.hlsl +++ b/Packages/com.deltation.toon-shader/Assets/DELTation/ToonShader/Shaders/ToonShaderUtils.hlsl @@ -164,6 +164,10 @@ inline half get_brightness(const half4 position_cs, const half3 normal_ws, const brightness = min(brightness, brightness * ao_factor.directAmbientOcclusion); #endif + #ifdef TOON_SHADER_HOOK_RAMP_BRIGHTNESS + TOON_SHADER_HOOK_RAMP_BRIGHTNESS + #endif + return get_ramp(brightness); }