From 9c7e357f50fda9d7bec2ce9bc3772d1c77530748 Mon Sep 17 00:00:00 2001 From: notargs Date: Tue, 25 Apr 2023 14:26:31 +0900 Subject: [PATCH] =?UTF-8?q?fogFactorAndVertexLight=E3=81=AE=E8=A8=88?= =?UTF-8?q?=E7=AE=97=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VRM10/vrmc_materials_mtoon_forward_vertex.hlsl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_forward_vertex.hlsl b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_forward_vertex.hlsl index 17c2984ad..2420d9971 100644 --- a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_forward_vertex.hlsl +++ b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_forward_vertex.hlsl @@ -3,6 +3,7 @@ #ifdef MTOON_URP #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #else #include #include @@ -56,8 +57,14 @@ Varyings MToonVertex(const Attributes v) // v is UnityCG macro specified name. output.tangentWS = half4(UnityObjectToWorldDir(v.tangentOS), tangentSign); #endif + #ifdef MTOON_URP + half3 vertexLight = VertexLighting(output.positionWS, output.normalWS); + half fogFactor = ComputeFogFactor(output.pos.z); + output.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #else UNITY_TRANSFER_FOG(output, output.pos); UNITY_TRANSFER_LIGHTING(output, v.texcoord1.xy); + #endif return output; }