#pragma target 4.5
#pragma only_renderers d3d11 ps4 vulkan metal // TEMP: unitl we go futher in dev
#include "../../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
float4 _TextureScaleBias;
float _TextureSlice;
#pragma vertex Vert
#pragma fragment Frag
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
TEXTURECUBE(_InputCubemap);
SAMPLERCUBE(sampler_InputCubemap);
#include "../Debug/DebugDisplay.cs.hlsl"
#include "../ShaderVariables.hlsl"
#pragma multi_compile _ SHADOWS_SHADOWMASK
#include "../../Core/ShaderLibrary/Color.hlsl"
#include "ShaderLibrary/Color.hlsl"
// CAUTION: In case deferred lighting need to support various lighting model statically, we will require to do multicompile with different define like UNITY_MATERIAL_LIT
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
// Include
//-------------------------------------------------------------------------------------
// Note: We have fix as guidelines that we have only one deferred material (with control of GBuffer enabled). Mean a users that add a new
// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem),
#include "../Debug/DebugDisplay.hlsl"
#ifndef UNITY_LIGHTING_INCLUDED
#define UNITY_LIGHTING_INCLUDED
#include "../../Core/ShaderLibrary/CommonLighting.hlsl"
#include "../../Core/ShaderLibrary/CommonShadow.hlsl"
#include "../../Core/ShaderLibrary/Sampling.hlsl"
#include "../../Core/ShaderLibrary/AreaLighting.hlsl"
#include "ShaderLibrary/CommonLighting.hlsl"
#include "ShaderLibrary/CommonShadow.hlsl"
#include "ShaderLibrary/Sampling.hlsl"
#include "ShaderLibrary/AreaLighting.hlsl"
// The light loop (or lighting architecture) is in charge to:
// - Define light list
#include "../../Debug/DebugDisplay.hlsl"
// Each #kernel tells which function to compile; you can have many kernels
#pragma kernel DeferredDirectionalShadow
#include "../../ShaderVariables.hlsl"
#include "../../Lighting/Lighting.hlsl"
#pragma kernel BigTileLightListGen
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "TilePass.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"
#include "SortingComputeUtils.hlsl"
#pragma kernel TileLightListGen_DepthRT_MSAA_SrcBigTile LIGHTLISTGEN=TileLightListGen_DepthRT_MSAA_SrcBigTile ENABLE_DEPTH_TEXTURE_BACKPLANE MSAA_ENABLED USE_TWO_PASS_TILED_LIGHTING
#pragma kernel ClearAtomic
#include "ShaderBase.hlsl"
//#pragma #pragma enable_d3d11_debug_symbols
// #pragma enable_d3d11_debug_symbols
#pragma kernel ScreenBoundsAABB
uniform int g_isOrthographic;
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "ShaderLibrary/Wind.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"
return BlendLayeredScalar(height0, height1, height2, height3, weights);
}
#include "../../../Core/ShaderLibrary/PerPixelDisplacement.hlsl"
#include "ShaderLibrary/PerPixelDisplacement.hlsl"
#endif // defined(_PIXEL_DISPLACEMENT) && LAYERS_HEIGHTMAP_ENABLE
#include "../../../Core/ShaderLibrary/GeometricTools.hlsl"
#include "../../../Core/ShaderLibrary/tessellation.hlsl"
#include "ShaderLibrary/GeometricTools.hlsl"
#include "ShaderLibrary/tessellation.hlsl"
// Define refraction keyword helpers
#define HAS_REFRACTION (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
#if HAS_REFRACTION
# include "../../../Core/ShaderLibrary/Refraction.hlsl"
# include "ShaderLibrary/Refraction.hlsl"
# if defined(_REFRACTION_PLANE)
# define REFRACTION_MODEL(V, posInputs, bsdfData) RefractionModelPlane(V, posInputs.positionWS, bsdfData.normalWS, bsdfData.ior, bsdfData.thickness)
#include "../../../Core/ShaderLibrary/SampleUVMapping.hlsl"
#include "ShaderLibrary/SampleUVMapping.hlsl"
#include "../MaterialUtilities.hlsl"
return SAMPLE_TEXTURE2D_LOD(_HeightMap, sampler_HeightMap, param.uv + texOffsetCurrent, lod).r;
void ApplyDisplacementTileScale(inout float height)
{
#include "../../../../Core/ShaderLibrary/Common.hlsl"
TEXTURE2D(_IrradianceSource);
#include "../../../../Core/ShaderLibrary/Packing.hlsl"
#include "ShaderLibrary/Packing.hlsl"
#include "../../../ShaderVariables.hlsl"
#include "../../../Lighting/LightDefinition.cs.hlsl"
#pragma only_renderers d3d11 ps4 vulkan metal // TEMP: until we go further in dev
#include "../../../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
struct Attributes
// Included headers
//--------------------------------------------------------------------------------------------------
#include "../../../../Core/ShaderLibrary/SpaceFillingCurves.hlsl"
#include "ShaderLibrary/SpaceFillingCurves.hlsl"
#define UNITY_MATERIAL_LIT
#include "../../../Material/Material.hlsl"
#define UNITY_MATERIAL_LIT // Needs to be defined before including Material.hlsl
#ifndef UNITY_MATERIAL_INCLUDED
#define UNITY_MATERIAL_INCLUDED
#include "../../Core/ShaderLibrary/Packing.hlsl"
#include "../../Core/ShaderLibrary/BSDF.hlsl"
#include "../../Core/ShaderLibrary/Debug.hlsl"
#include "../../Core/ShaderLibrary/GeometricTools.hlsl"
#include "../../Core/ShaderLibrary/CommonMaterial.hlsl"
#include "../../Core/ShaderLibrary/EntityLighting.hlsl"
#include "ShaderLibrary/BSDF.hlsl"
#include "ShaderLibrary/Debug.hlsl"
#include "ShaderLibrary/CommonMaterial.hlsl"
#include "ShaderLibrary/EntityLighting.hlsl"
#include "../Sky/AtmosphericScattering/AtmosphericScattering.hlsl"
// Guidelines for Material Keyword.
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../Material/Builtin/BuiltinData.hlsl"
TEXTURE2D(_DistortionTexture);
#include "../ShaderPass/FragInputs.hlsl"
#include "../ShaderPass/VaryingMesh.hlsl"
Texture2D<float> _Source;
RWTexture2D<float> _Result;
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#ifdef SSS_MODEL_BASIC
#include "../../../Core/ShaderLibrary/CommonMaterial.hlsl"
#error SHADERPASS_is_not_correctly_define
#endif
CBUFFER_START(UnityMetaPass)
// x = use uv1 as raster position
#ifndef UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#define UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#include "../../../Core/ShaderLibrary/VolumeRendering.hlsl"
#include "ShaderLibrary/VolumeRendering.hlsl"
#include "AtmosphericScattering.cs.hlsl"
#include "../SkyVariables.hlsl"
#pragma multi_compile _ ATMOSPHERICS_DEBUG
#pragma multi_compile _ PERFORM_SKY_OCCLUSION_TEST
#include "../../../../Core/ShaderLibrary/Color.hlsl"
#include "../../../../Core/ShaderLibrary/CommonLighting.hlsl"
TEXTURECUBE(_Cubemap);
#pragma fragment frag
TEXTURECUBE(_MainTex);
SAMPLERCUBE(sampler_MainTex);
// Ref: PBRT v3, 13.6.7 "Piecewise-Constant 2D Distributions".
// Note that we use the equiareal sphere-to-square mapping instead of the latitude-longitude one.
/* --- Input --- */
// Precomputes data for IntegrateLD(). See that function for a detailed description.
#ifdef SHADER_API_MOBILE
#define MAX_IBL_SAMPLE_CNT 34
#include "SkyManager.cs.hlsl"
SAMPLERCUBE(sampler_Cubemap);
#pragma enable_d3d11_debug_symbols
#include "AtmosphericScattering/AtmosphericScattering.hlsl"
#pragma multi_compile _ _ENABLE_SUN_DISK
float4 _SkyParam; // x exposure, y multiplier, z rotation
float4x4 _PixelCoordToViewDirWS; // Actually just 3x3, but Unity can only set 4x4
#define SHADOW_FPTL
# if defined(SHADER_API_D3D11)
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl"
# include "ShaderLibrary/API/D3D11.hlsl"
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl"
# include "ShaderLibrary/API/PSSL.hlsl"
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11_1.hlsl"
# include "ShaderLibrary/API/D3D11_1.hlsl"
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Metal.hlsl"
# include "ShaderLibrary/API/Metal.hlsl"
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Validate.hlsl"
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl"
# include "ShaderLibrary/API/Validate.hlsl"
# include "ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_FPTL
CBUFFER_START(ShadowLightData)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11_1.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Metal.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Validate.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl"
UNITY_DECLARE_DEPTH_TEXTURE(_CameraGBufferZ);
struct VertexOutputForwardNew