Added SurfaceFeatureFlags;

Added OutlineScope;
Added AngelRingScope;

Change up Outline pass
This commit is contained in:
Misaki
2025-01-29 21:54:17 +09:00
parent 018300e046
commit d8b12a0ca9
18 changed files with 249 additions and 248 deletions

View File

@@ -32,7 +32,7 @@ struct UTSData
struct UTSSurfaceData
{
uint materialFeatures;
uint surfaceFeatures;
real3 baseColor;
real3 firstShadingColor;
@@ -56,7 +56,7 @@ struct UTSSurfaceData
struct UtsBSDFData
{
uint materialFeatures;
uint surfaceFeatures;
real3 diffuseColor;
real3 firstShadingDiffuseColor;
@@ -87,7 +87,7 @@ UTSSurfaceData ConvertSurfaceDataToUTSSurfaceData(SurfaceData surfaceData)
UTSSurfaceData output;
ZERO_INITIALIZE(UTSSurfaceData, output);
output.materialFeatures = surfaceData.materialFeatures;
output.surfaceFeatures = surfaceData.materialFeatures;
output.baseColor = surfaceData.baseColor;
output.alpha = 1.0;
output.normalWS = surfaceData.normalWS;
@@ -110,7 +110,7 @@ UTSSurfaceData GetUTSSurfaceData(FragInputs input, float3 V)
UTSSurfaceData output;
//ZERO_INITIALIZE(UTSSurfaceData, output);
output.materialFeatures = 0;
output.surfaceFeatures = _SurfaceFeatures;
float4 mainTexture = SAMPLE_TEXTURE2D(_BaseColorMap, sampler_BaseColorMap, TRANSFORM_TEX(input.texCoord0, _BaseColorMap));
output.baseColor = mainTexture.rgb * _BaseColor.rgb;
@@ -200,7 +200,7 @@ UtsBSDFData ConvertUTSSurfaceDataToUTSBSDFData(UTSSurfaceData surfaceData)
{
UtsBSDFData output;
output.materialFeatures = surfaceData.materialFeatures;
output.surfaceFeatures = surfaceData.surfaceFeatures;
output.diffuseColor = UtsComputeDiffuseColor(surfaceData.baseColor, surfaceData.metallic, 0.05);
output.firstShadingDiffuseColor = UtsComputeDiffuseColor(surfaceData.firstShadingColor, surfaceData.metallic, 0.05);
@@ -298,12 +298,6 @@ PreLightData GetPreLightData_UTS(float3 V, PositionInputs posInput, inout UtsBSD
// Construct a right-handed view-dependent orthogonal basis around the normal
preLightData.orthoBasisViewNormal = GetOrthoBasisViewNormal(V, N, preLightData.NdotV);
preLightData.ltcTransformCoat = 0.0;
if (HasFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_CLEAR_COAT))
{
preLightData.ltcTransformCoat = SampleLtcMatrix(CLEAR_COAT_PERCEPTUAL_ROUGHNESS, clampedNdotV, LTCLIGHTINGMODEL_GGX);
}
return preLightData;
}

View File

@@ -154,7 +154,7 @@ float GetHairShadow(PositionInputs posInput, float3 L)
float2 samplingPoint = (posInput.positionSS + shadowLength * viewLightDir.xy * (_ScreenSize.xy / float2(1920.0f, 1080.0f))) * _ScreenSize.zw; // Use 1080p as the reference resolution to achieve consistent shadow lengths across various screen resolutions.
// Then sample the hair buffer, to see if the fragment lands in shadow.
float2 scaledUVs = samplingPoint * _HairShadowRTHandleScale; // 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.
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 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.