|
|
|
|
|
|
|
|
|
|
HLSLINCLUDE |
|
|
|
|
|
|
|
// Note: Screenspace shadow resolve is only performed when shadow cascades are enabled |
|
|
|
// Shadow cascades require cascade index and shadowCoord to be computed on pixel. |
|
|
|
#define _SHADOWS_CASCADE |
|
|
|
|
|
|
|
#pragma prefer_hlslcc gles |
|
|
|
#pragma exclude_renderers d3d11_9x |
|
|
|
//Keep compiler quiet about Shadows.hlsl. |
|
|
|
|
|
|
#include "LWRP/ShaderLibrary/Core.hlsl" |
|
|
|
#include "LWRP/ShaderLibrary/Shadows.hlsl" |
|
|
|
|
|
|
|
// Note: Screenspace shadow resolve is only performed when shadow cascades are enabled |
|
|
|
// Shadow cascades require cascade index and shadowCoord to be computed on pixel. |
|
|
|
#define _SHADOWS_CASCADE |
|
|
|
|
|
|
|
#if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) |
|
|
|
TEXTURE2D_ARRAY_FLOAT(_CameraDepthTexture); |
|
|
|
|
|
|
float3 wpos = mul(unity_CameraToWorld, float4(vpos, 1)).xyz; |
|
|
|
|
|
|
|
//Fetch shadow coordinates for cascade. |
|
|
|
float4 coords = TransformWorldToShadowCoord(wpos); |
|
|
|
float4 coords = TransformWorldToShadowCoord(wpos); |
|
|
|
|
|
|
|
// Screenspace shadowmap is only used for directional lights which use orthogonal projection. |
|
|
|
ShadowSamplingData shadowSamplingData = GetMainLightShadowSamplingData(); |
|
|
|