更新
This commit is contained in:
@@ -0,0 +1,175 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
half4 mDebugVertexColor;
|
||||
|
||||
half3 mDebugUV1;
|
||||
half3 mDebugUV2;
|
||||
|
||||
half4 mDebugBaseMapColor;
|
||||
half3 mDebugNormalMapColor;
|
||||
half3 mDebugHeightMapColor;
|
||||
|
||||
half3 mDebugBaseMaskR;
|
||||
half3 mDebugBaseMaskG;
|
||||
half3 mDebugBaseMaskB;
|
||||
half3 mDebugBaseMaskA;
|
||||
half3 mDebugExtraMaskR;
|
||||
half3 mDebugExtraMaskG;
|
||||
half3 mDebugExtraMaskB;
|
||||
half3 mDebugExtraMaskA;
|
||||
|
||||
// pbr data
|
||||
half3 mDebugMetallic;
|
||||
half3 mDebugSmoothness;
|
||||
half3 mDebugRoughness;
|
||||
half3 mDebugOcclusion;
|
||||
half3 mDebugDiffuseColor;
|
||||
half3 mDebugSpecularColor;
|
||||
|
||||
half3 mDebugVertNormal;
|
||||
half3 mDebugVertTangent;
|
||||
half3 mDebugVertBitangent;
|
||||
half3 mDebugFragNormal;
|
||||
half3 mDebugFragTangent;
|
||||
half3 mDebugFragBitangent;
|
||||
|
||||
half3 mDebugNdotL;
|
||||
half3 mDebugNdotV;
|
||||
half3 mDebugOneMinusNdotV;
|
||||
|
||||
half3 mDebugMainLightColor;
|
||||
half3 mDebugMainLightDirection;
|
||||
half3 mDebugMainLightAttenuation;
|
||||
|
||||
half3 mDebugGIIndirectDiffuse;
|
||||
half3 mDebugGIIndirectSpecular;
|
||||
|
||||
half3 mDebugIndirectDiffuse;
|
||||
half3 mDebugDirectDiffuse;
|
||||
half3 mDebugDirectSpecular;
|
||||
half3 mDebugIndirectSpecular;
|
||||
*/
|
||||
|
||||
half4 GetDebugColor(half4 finalCol)
|
||||
{
|
||||
half3 debugColor = 0;
|
||||
bool isDirection = false;
|
||||
|
||||
if (_DebugVertColor == 1)
|
||||
debugColor = mVaryings.color.rgb;
|
||||
else if (_DebugVertColor == 2)
|
||||
debugColor = mVaryings.color.r;
|
||||
else if (_DebugVertColor == 3)
|
||||
debugColor = mVaryings.color.g;
|
||||
else if (_DebugVertColor == 4)
|
||||
debugColor = mVaryings.color.b;
|
||||
else if (_DebugVertColor == 5)
|
||||
debugColor = mVaryings.color.a;
|
||||
|
||||
if (_DebugUV == 1)
|
||||
debugColor.xy = mVaryings.uv.xy;
|
||||
else if (_DebugUV == 2)
|
||||
debugColor.xy = mVaryings.uv.zw;
|
||||
|
||||
if (_DebugMapColor == 1)
|
||||
debugColor = mBaseMapColor;
|
||||
else if (_DebugMapColor == 2)
|
||||
debugColor = mBaseMapColor.a;
|
||||
else if (_DebugMapColor == 3)
|
||||
debugColor = CalcuateDebugNormalMapColor();
|
||||
else if (_DebugMapColor == 4)
|
||||
debugColor = mHeightMapColor;
|
||||
|
||||
if (_DebugMaskChannel == 1)
|
||||
debugColor = mBaseMaskColor.r;
|
||||
else if (_DebugMaskChannel == 2)
|
||||
debugColor = mBaseMaskColor.g;
|
||||
else if (_DebugMaskChannel == 3)
|
||||
debugColor = mBaseMaskColor.b;
|
||||
else if (_DebugMaskChannel == 4)
|
||||
debugColor = mBaseMaskColor.a;
|
||||
else if (_DebugMaskChannel == 5)
|
||||
debugColor = mExtraMaskColor.r;
|
||||
else if (_DebugMaskChannel == 6)
|
||||
debugColor = mExtraMaskColor.g;
|
||||
else if (_DebugMaskChannel == 7)
|
||||
debugColor = mExtraMaskColor.b;
|
||||
else if (_DebugMaskChannel == 8)
|
||||
debugColor = mExtraMaskColor.a;
|
||||
|
||||
if (_DebugPBRData == 1)
|
||||
debugColor = mPBRData.metallic;
|
||||
else if (_DebugPBRData == 2)
|
||||
debugColor = mPBRData.smoothness;
|
||||
else if (_DebugPBRData == 3)
|
||||
debugColor = mPBRData.perceptualRoughness;
|
||||
else if (_DebugPBRData == 4)
|
||||
debugColor = mPBRData.diffuseColor;
|
||||
else if (_DebugPBRData == 5)
|
||||
debugColor = mPBRData.specularColor;
|
||||
|
||||
if (_DebugTBN != 0)
|
||||
{
|
||||
if (_DebugTBN == 1)
|
||||
debugColor = mVaryings.normalWS;
|
||||
else if (_DebugTBN == 2)
|
||||
debugColor = mVaryings.tangentWS;
|
||||
else if (_DebugTBN == 3)
|
||||
debugColor = mVaryings.bitangentWS;
|
||||
else if (_DebugTBN == 4)
|
||||
debugColor = mNormalWS;
|
||||
else if (_DebugTBN == 5)
|
||||
debugColor = mTangentWS;
|
||||
else if (_DebugTBN == 6)
|
||||
debugColor = mBitangentWS;
|
||||
|
||||
isDirection = true;
|
||||
}
|
||||
|
||||
if (_DebugDotProduct == 1)
|
||||
debugColor = mMainLightData.NdotL;
|
||||
else if (_DebugDotProduct == 2)
|
||||
debugColor = mNdotV;
|
||||
else if (_DebugDotProduct == 3)
|
||||
debugColor = mOneMinusNdotV;
|
||||
|
||||
if (_DebugMainLightData == 1)
|
||||
debugColor = mMainLightData.color;
|
||||
else if (_DebugMainLightData == 2)
|
||||
{
|
||||
debugColor = mMainLightData.direction;
|
||||
isDirection = true;
|
||||
}
|
||||
else if (_DebugMainLightData == 3)
|
||||
debugColor = mMainLightData.finalAttenuation;
|
||||
|
||||
if (_DebugGI == 1)
|
||||
debugColor = mGI.indirectDiffuse;
|
||||
else if (_DebugGI == 2)
|
||||
debugColor = mGI.indirectSpecular;
|
||||
|
||||
if (_DebugLightingComponent == 1)
|
||||
debugColor = mIndirectDiffuseFac;
|
||||
else if (_DebugLightingComponent == 2)
|
||||
debugColor = mDirDiffFac;
|
||||
else if (_DebugLightingComponent == 3)
|
||||
debugColor = mDirSpecFac;
|
||||
else if (_DebugLightingComponent == 4)
|
||||
debugColor = mIndirSpecFac;
|
||||
|
||||
half3 hsv = RgbToHsv(finalCol.rgb);
|
||||
if (_DebugFinalHSV == 1)
|
||||
debugColor = HsvToRgb(half3(hsv.x, 1, 1));
|
||||
else if (_DebugFinalHSV == 2)
|
||||
debugColor = hsv.y;
|
||||
else if (_DebugFinalHSV == 3)
|
||||
debugColor = hsv.z;
|
||||
|
||||
if (isDirection)
|
||||
{
|
||||
debugColor = (1 + debugColor) * 0.5;
|
||||
}
|
||||
|
||||
return half4(debugColor, 1);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b124b621d758b9b4a9a6bf7b5cec7f5f
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 328765
|
||||
packageName: LitPlus - URP Enhanced Lit Shader
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/GraphicsCat/Modules/LitPlus/Shaders/Includes/Features/Misc/DebugColors.hlsl
|
||||
uploadId: 820558
|
||||
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
||||
|
||||
sampler2D _LODCrossFadeDitherMask;
|
||||
half4 _LODCrossFadeDitherMask_ST;
|
||||
half4 _LODCrossFadeDitherMask_TexelSize;
|
||||
|
||||
// {TextureName}_TexelSize
|
||||
// a float4 property contains texture size information:
|
||||
// x contains 1.0/width
|
||||
// y contains 1.0/height
|
||||
// z contains width
|
||||
// w contains height
|
||||
|
||||
// float4 unity_LODFade
|
||||
// Level-of-detail fade when using LODGroup.
|
||||
// x is fade (0..1),
|
||||
// y is fade quantized to 16 levels,
|
||||
// z and w unused.
|
||||
|
||||
void ApplyLODCrossFade(float2 vpos)
|
||||
{
|
||||
#ifdef LOD_FADE_CROSSFADE
|
||||
{
|
||||
vpos /= _LODCrossFadeDitherMask_TexelSize.zw;
|
||||
half2 uv = vpos * _LODCrossFadeDitherMask_ST.xy + _LODCrossFadeDitherMask_ST.zw;
|
||||
half mask = tex2D(_LODCrossFadeDitherMask, uv).a;
|
||||
half sgn = unity_LODFade.x > 0 ? 1.0f : -1.0f;
|
||||
clip(unity_LODFade.x - mask * sgn);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f4af9969a98fc2498d5753f7e9c2f9a
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 328765
|
||||
packageName: LitPlus - URP Enhanced Lit Shader
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/GraphicsCat/Modules/LitPlus/Shaders/Includes/Features/Misc/LODCrossFade.hlsl
|
||||
uploadId: 820558
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
AmbientOcclusionFactor mSSAOFactor;
|
||||
|
||||
void InitSSAOFactor()
|
||||
{
|
||||
half2 screenSpaceUV = GetNormalizedScreenSpaceUV(mVaryings.positionCS);
|
||||
mSSAOFactor = (AmbientOcclusionFactor)1;
|
||||
#if _SCREEN_SPACE_OCCLUSION
|
||||
{
|
||||
mSSAOFactor = GetScreenSpaceAmbientOcclusion(screenSpaceUV);
|
||||
mPBRData.occlusion = min(mPBRData.occlusion, mSSAOFactor.indirectAmbientOcclusion);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d615dd337e1c23a44af9fe618dd28621
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 328765
|
||||
packageName: LitPlus - URP Enhanced Lit Shader
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/GraphicsCat/Modules/LitPlus/Shaders/Includes/Features/Misc/SSAO.hlsl
|
||||
uploadId: 820558
|
||||
Reference in New Issue
Block a user