Changing UI style;

Updating RImeLight;
This commit is contained in:
2025-02-03 23:01:57 +09:00
parent 886432db7b
commit de370f845e
11 changed files with 157 additions and 79 deletions

View File

@@ -24,11 +24,6 @@
#define Uts_ColorSpaceDielectricSpec half4(0.04, 0.04, 0.04, 1.0 - 0.04)
#if 1
struct UTSData
{
};
struct UTSSurfaceData
{
@@ -185,7 +180,7 @@ UTSSurfaceData GetUTSSurfaceData(FragInputs input, float3 V)
#ifdef _SPECULARCOLORMAP
specularColor = SAMPLE_TEXTURE2D(_SpecularColorMap, sampler_SpecularColorMap, TRANSFORM_TEX(input.texCoord0, _BaseColorMap)).rgb * _SpecularColor;
#endif
specularColor = GetSpecularColor(_MainTex_var.rgb * _BaseColor.rgb, metallic);
specularColor = GetSpecularColor(output.baseColor, metallic);
#endif
output.metallic = metallic;
@@ -198,7 +193,7 @@ UTSSurfaceData GetUTSSurfaceData(FragInputs input, float3 V)
output.geomNormalWS = input.tangentToWorld[2];
output.tangentWS = Orthonormalize(input.tangentToWorld[0].rgb, normalWS);
output.subsurfaceColor = SAMPLE_TEXTURE2D(_SSSLutMap, sampler_MainTex, TRANSFORM_TEX(input.texCoord0, _BaseColorMap)) * _SSSIntensity;
output.subsurfaceColor = SAMPLE_TEXTURE2D(_SSSLutMap, s_linear_clamp_sampler, TRANSFORM_TEX(input.texCoord0, _BaseColorMap)) * _SSSIntensity;
output.anisotropy = anisotropy;
@@ -457,8 +452,6 @@ inline float3 LinearToGammaSpace(float3 linRGB)
#define UNITY_APPLY_FOG(coord,col) UNITY_APPLY_FOG_COLOR(coord,col,unity_FogColor)
#endif
#endif //#if false
#ifdef DIRECTIONAL
#define LIGHTING_COORDS(idx1,idx2) SHADOW_COORDS(idx1)
#define TRANSFER_VERTEX_TO_FRAGMENT(a) TRANSFER_SHADOW(a)

View File

@@ -149,7 +149,7 @@ float GetHairShadow(PositionInputs posInput, float3 L)
// Then sample the hair buffer, to see if the fragment lands in shadow.
float2 scaledUVs = samplingPoint * _HairShadowRTHandleScale.xy; // We have to including the scaling factor for our shadow map since we are not going to allocate new texture if the rendering resolution changed.
float hairDepth = SAMPLE_TEXTURE2D(_HairShadowTex, s_trilinear_clamp_sampler, scaledUVs).r;
float hairDepth = SAMPLE_TEXTURE2D(_HairShadowTex, s_linear_clamp_sampler, scaledUVs).r;
float shadowMask = posInput.deviceDepth <= hairDepth + _HairShadowDepthBias ? 1 : 0; // Hair < Face means Hair are closer to camera
// Note that we have LinearEyeDepth in the buffer. A comparison of depth is needed so that we don't project the shadow of hair behind the face.
shadow = lerp(1, 1.0 - hairShadowOpacity, shadowMask);
@@ -226,6 +226,18 @@ DirectLighting UtsShadeSurface(PositionInputs posInput, UtsBSDFData bsdfData, Pr
return lighting;
}
float3 UtsEvaluateRimLight(UtsBSDFData bsdfData, PreLightData preLightData, float3 L, float3 lightColor)
{
float clampNdotV = ClampNdotV(preLightData.NdotV);
float rimLightWeight = 1.0 - clampNdotV;
rimLightWeight = pow(rimLightWeight, exp2(lerp(3.0, 0.0, _RimLightLevel)));
float3 rimlightColor = rimLightWeight * _RimLightColor * _RimLightStrength;
float3 outColor = rimlightColor;
return outColor;
}
DirectLighting UtsEvaluateAngelRing(FragInputs input, float3 normalWS, float3 V)
{
DirectLighting lighting;

View File

@@ -256,6 +256,7 @@ void ApplyAmbientOcclusion(AmbientOcclusionFactor aoFactor, inout BuiltinData bu
void AdjustIndirectLighting(PreLightData preLightData, UtsBSDFData bsdfData, inout BuiltinData builtinData, inout AggregateLighting lighting)
{
builtinData.emissiveColor *= GetCurrentExposureMultiplier();
builtinData.bakeDiffuseLighting = ApplyCurrentExposureMultiplier(builtinData.bakeDiffuseLighting * bsdfData.diffuseColor * preLightData.diffuseFGD * _IndirectDiffuseIntensity);
lighting.indirect.specularReflected = ApplyCurrentExposureMultiplier(lighting.indirect.specularReflected * bsdfData.fresnel0 * _IndirectSpecularIntensity);
}

View File

@@ -140,11 +140,6 @@ float _PPDMaxSamples;
float _PPDMinSamples;
float _PPDLodThreshold;
float3 _EmissiveColor;
float _AlbedoAffectEmissive;
float _EmissiveExposureWeight;
float _ObjectSpaceUVMappingEmissive;
int _SpecularOcclusionMode;
// Transparency

View File

@@ -25,6 +25,13 @@ float _SDFHighlightStrength;
float _ShadowDistanceBias;
float _ShadowNormalBias;
// Emissive
float3 _EmissiveColor;
fixed _AlbedoAffectEmissive;
fixed _EmissiveExposureWeight;
float _ObjectSpaceUVMappingEmissive;
// Ambient
float _IndirectDiffuseMatCapLod;
@@ -37,6 +44,11 @@ float _IndirectSpecularMatCapLod;
float _IndirectSpecularIntensity;
float _SSRWeight;
//Rim Light
float4 _RimLightColor;
float _RimLightStrength;
float _RimLightLevel;
// Outline
float _OutlineWidth;
float4 _OutlineColor;
@@ -85,12 +97,9 @@ fixed _Is_UseTweakHighColorOnShadow;
float _TweakHighColorOnShadow;
float4 _Set_HighColorMask_ST;
float _Tweak_HighColorMaskLevel;
fixed _RimLight;
float4 _RimLightColor;
float _RimLight_Strength;
fixed _Is_LightColor_RimLight;
fixed _Is_NormalMapToRimLight;
float _RimLight_Power;
float _RimLight_InsideMask;
fixed _RimLight_FeatherOff;
fixed _LightDirection_MaskOn;
@@ -136,7 +145,6 @@ float4 _ViewShift;
float _ColorShift_Speed;
fixed _Is_ColorShift;
fixed _Is_ViewShift;
float3 emissive;
//
float _Unlit_Intensity;

View File

@@ -93,7 +93,6 @@ void Frag(PackedVaryingsToPS packedInput,
#endif
float4 UV0 = input.texCoord0;
UTSData utsData;
// We need to readapt the SS position as our screen space positions are for a low res buffer, but we try to access a full res buffer.
input.positionSS.xy = _OffScreenRendering > 0 ? (input.positionSS.xy * _OffScreenDownsampleFactor) : input.positionSS.xy;