A game about forced loneliness, made by TACStudios
at master 33 lines 708 B view raw
1#ifndef _OCCLUSION_TEST_COMMON_H 2#define _OCCLUSION_TEST_COMMON_H 3 4#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" 5 6float FarthestDepth(float depthA, float depthB) 7{ 8#if UNITY_REVERSED_Z 9 return min(depthA, depthB); 10#else 11 return max(depthA, depthB); 12#endif 13} 14 15float FarthestDepth(float4 depths) 16{ 17#if UNITY_REVERSED_Z 18 return Min3(depths.x, depths.y, min(depths.z, depths.w)); 19#else 20 return Max3(depths.x, depths.y, max(depths.z, depths.w)); 21#endif 22} 23 24bool IsVisibleAfterOcclusion(float occluderDepth, float queryClosestDepth) 25{ 26#if UNITY_REVERSED_Z 27 return queryClosestDepth > occluderDepth; 28#else 29 return queryClosestDepth < occluderDepth; 30#endif 31} 32 33#endif