Updated OutlineScope;
Reorgnize shader code;
This commit is contained in:
@@ -131,7 +131,7 @@ UTSSurfaceData GetUTSSurfaceData(FragInputs input, float3 V)
|
||||
#endif
|
||||
|
||||
float4 normalLocal = float4(0, 0, 1.0, 1.0);
|
||||
#if _NORMAL_MAP
|
||||
#if _NORMALMAP
|
||||
if (_Use_SSSLut)
|
||||
{
|
||||
normalLocal = SAMPLE_TEXTURE2D_LOD(_NormalMap, sampler_NormalMap, TRANSFORM_TEX(input.texCoord0, _BaseColorMap), _SSSIntensity);
|
||||
@@ -154,39 +154,39 @@ UTSSurfaceData GetUTSSurfaceData(FragInputs input, float3 V)
|
||||
float3 specularColor = 1;
|
||||
float anisotropy = 0;
|
||||
|
||||
#ifdef _MASKMAP
|
||||
float4 _MaskMap_var = SAMPLE_TEXTURE2D(_MaskMap, sampler_MaskMap, TRANSFORM_TEX(input.texCoord0, _BaseColorMap));
|
||||
metallic = _MaskMap_var.x;
|
||||
metallic = lerp(_MetallicRemapMin, _MetallicRemapMax, metallic);
|
||||
ao = _MaskMap_var.y;
|
||||
ao = lerp(_AORemapMin, _AORemapMax, ao);
|
||||
smoothness = _MaskMap_var.w;
|
||||
smoothness = lerp(_SmoothnessRemapMin, _SmoothnessRemapMax, smoothness);
|
||||
#endif
|
||||
#ifdef _MASKMAP
|
||||
float4 _MaskMap_var = SAMPLE_TEXTURE2D(_MaskMap, sampler_MaskMap, TRANSFORM_TEX(input.texCoord0, _BaseColorMap));
|
||||
metallic = _MaskMap_var.x;
|
||||
metallic = lerp(_MetallicRemapMin, _MetallicRemapMax, metallic);
|
||||
ao = _MaskMap_var.y;
|
||||
ao = lerp(_AORemapMin, _AORemapMax, ao);
|
||||
smoothness = _MaskMap_var.w;
|
||||
smoothness = lerp(_SmoothnessRemapMin, _SmoothnessRemapMax, smoothness);
|
||||
#endif
|
||||
|
||||
#ifdef _ANISOTROPY_MAP
|
||||
anisotropy = SAMPLE_TEXTURE2D(_AnisotropyMap, sampler_AnisotropyMap, TRANSFORM_TEX(input.texCoord0, _AnisotropyMap)).r;
|
||||
#if _PBR_Mode_KK
|
||||
anisotropy += _Anisotropy - 0.5;
|
||||
#else
|
||||
anisotropy *= _Anisotropy;
|
||||
#endif
|
||||
#else
|
||||
anisotropy = 1.0;
|
||||
anisotropy *= _Anisotropy;
|
||||
#endif
|
||||
#ifdef _ANISOTROPYMAP
|
||||
anisotropy = SAMPLE_TEXTURE2D(_AnisotropyMap, sampler_AnisotropyMap, TRANSFORM_TEX(input.texCoord0, _AnisotropyMap)).r;
|
||||
#if _PBR_Mode_KK
|
||||
anisotropy += _Anisotropy - 0.5;
|
||||
#else
|
||||
anisotropy *= _Anisotropy;
|
||||
#endif
|
||||
#else
|
||||
anisotropy = 1.0;
|
||||
anisotropy *= _Anisotropy;
|
||||
#endif
|
||||
|
||||
#ifdef _PBR_Mode_KK
|
||||
metallic = 0.0;
|
||||
smoothness *=_BSDFContribution;
|
||||
#endif
|
||||
#ifdef _PBR_Mode_KK
|
||||
metallic = 0.0;
|
||||
smoothness *=_BSDFContribution;
|
||||
#endif
|
||||
|
||||
#ifdef _PBR_Mode_TOON
|
||||
#ifdef _SPECULAR_COLOR_MAP
|
||||
specularColor = SAMPLE_TEXTURE2D(_SpecularColorMap, sampler_SpecularColorMap, TRANSFORM_TEX(input.texCoord0, _BaseColorMap)).rgb * _SpecularColor;
|
||||
#endif
|
||||
specularColor = GetSpecularColor(_MainTex_var.rgb * _BaseColor.rgb, metallic);
|
||||
#endif
|
||||
#ifdef _PBR_Mode_TOON
|
||||
#ifdef _SPECULARCOLORMAP
|
||||
specularColor = SAMPLE_TEXTURE2D(_SpecularColorMap, sampler_SpecularColorMap, TRANSFORM_TEX(input.texCoord0, _BaseColorMap)).rgb * _SpecularColor;
|
||||
#endif
|
||||
specularColor = GetSpecularColor(_MainTex_var.rgb * _BaseColor.rgb, metallic);
|
||||
#endif
|
||||
|
||||
output.metallic = metallic;
|
||||
output.ambientOcclusion = ao;
|
||||
|
||||
Reference in New Issue
Block a user