39 lines
1.2 KiB
HLSL
39 lines
1.2 KiB
HLSL
// SPDX-License-Identifier: (Not available for this version, you are only allowed to use this software if you have express permission from the copyright holder and agreed to the latest NiloToonURP EULA)
|
|
// Copyright (c) 2021 Kuroneko ShaderLab Limited
|
|
|
|
#pragma once
|
|
|
|
#if NiloToonIsAnyFurPass
|
|
void ApplyNiloToonFurVertexData(inout Varyings output, Attributes input)
|
|
{
|
|
float3 furVectorTexTS = float3(0.0, 0.0, 1.0);
|
|
float useFurVectorTex = 0.0;
|
|
#if _NILOTOON_FUR_VECTORTEX
|
|
{
|
|
furVectorTexTS = UnpackNormalScale(tex2Dlod(_NiloFurVectorTex, float4(input.uv, 0, 0)), _NiloFurVectorScale);
|
|
useFurVectorTex = 1.0;
|
|
}
|
|
#endif
|
|
|
|
float furCutoutLength = 1.0;
|
|
#if NiloToonFurDepthPrepassPass || NiloToonFurPrepassBufferDepthPass
|
|
furCutoutLength = _NiloFurCutoutLength;
|
|
#endif
|
|
|
|
output.furVector = NiloComputeFurVectorWS(
|
|
_NiloFurVector.xyz,
|
|
_NiloFurLength * _NiloFurStrength,
|
|
furCutoutLength,
|
|
input.normalOS,
|
|
input.tangentOS,
|
|
_NiloFurGravity,
|
|
input.color.rgb,
|
|
_VertexColor2FurVector,
|
|
furVectorTexTS,
|
|
useFurVectorTex);
|
|
|
|
output.furLayer = 0;
|
|
output.furVertexID = input.vertexID;
|
|
}
|
|
#endif
|