From 86917e13d85443ce1de530e0812727a2ec859744 Mon Sep 17 00:00:00 2001 From: doodlum Date: Sun, 1 Oct 2023 21:54:18 +0000 Subject: [PATCH] =?UTF-8?q?style:=20=F0=9F=8E=A8=20apply=20clang-format=20?= =?UTF-8?q?changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/Shaders/Lighting.hlsl | 106 +++++++++++++++++----------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index c0ea2baa6..f05fee90e 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -1530,17 +1530,17 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float dirLightAngle = dot(modelNormal.xyz, DirLightDirection.xyz); float3 dirDiffuseColor = dirLightColor * saturate(dirLightAngle.xxx); -# if defined(SOFT_LIGHTING) +# if defined(SOFT_LIGHTING) lightsDiffuseColor += nsDirLightColor.xyz * GetSoftLightMultiplier(dirLightAngle) * rimSoftLightColor.xyz; -# endif +# endif -# if defined(RIM_LIGHTING) +# if defined(RIM_LIGHTING) lightsDiffuseColor += nsDirLightColor.xyz * GetRimLightMultiplier(DirLightDirection, viewDirection, modelNormal.xyz) * rimSoftLightColor.xyz; -# endif +# endif -# if defined(BACK_LIGHTING) +# if defined(BACK_LIGHTING) lightsDiffuseColor += nsDirLightColor.xyz * (saturate(-dirLightAngle) * backLightColor.xyz); -# endif +# endif if (useSnowSpecular && useSnowDecalSpecular) { # if defined(SNOW) @@ -1635,17 +1635,17 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float lightAngle = dot(modelNormal.xyz, normalizedLightDirection.xyz); float3 lightDiffuseColor = lightColor * saturate(lightAngle.xxx); -# if defined(SOFT_LIGHTING) +# if defined(SOFT_LIGHTING) lightDiffuseColor += nsLightColor * GetSoftLightMultiplier(dot(modelNormal.xyz, lightDirection.xyz)) * rimSoftLightColor.xyz; -# endif // SOFT_LIGHTING +# endif // SOFT_LIGHTING -# if defined(RIM_LIGHTING) +# if defined(RIM_LIGHTING) lightDiffuseColor += nsLightColor * GetRimLightMultiplier(normalizedLightDirection, viewDirection, modelNormal.xyz) * rimSoftLightColor.xyz; -# endif // RIM_LIGHTING +# endif // RIM_LIGHTING -# if defined(BACK_LIGHTING) +# if defined(BACK_LIGHTING) lightDiffuseColor += (saturate(-lightAngle) * backLightColor.xyz) * nsLightColor; -# endif // BACK_LIGHTING +# endif // BACK_LIGHTING # if defined(SPECULAR) || (defined(SPARKLE) && !defined(SNOW)) lightsSpecularColor += GetLightSpecularInput(input, normalizedLightDirection, viewDirection, modelNormal.xyz, lightColor, shininess, uv) * intensityMultiplier.xxx; @@ -1740,17 +1740,17 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float lightAngle = dot(worldSpaceNormal.xyz, normalizedLightDirection.xyz); float3 lightDiffuseColor = lightColor * saturate(lightAngle.xxx); -# if defined(SOFT_LIGHTING) +# if defined(SOFT_LIGHTING) lightDiffuseColor += nsLightColor * GetSoftLightMultiplier(dot(worldSpaceNormal.xyz, lightDirection.xyz)) * rimSoftLightColor.xyz; -# endif +# endif -# if defined(RIM_LIGHTING) +# if defined(RIM_LIGHTING) lightDiffuseColor += nsLightColor * GetRimLightMultiplier(normalizedLightDirection, worldSpaceViewDirection, worldSpaceNormal.xyz) * rimSoftLightColor.xyz; -# endif +# endif -# if defined(BACK_LIGHTING) +# if defined(BACK_LIGHTING) lightDiffuseColor += (saturate(-lightAngle) * backLightColor.xyz) * nsLightColor; -# endif +# endif # if defined(SPECULAR) || (defined(SPARKLE) && !defined(SNOW)) lightsSpecularColor += GetLightSpecularInput(input, normalizedLightDirection, worldSpaceViewDirection, worldSpaceNormal.xyz, lightColor, shininess, uv) * intensityMultiplier.xxx; @@ -1809,7 +1809,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float3 vertexColor = (input.Color.yyy * (TintColor.xyz - 1.0.xxx) + 1.0.xxx) * color.xyz; # else float3 vertexColor = input.Color.xyz * color.xyz; -# endif // defined (HAIR) +# endif // defined (HAIR) # if defined(MULTI_LAYER_PARALLAX) float layerValue = MultiLayerParallaxData.x * TexLayerSampler.Sample(SampLayerSampler, uv).w; @@ -1873,52 +1873,52 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace psout.Albedo.w = 0; # else float alpha = baseColor.w; - -if (shaderDescriptors[0].PixelShaderDescriptor & _AdditionalAlphaMask){ - alpha *= MaterialData.z; -} else { - uint2 alphaMask = input.Position.xy; - alphaMask.x = ((alphaMask.x << 2) & 12); - alphaMask.x = (alphaMask.y & 3) | (alphaMask.x & ~3); - const float maskValues[16] = { - 0.003922, - 0.533333, - 0.133333, - 0.666667, - 0.800000, - 0.266667, - 0.933333, - 0.400000, - 0.200000, - 0.733333, - 0.066667, - 0.600000, - 0.996078, - 0.466667, - 0.866667, - 0.333333, - }; - - float testTmp = 0; - if (MaterialData.z - maskValues[alphaMask.x] < 0) - discard; -} + + if (shaderDescriptors[0].PixelShaderDescriptor & _AdditionalAlphaMask) { + alpha *= MaterialData.z; + } else { + uint2 alphaMask = input.Position.xy; + alphaMask.x = ((alphaMask.x << 2) & 12); + alphaMask.x = (alphaMask.y & 3) | (alphaMask.x & ~3); + const float maskValues[16] = { + 0.003922, + 0.533333, + 0.133333, + 0.666667, + 0.800000, + 0.266667, + 0.933333, + 0.400000, + 0.200000, + 0.733333, + 0.066667, + 0.600000, + 0.996078, + 0.466667, + 0.866667, + 0.333333, + }; + + float testTmp = 0; + if (MaterialData.z - maskValues[alphaMask.x] < 0) + discard; + } # if !(defined(TREE_ANIM) || defined(LODOBJECTSHD) || defined(LODOBJECTS)) alpha *= input.Color.w; # endif // !(defined(TREE_ANIM) || defined(LODOBJECTSHD) || defined(LODOBJECTS)) # if defined(DO_ALPHA_TEST) # if defined(HAIR) - if (shaderDescriptors[0].PixelShaderDescriptor & _DepthWriteDecals){ + if (shaderDescriptors[0].PixelShaderDescriptor & _DepthWriteDecals) { if (alpha - 0.0156862754 < 0) discard; alpha = saturate(1.05 * alpha); } -# endif // defined(HAIR) +# endif // defined(HAIR) if (alpha - AlphaThreshold < 0) discard; -# endif // defined(DO_ALPHA_TEST) +# endif // defined(DO_ALPHA_TEST) psout.Albedo.w = alpha; -# endif // defined(LANDSCAPE) && !defined(LOD_LAND_BLEND) +# endif // defined(LANDSCAPE) && !defined(LOD_LAND_BLEND) # if defined(LIGHT_LIMIT_FIX) if (perPassLLF[0].EnableLightsVisualisation) {