res-avatar-unity/Assets/_PoiyomiShaders/Shaders/7.3/Includes/CGI_PoiBackFace.cginc

29 lines
878 B
HLSL
Raw Normal View History

2023-07-16 02:51:23 +00:00
#ifndef POI_BACKFACE
#define POI_BACKFACE
float _BackFaceEnabled;
uint _BackFaceTextureUV;
float _BackFaceDetailIntensity;
float _BackFaceEmissionStrength;
float2 _BackFacePanning;
float _BackFaceHueShift;
UNITY_DECLARE_TEX2D_NOSAMPLER(_BackFaceTexture); float4 _BackFaceTexture_ST;
float3 BackFaceColor;
void applyBackFaceTexture()
{
BackFaceColor = 0;
UNITY_BRANCH
if (_BackFaceEnabled)
{
if(!poiMesh.isFrontFace)
{
albedo = POI2D_SAMPLER_PAN(_BackFaceTexture, _MainTex, poiMesh.uv[_BackFaceTextureUV], _BackFacePanning);
_DetailTexIntensity = _BackFaceDetailIntensity;
BackFaceColor = albedo.rgb;
_MainHueShift = _BackFaceHueShift;
}
}
}
#endif