浏览代码
Merge pull request #228 from Unity-Technologies/shadows
Merge pull request #228 from Unity-Technologies/shadows
Update Shadows system/Branch_Batching2
GitHub
8 年前
当前提交
712ff1d3
共有 89 个文件被更改,包括 4561 次插入 和 3507 次删除
-
4.gitmodules
-
518Assembly-UnityScript.unityproj
-
117Assets/ScriptableRenderPipeline/AdditionalLightData.cs
-
40Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
16Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs
-
40Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs.hlsl
-
8Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs
-
4Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TileLightLoopProducer.cs
-
248Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/shadeopaque.compute
-
427Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
120Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
-
20Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl
-
1Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs
-
18Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
-
258Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs
-
161Assets/ScriptableRenderPipeline/fptl/LightingTemplate.hlsl
-
2Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs/Materials.meta
-
2Assets/TestScenes/HDTest/LayeredLitTest/Mesh/Materials.meta
-
2Assets/TestScenes/HDTest/WindTest/Materials.meta
-
2ProjectSettings/ProjectVersion.txt
-
123Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/Shadow.hlsl
-
35Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowAlgorithmsCustom.hlsl
-
941Assets/ScriptableRenderPipeline/common/Shadow/ShadowBase.cs
-
49Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl
-
115Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl
-
746Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowSampling.hlsl
-
67Assets/ScriptableRenderPipeline/common/Shadow/VectorArray.cs
-
998Assets/ScriptableRenderPipeline/common/Shadow/Shadow.cs
-
44Assets/ScriptableRenderPipeline/common/Shadow/ShadowBase.cs.hlsl
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl.meta
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow.meta
-
25Assets/ScriptableRenderPipeline/ShadowIncludes.inl
-
8Assets/ScriptableRenderPipeline/ShadowIncludes.inl.meta
-
9Assets/ScriptableRenderPipeline/common/Shadow.meta
-
26Assets/ScriptableRenderPipeline/fptl/ShadowContext.hlsl
-
9Assets/ScriptableRenderPipeline/fptl/ShadowContext.hlsl.meta
-
36Assets/ScriptableRenderPipeline/fptl/ShadowDispatch.hlsl
-
9Assets/ScriptableRenderPipeline/fptl/ShadowDispatch.hlsl.meta
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/Resources.meta
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/Resources/ShadowBlurMoments.compute.meta
-
235Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/Resources/ShadowBlurMoments.compute
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/Shadow.hlsl.meta
-
277Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowAlgorithms.hlsl
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowAlgorithms.hlsl.meta
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowAlgorithmsCustom.hlsl.meta
-
126Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowMoments.hlsl
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowMoments.hlsl.meta
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowSampling.hlsl.meta
-
133Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowTexFetch.hlsl
-
9Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowTexFetch.hlsl.meta
-
12Assets/ScriptableRenderPipeline/common/Shadow/Shadow.cs.meta
-
9Assets/ScriptableRenderPipeline/common/Shadow/ShadowBase.cs.hlsl.meta
-
12Assets/ScriptableRenderPipeline/common/Shadow/ShadowBase.cs.meta
-
249Assets/ScriptableRenderPipeline/common/Shadow/ShadowUtilities.cs
-
12Assets/ScriptableRenderPipeline/common/Shadow/ShadowUtilities.cs.meta
-
12Assets/ScriptableRenderPipeline/common/Shadow/VectorArray.cs.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/Shadow.hlsl.meta
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/Shadow.cs.meta
-
187Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowAlgorithms.hlsl
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowAlgorithms.hlsl.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowAlgorithmsCustom.hlsl.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowBase.cs.hlsl.meta
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowBase.cs.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowContext.hlsl.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowDispatch.hlsl.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowSampling.hlsl.meta
-
81Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowTexFetch.hlsl
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowTexFetch.hlsl.meta
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowUtilities.cs.meta
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/VectorArray.cs.meta
-
96Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowUtilities.cs
-
9Assets/ScriptableRenderPipeline/RenderPasses.meta
-
1001Assets/TestScenes/HDTest/GraphicTest/SSS/head.OBJ
-
148Assets/TestScenes/HDTest/GraphicTest/SSS/head.OBJ.meta
-
0/Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/Shadow.hlsl
-
0/Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowAlgorithmsCustom.hlsl
-
0/Assets/ScriptableRenderPipeline/common/Shadow/ShadowBase.cs
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl
-
0/Assets/ScriptableRenderPipeline/ShaderLibrary/Shadow/ShadowSampling.hlsl
-
0/Assets/ScriptableRenderPipeline/common/Shadow/VectorArray.cs
-
0/Assets/ScriptableRenderPipeline/common/Shadow/Shadow.cs
-
0/Assets/ScriptableRenderPipeline/common/Shadow/ShadowBase.cs.hlsl
|
|||
[submodule "Assets/TestScenes/Big"] |
|||
path = Assets/TestScenes/Big |
|||
url = https://github.com/Unity-Technologies/ScriptableRenderLoopScenes |
|||
[submodule "Assets/ScriptableRenderPipeline/PostProcessing"] |
|||
path = Assets/ScriptableRenderPipeline/PostProcessing |
|||
url = https://github.com/Unity-Technologies/PostProcessing |
|||
branch = v2 |
|
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProductVersion>10.0.20506</ProductVersion> |
|||
<SchemaVersion>2.0</SchemaVersion> |
|||
<RootNamespace></RootNamespace> |
|||
<ProjectGuid>{425682D6-2799-ABE6-93DD-977B724BF07C}</ProjectGuid> |
|||
<OutputType>Library</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<AssemblyName>Assembly-UnityScript</AssemblyName> |
|||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
<BaseDirectory>Assets</BaseDirectory> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>Temp\bin\Debug\</OutputPath> |
|||
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_0;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_VR;ENABLE_MODULAR_UNITYENGINE_ASSEMBLIES;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_2_0_SUBSET;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<NoWarn>0169</NoWarn> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>Temp\bin\Release\</OutputPath> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<NoWarn>0169</NoWarn> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.XML" /> |
|||
<Reference Include="System.Core" /> |
|||
<Reference Include="System.Runtime.Serialization" /> |
|||
<Reference Include="System.Xml.Linq" /> |
|||
<Reference Include="UnityEngine"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/Managed/UnityEngine.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEditor"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/Managed/UnityEditor.dll</HintPath> |
|||
</Reference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Scripts\Fps.js" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\CommonLighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderConfig.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Material.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowSampling.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitTessellation.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightingTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\lightlistbuild-clustered.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\TiledReflectionTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\lightlistbuild-clustered.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\FinalPass.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\SampleUVMappingNormalInternal.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightDefinitions.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightingUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\UnlitData.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassGBuffer.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\AreaLighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\SortingComputeUtils.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\ScreenSpaceAmbientObscurance.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitProperties.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowDispatch.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\GeometricTools.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\NFAA.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Builtin\BuiltinData.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\DebugDisplay.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassVelocity.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\ShaderPass\UnlitSharePass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\SceneSettings\Resources\DrawGaussianProfile.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\Resources\GGXConvolve.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\TessellationShare.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\common\Resources\BlitCubemap.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_DepthOfField\DepthOfFieldScatter.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassForwardUnlit.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowAlgorithmsCustom.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Shaders\WavingGrass.shader" /> |
|||
<None Include="Assets\LowEndMobilePipeline\Shaders\LowEndParticlesAdd.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Common.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Builtin\BuiltinData.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Wind.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\SampleUVMappingInternal.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Shaders\DistanceFade.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\Resources\BuildProbabilityTables.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitMetaPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\scrbound.compute" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\SSAA.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\LightingConvexHullUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassForward.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\lightlistbuild.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightBoundsDebug.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\D3D11_1.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_DepthOfField\DepthOfFieldDX11.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\SortingComputeUtils.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\FXAAPreset3.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\TilePassLoop.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPass.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\EntityLighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\ReflectionTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\MaterialUtilities.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\frag_ao.cginc" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowBase.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Resources\PreIntegratedFGD.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\CommonMaterial.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitDataInternal.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\DebugDisplay.cs.hlsl" /> |
|||
<None Include="Assets\LowEndMobilePipeline\Shaders\LowEndMobilePipelineCore.cginc" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowContext.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Lit.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitDepthPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\FragInputs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\LayeredLit\LayeredLit.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\UnlitProperties.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\scrbound.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\ColorGrading.hlsl" /> |
|||
<None Include="Assets\LowEndMobilePipeline\Shaders\LowEndParticlesMultiply.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\lightlistbuild-bigtile.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\Resources\DebugViewTiles.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\UnityStandardForwardNew.cginc" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassDistortion.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\Unlit.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\EyeAdaptation.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\Validate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\Textures\LICENSE.txt" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\Metal.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\Unlit.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\shadeopaque.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\PatchStandardShaderToNewNamingConvention.cginc" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitSharePass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\D3D11.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\LutGen.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\SSAOShader.shader" /> |
|||
<None Include="Assets\BasicRenderPipelineTutorial\BasicRenderPipelineShader.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassDepthOnly.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\TilePass.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\HDRISky\Resources\SkyHDRI.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\Textures\COPYING.txt" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\TiledLightingUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\TilePass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowAlgorithms.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitTessellation.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\Internal-DeferredComputeShading.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\Resources\DebugDisplayShadowMap.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\ChromaticAberrationShader.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\Resources\DebugDisplayLatlong.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\QuaternionMath.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\GlobalFog.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\Internal-DeferredShading.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\PSSL.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Tessellation.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\LightUtilities.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\BSDF.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitData.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\Forward.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\cleardispatchindirect.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\FinalPass.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Filtering.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\Shadow.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\CameraMotionBlurDX11.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitVelocityPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\SceneSettings\Resources\DrawTransmittanceGraph.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\RegularForwardReflectionTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\RegularForwardLightingUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\Resources\DebugViewMaterialGBuffer.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\CameraMotionBlur.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\CommonShadow.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\DLAA.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderVariables.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\ShaderBase.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\SkyManager.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Fibonacci.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\NormalSurfaceGradient.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Lit.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightingConvexHullUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitDistortionPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\Resources\ComputeGgxIblSampleData.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\lightlistbuild.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Resources\CombineSubsurfaceScattering.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\StandardTest.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Packing.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_DepthOfField\SeparableBlur.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\MotionBlurClear.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\EyeAdaptation.hlsl" /> |
|||
<None Include="Assets\LowEndMobilePipeline\Shaders\LowEndMobilePipeline.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\EyeHistogram.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\ProceduralSky\Resources\SkyProcedural.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Lit.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Hammersley.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Color.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowTexFetch.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\common\CubeToSpherical.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\VignettingShader.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\SHMath.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\FXAA2.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\VaryingMesh.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\SampleUVMapping.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\RegularForwardLightingTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\ClusteredUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\Internal-DeferredReflections.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\Lighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\LayeredLit\LayeredLitTessellation.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\PerPixelDisplacement.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassLightTransport.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\Resources\Deferred.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\ShaderPass\UnlitDistortionPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\ShaderPass\UnlitMetaPass.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Shaders\TerrainSurface.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\LightDefinition.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\TiledLightingTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Sampling.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\ProceduralSky\Resources\AtmosphericScattering.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\FeatureFlags.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\Unlit.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\lightlistbuild-bigtile.compute" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\FXAA3Console.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Debug.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\ImageBasedLighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\README.txt" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\VertMesh.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\FXAAPreset2.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\FixedSizePCF\FixedSizePCF.hlsl" /> |
|||
<Reference Include="UnityEngine.UI"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.Networking"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.TestRunner"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="nunit.framework"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/TestRunner/nunit.framework.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.Timeline"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.Analytics"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.HoloLens"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath> |
|||
</Reference> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
|
|||
</Project> |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProductVersion>10.0.20506</ProductVersion> |
|||
<SchemaVersion>2.0</SchemaVersion> |
|||
<RootNamespace></RootNamespace> |
|||
<ProjectGuid>{425682D6-2799-ABE6-93DD-977B724BF07C}</ProjectGuid> |
|||
<OutputType>Library</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<AssemblyName>Assembly-UnityScript</AssemblyName> |
|||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
<BaseDirectory>Assets</BaseDirectory> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>Temp\bin\Debug\</OutputPath> |
|||
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_1_0;UNITY_2017_1;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_VR;ENABLE_MODULAR_UNITYENGINE_ASSEMBLIES;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_2_0_SUBSET;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<NoWarn>0169</NoWarn> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>Temp\bin\Release\</OutputPath> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<NoWarn>0169</NoWarn> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.XML" /> |
|||
<Reference Include="System.Core" /> |
|||
<Reference Include="System.Runtime.Serialization" /> |
|||
<Reference Include="System.Xml.Linq" /> |
|||
<Reference Include="UnityEngine"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/Managed/UnityEngine.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEditor"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/Managed/UnityEditor.dll</HintPath> |
|||
</Reference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Scripts\Fps.js" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\CommonLighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderConfig.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Material.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowSampling.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitTessellation.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightingTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\lightlistbuild-clustered.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\TiledReflectionTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\lightlistbuild-clustered.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\FinalPass.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\SampleUVMappingNormalInternal.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightDefinitions.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightingUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\UnlitData.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassGBuffer.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\AreaLighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\SortingComputeUtils.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\ScreenSpaceAmbientObscurance.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitProperties.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowDispatch.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\GeometricTools.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\NFAA.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Builtin\BuiltinData.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\DebugDisplay.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassVelocity.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\ShaderPass\UnlitSharePass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\SceneSettings\Resources\DrawGaussianProfile.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\Resources\GGXConvolve.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\TessellationShare.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\common\Resources\BlitCubemap.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_DepthOfField\DepthOfFieldScatter.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassForwardUnlit.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowAlgorithmsCustom.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Shaders\WavingGrass.shader" /> |
|||
<None Include="Assets\LowEndMobilePipeline\Shaders\LowEndParticlesAdd.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Common.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Builtin\BuiltinData.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Wind.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\SampleUVMappingInternal.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Shaders\DistanceFade.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\Resources\BuildProbabilityTables.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitMetaPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\scrbound.compute" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\SSAA.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\LightingConvexHullUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassForward.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\lightlistbuild.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightBoundsDebug.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\D3D11_1.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_DepthOfField\DepthOfFieldDX11.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\SortingComputeUtils.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\FXAAPreset3.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\TilePassLoop.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPass.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\EntityLighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\ReflectionTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\MaterialUtilities.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\frag_ao.cginc" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowBase.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Resources\PreIntegratedFGD.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\CommonMaterial.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitDataInternal.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\DebugDisplay.cs.hlsl" /> |
|||
<None Include="Assets\LowEndMobilePipeline\Shaders\LowEndMobilePipelineCore.cginc" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowContext.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Lit.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitDepthPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\FragInputs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\LayeredLit\LayeredLit.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\UnlitProperties.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\scrbound.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\ColorGrading.hlsl" /> |
|||
<None Include="Assets\LowEndMobilePipeline\Shaders\LowEndParticlesMultiply.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\lightlistbuild-bigtile.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\Resources\DebugViewTiles.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\UnityStandardForwardNew.cginc" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassDistortion.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\Unlit.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\EyeAdaptation.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\Validate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\Textures\LICENSE.txt" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\Metal.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\Unlit.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\shadeopaque.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\PatchStandardShaderToNewNamingConvention.cginc" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitSharePass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\D3D11.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\LutGen.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\SSAOShader.shader" /> |
|||
<None Include="Assets\BasicRenderPipelineTutorial\BasicRenderPipelineShader.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassDepthOnly.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\TilePass.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\HDRISky\Resources\SkyHDRI.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\Textures\COPYING.txt" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\TiledLightingUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\TilePass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowAlgorithms.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitTessellation.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\Internal-DeferredComputeShading.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\Resources\DebugDisplayShadowMap.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\ChromaticAberrationShader.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\Resources\DebugDisplayLatlong.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\QuaternionMath.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\GlobalFog.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\Internal-DeferredShading.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\API\PSSL.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Tessellation.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\LightUtilities.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\BSDF.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\LitData.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\Forward.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\Resources\cleardispatchindirect.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\FinalPass.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Filtering.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\Shadow.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\CameraMotionBlurDX11.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitVelocityPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\SceneSettings\Resources\DrawTransmittanceGraph.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\RegularForwardReflectionTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\RegularForwardLightingUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Debug\Resources\DebugViewMaterialGBuffer.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\CameraMotionBlur.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\CommonShadow.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\DLAA.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderVariables.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\ShaderBase.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\SkyManager.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Fibonacci.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\NormalSurfaceGradient.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Lit.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\LightingConvexHullUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\ShaderPass\LitDistortionPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\Resources\ComputeGgxIblSampleData.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\lightlistbuild.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Resources\CombineSubsurfaceScattering.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\StandardTest.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Packing.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_DepthOfField\SeparableBlur.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\MotionBlurClear.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\EyeAdaptation.hlsl" /> |
|||
<None Include="Assets\LowEndMobilePipeline\Shaders\LowEndMobilePipeline.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\PostProcess\Resources\EyeHistogram.compute" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\ProceduralSky\Resources\SkyProcedural.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Lit\Lit.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Hammersley.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Color.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\ShadowTexFetch.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\common\CubeToSpherical.shader" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\VignettingShader.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\SHMath.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\FXAA2.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\VaryingMesh.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\SampleUVMapping.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\RegularForwardLightingTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\ClusteredUtils.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\Internal-DeferredReflections.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\Lighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\LayeredLit\LayeredLitTessellation.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\PerPixelDisplacement.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\ShaderPassLightTransport.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\Resources\Deferred.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\ShaderPass\UnlitDistortionPass.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\ShaderPass\UnlitMetaPass.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Shaders\TerrainSurface.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\LightDefinition.cs.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\TiledLightingTemplate.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Sampling.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\ProceduralSky\Resources\AtmosphericScattering.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Lighting\TilePass\FeatureFlags.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Material\Unlit\Unlit.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\fptl\lightlistbuild-bigtile.compute" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\FXAA3Console.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\Debug.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\ShaderLibrary\ImageBasedLighting.hlsl" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Sky\README.txt" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\ShaderPass\VertMesh.hlsl" /> |
|||
<None Include="Assets\TestScenes\Big\BenchRenderVikingVillageStatic\Standard Assets\Image Effects (Pro Only)\_Sources\Shaders\_Antialiasing\FXAAPreset2.shader" /> |
|||
<None Include="Assets\ScriptableRenderPipeline\HDRenderPipeline\Shadow\FixedSizePCF\FixedSizePCF.hlsl" /> |
|||
<Reference Include="UnityEngine.UI"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.Networking"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.TestRunner"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="nunit.framework"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/TestRunner/nunit.framework.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.Timeline"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.Analytics"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath> |
|||
</Reference> |
|||
<Reference Include="UnityEngine.HoloLens"> |
|||
<HintPath>/Applications/Unity_Installs/Unity branches/ScriptablePipeline/SRP_27april17.app/Contents/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath> |
|||
</Reference> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
|
|||
</Project> |
|
|||
#pragma kernel ShadeOpaque_Direct_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl USE_FPTL_LIGHTLIST |
|||
#pragma kernel ShadeOpaque_Direct_Fptl_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl_DebugDisplay USE_FPTL_LIGHTLIST DEBUG_DISPLAY |
|||
#pragma kernel ShadeOpaque_Direct_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered USE_CLUSTERED_LIGHTLIST |
|||
#pragma kernel ShadeOpaque_Direct_Clustered_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered_DebugDisplay USE_CLUSTERED_LIGHTLIST DEBUG_DISPLAY |
|||
|
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant0 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=0 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant1 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=1 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant2 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=2 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant3 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=3 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant4 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=4 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant5 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=5 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant6 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=6 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant7 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=7 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant8 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=8 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant9 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=9 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant10 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=10 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant11 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=11 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant12 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=12 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant13 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=13 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant14 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=14 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant15 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=15 |
|||
|
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant0 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=0 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant1 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=1 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant2 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=2 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant3 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=3 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant4 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=4 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant5 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=5 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant6 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=6 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant7 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=7 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant8 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=8 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant9 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=9 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant10 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=10 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant11 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=11 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant12 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=12 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant13 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=13 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant14 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=14 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant15 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=15 |
|||
|
|||
#pragma #pragma enable_d3d11_debug_symbols |
|||
|
|||
// Split lighting is required for the SSS pass. |
|||
// Not currently possible since we need to access the stencil buffer from the compute shader. |
|||
// #pragma multi_compile _ OUTPUT_SPLIT_LIGHTING |
|||
|
|||
#define LIGHTLOOP_TILE_PASS 1 |
|||
#define LIGHTLOOP_TILE_DIRECT 1 |
|||
#define LIGHTLOOP_TILE_INDIRECT 1 |
|||
#define LIGHTLOOP_TILE_ALL 1 |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Include |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#include "../../../../ShaderLibrary/Common.hlsl" |
|||
#include "../../../Debug/DebugDisplay.hlsl" |
|||
|
|||
// 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), |
|||
// the deferred shader will require to use multicompile. |
|||
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl |
|||
#include "../../../ShaderConfig.cs.hlsl" |
|||
#include "../../../ShaderVariables.hlsl" |
|||
#include "../../../Lighting/Lighting.hlsl" // This include Material.hlsl |
|||
#include "../../../Lighting/TilePass/FeatureFlags.hlsl" |
|||
//------------------------------------------------------------------------------------- |
|||
// variable declaration |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
DECLARE_GBUFFER_TEXTURE(_GBufferTexture); |
|||
|
|||
#ifdef OUTPUT_SPLIT_LIGHTING |
|||
RWTexture2D<float4> specularLightingUAV; |
|||
RWTexture2D<float3> diffuseLightingUAV; |
|||
#else |
|||
RWTexture2D<float4> combinedLightingUAV; |
|||
#endif |
|||
|
|||
#if USE_INDIRECT |
|||
uint g_TileListOffset; |
|||
StructuredBuffer<uint> g_TileList; |
|||
// Indirect |
|||
[numthreads(16, 16, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 groupThreadId : SV_GroupThreadID, uint groupId : SV_GroupID) |
|||
{ |
|||
uint tileIndex = g_TileList[g_TileListOffset + groupId]; |
|||
uint2 tileCoord = uint2(tileIndex & 0xFFFF, tileIndex >> 16); |
|||
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId; |
|||
|
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord); |
|||
uint featureFlags = TileVariantToFeatureFlags(VARIANT); |
|||
#else |
|||
// Direct |
|||
[numthreads(16, 16, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID) |
|||
{ |
|||
uint2 pixelCoord = dispatchThreadId; |
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, groupId); |
|||
uint featureFlags = 0xFFFFFFFF; |
|||
#endif |
|||
|
|||
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x; |
|||
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput); |
|||
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS); |
|||
|
|||
FETCH_GBUFFER(gbuffer, _GBufferTexture, posInput.unPositionSS); |
|||
BSDFData bsdfData; |
|||
float3 bakeDiffuseLighting; |
|||
DECODE_FROM_GBUFFER(gbuffer, featureFlags, bsdfData, bakeDiffuseLighting); |
|||
|
|||
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); |
|||
|
|||
float3 diffuseLighting; |
|||
float3 specularLighting; |
|||
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, featureFlags, diffuseLighting, specularLighting); |
|||
|
|||
#ifdef OUTPUT_SPLIT_LIGHTING |
|||
specularLightingUAV[pixelCoord] = float4(specularLighting, 1.0); |
|||
diffuseLightingUAV[pixelCoord] = diffuseLighting; |
|||
#else |
|||
combinedLightingUAV[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0); |
|||
#endif |
|||
} |
|||
|
|||
#pragma kernel ShadeOpaque_Direct_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl USE_FPTL_LIGHTLIST |
|||
#pragma kernel ShadeOpaque_Direct_Fptl_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl_DebugDisplay USE_FPTL_LIGHTLIST DEBUG_DISPLAY |
|||
#pragma kernel ShadeOpaque_Direct_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered USE_CLUSTERED_LIGHTLIST |
|||
#pragma kernel ShadeOpaque_Direct_Clustered_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered_DebugDisplay USE_CLUSTERED_LIGHTLIST DEBUG_DISPLAY |
|||
|
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant0 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=0 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant1 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=1 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant2 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=2 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant3 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=3 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant4 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=4 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant5 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=5 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant6 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=6 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant7 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=7 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant8 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=8 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant9 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=9 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant10 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=10 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant11 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=11 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant12 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=12 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant13 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=13 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant14 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=14 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant15 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=15 |
|||
|
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant0 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=0 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant1 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=1 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant2 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=2 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant3 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=3 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant4 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=4 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant5 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=5 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant6 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=6 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant7 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=7 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant8 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=8 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant9 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=9 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant10 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=10 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant11 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=11 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant12 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=12 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant13 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=13 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant14 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=14 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant15 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=15 |
|||
|
|||
#pragma #pragma enable_d3d11_debug_symbols |
|||
|
|||
// Split lighting is required for the SSS pass. |
|||
// Not currently possible since we need to access the stencil buffer from the compute shader. |
|||
// #pragma multi_compile _ OUTPUT_SPLIT_LIGHTING |
|||
|
|||
#define LIGHTLOOP_TILE_PASS 1 |
|||
#define LIGHTLOOP_TILE_DIRECT 1 |
|||
#define LIGHTLOOP_TILE_INDIRECT 1 |
|||
#define LIGHTLOOP_TILE_ALL 1 |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Include |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#include "../../../../ShaderLibrary/Common.hlsl" |
|||
#include "../../../Debug/DebugDisplay.hlsl" |
|||
|
|||
// 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), |
|||
// the deferred shader will require to use multicompile. |
|||
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl |
|||
#include "../../../ShaderConfig.cs.hlsl" |
|||
#include "../../../ShaderVariables.hlsl" |
|||
#include "../../../Lighting/Lighting.hlsl" // This include Material.hlsl |
|||
#include "../../../Lighting/TilePass/FeatureFlags.hlsl" |
|||
//------------------------------------------------------------------------------------- |
|||
// variable declaration |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
DECLARE_GBUFFER_TEXTURE(_GBufferTexture); |
|||
|
|||
#ifdef OUTPUT_SPLIT_LIGHTING |
|||
RWTexture2D<float4> specularLightingUAV; |
|||
RWTexture2D<float3> diffuseLightingUAV; |
|||
#else |
|||
RWTexture2D<float4> combinedLightingUAV; |
|||
#endif |
|||
|
|||
#if USE_INDIRECT |
|||
uint g_TileListOffset; |
|||
StructuredBuffer<uint> g_TileList; |
|||
// Indirect |
|||
[numthreads(16, 16, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 groupThreadId : SV_GroupThreadID, uint groupId : SV_GroupID) |
|||
{ |
|||
uint tileIndex = g_TileList[g_TileListOffset + groupId]; |
|||
uint2 tileCoord = uint2(tileIndex & 0xFFFF, tileIndex >> 16); |
|||
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId; |
|||
|
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord); |
|||
uint featureFlags = TileVariantToFeatureFlags(VARIANT); |
|||
#else |
|||
// Direct |
|||
[numthreads(16, 16, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID) |
|||
{ |
|||
uint2 pixelCoord = dispatchThreadId; |
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, groupId); |
|||
uint featureFlags = 0xFFFFFFFF; |
|||
#endif |
|||
|
|||
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x; |
|||
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput); |
|||
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS); |
|||
|
|||
FETCH_GBUFFER(gbuffer, _GBufferTexture, posInput.unPositionSS); |
|||
BSDFData bsdfData; |
|||
float3 bakeDiffuseLighting; |
|||
DECODE_FROM_GBUFFER(gbuffer, featureFlags, bsdfData, bakeDiffuseLighting); |
|||
|
|||
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); |
|||
|
|||
float3 diffuseLighting; |
|||
float3 specularLighting; |
|||
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, featureFlags, diffuseLighting, specularLighting); |
|||
|
|||
#ifdef OUTPUT_SPLIT_LIGHTING |
|||
specularLightingUAV[pixelCoord] = float4(specularLighting, 1.0); |
|||
diffuseLightingUAV[pixelCoord] = diffuseLighting; |
|||
#else |
|||
combinedLightingUAV[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0); |
|||
#endif |
|||
} |
|||
|
|
|||
m_EditorVersion: 2017.1.0b3 |
|||
m_EditorVersion: 2017.2.0a1 |
|
|||
// This file is empty on purpose. Projects can put their custom shadow algorithms in here so they get automatically included by Shadow.hlsl. |
|||
|
|||
float EvalShadow_CascadedMomentum( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ) |
|||
float EvalShadow_CascadedMoment( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L ) |
|||
return 1.0; |
|||
// load the right shadow data for the current face |
|||
float4 dirShadowSplitSpheres[4]; |
|||
uint payloadOffset = EvalShadow_LoadSplitSpheres( shadowContext, shadowDataIndex, dirShadowSplitSpheres ); |
|||
int shadowSplitIndex = EvalShadow_GetSplitSphereIndexForDirshadows( positionWS, dirShadowSplitSpheres ); |
|||
if (shadowSplitIndex < 0) |
|||
return 1.0; |
|||
|
|||
ShadowData sd = shadowContext.shadowDatas[shadowDataIndex + 1 + shadowSplitIndex]; |
|||
// normal based bias |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
|
|||
// sample the texture |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
|
|||
uint shadowType, shadowAlgorithm; |
|||
UnpackShadowType( sd.shadowType, shadowType, shadowAlgorithm ); |
|||
|
|||
switch( shadowAlgorithm ) |
|||
{ |
|||
case (GPUSHADOWALGORITHM_CUSTOM + 1): return 1.0; |
|||
default: return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, texIdx, sampIdx ); |
|||
} |
|||
float EvalShadow_CascadedMomentum( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
float EvalShadow_CascadedMoment( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
return 1.0; |
|||
} |
|||
return EvalShadow_CascadedMoment( shadowContext, positionWS, normalWS, shadowDataIndex, L ); |
|||
} |
|
|||
|
|||
// This can be custom for each project and needs to be in sync with the ShadowMgr |
|||
|
|||
#define SHADOWCONTEXT_MAX_TEX2DARRAY 2 |
|||
#define SHADOWCONTEXT_MAX_TEXCUBEARRAY 1 |
|||
#define SHADOWCONTEXT_MAX_SAMPLER 1 |
|||
#define SHADOWCONTEXT_MAX_COMPSAMPLER 2 |
|||
#define SHADOWCONTEXT_MAX_TEX2DARRAY 4 |
|||
#define SHADOWCONTEXT_MAX_TEXCUBEARRAY 0 |
|||
#define SHADOWCONTEXT_MAX_SAMPLER 3 |
|||
#define SHADOWCONTEXT_MAX_COMPSAMPLER 1 |
|||
StructuredBuffer<ShadowData> _ShadowDatasExp; |
|||
StructuredBuffer<int4> _ShadowPayloads; |
|||
TEXTURE2D_ARRAY(_ShadowmapExp_Dir); |
|||
SAMPLER2D_SHADOW(sampler_ShadowmapExp_Dir); |
|||
TEXTURE2D_ARRAY(_ShadowmapExp_PointSpot); |
|||
SAMPLER2D_SHADOW(sampler_ShadowmapExp_PointSpot); |
|||
TEXTURE2D_ARRAY(_ShadowmapExp_VSM_0); |
|||
SAMPLER2D(sampler_ShadowmapExp_VSM_0); |
|||
|
|||
TEXTURE2D_ARRAY(_ShadowmapExp_VSM_1); |
|||
SAMPLER2D(sampler_ShadowmapExp_VSM_1); |
|||
|
|||
TEXTURE2D_ARRAY(_ShadowmapExp_VSM_2); |
|||
SAMPLER2D(sampler_ShadowmapExp_VSM_2); |
|||
|
|||
TEXTURE2D_ARRAY(_ShadowmapExp_PCF); |
|||
SAMPLER2D_SHADOW(sampler_ShadowmapExp_PCF); |
|||
|
|||
StructuredBuffer<ShadowData> _ShadowDatasExp; |
|||
StructuredBuffer<int4> _ShadowPayloads; |
|||
ShadowContext sc; |
|||
sc.shadowDatas = _ShadowDatasExp; |
|||
sc.payloads = _ShadowPayloads; |
|||
sc.tex2DArray[0] = _ShadowmapExp_Dir; |
|||
sc.tex2DArray[1] = _ShadowmapExp_PointSpot; |
|||
sc.compSamplers[0] = sampler_ShadowmapExp_Dir; |
|||
sc.compSamplers[1] = sampler_ShadowmapExp_PointSpot; |
|||
return sc; |
|||
ShadowContext sc; |
|||
sc.shadowDatas = _ShadowDatasExp; |
|||
sc.payloads = _ShadowPayloads; |
|||
sc.tex2DArray[0] = _ShadowmapExp_VSM_0; |
|||
sc.tex2DArray[1] = _ShadowmapExp_VSM_1; |
|||
sc.tex2DArray[2] = _ShadowmapExp_VSM_2; |
|||
sc.tex2DArray[3] = _ShadowmapExp_PCF; |
|||
sc.samplers[0] = sampler_ShadowmapExp_VSM_0; |
|||
sc.samplers[1] = sampler_ShadowmapExp_VSM_1; |
|||
sc.samplers[2] = sampler_ShadowmapExp_VSM_2; |
|||
sc.compSamplers[0] = sampler_ShadowmapExp_PCF; |
|||
return sc; |
|||
|
|
|||
// This file is empty by default. |
|||
// Project specific file to override the default shadow sampling routines. |
|||
// We need to define which dispatchers we're overriding, otherwise the compiler will pick default implementations which will lead to compile errors. |
|||
// We need to define which dispatchers we're overriding, otherwise the compiler will pick default implementations which will lead to compilation errors. |
|||
|
|||
|
|||
// This is an example of how to override the default dynamic resource dispatcher |
|||
// by hardcoding the resources used and calling the shadow sampling routines that take an explicit texture and sampler. |
|||
// It is the responsibility of the author to make sure that ShadowContext.hlsl binds the correct texture to the right slot, |
|||
// and that on the C# side the shadowContext bindDelegate binds the correct resource to the correct texture id. |
|||
|
|||
|
|||
#define SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL // enables hardcoded resources and algorithm for directional lights |
|||
#define SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL // enables hardcoded resources and algorithm for punctual lights |
|||
//#define SHADOW_DISPATCH_USE_SEPARATE_PUNC_ALGOS // enables separate resources and algorithms for spot and point lights |
|||
|
|||
// directional |
|||
#define SHADOW_DISPATCH_DIR_TEX 3 |
|||
#define SHADOW_DISPATCH_DIR_SMP 0 |
|||
#define SHADOW_DISPATCH_DIR_ALG GPUSHADOWALGORITHM_PCF_TENT_7X7 |
|||
// point |
|||
#define SHADOW_DISPATCH_POINT_TEX 3 |
|||
#define SHADOW_DISPATCH_POINT_SMP 0 |
|||
#define SHADOW_DISPATCH_POINT_ALG GPUSHADOWALGORITHM_PCF_1TAP |
|||
// spot |
|||
#define SHADOW_DISPATCH_SPOT_TEX 3 |
|||
#define SHADOW_DISPATCH_SPOT_SMP 0 |
|||
#define SHADOW_DISPATCH_SPOT_ALG GPUSHADOWALGORITHM_PCF_9TAP |
|||
//punctual |
|||
#define SHADOW_DISPATCH_PUNC_TEX 3 |
|||
#define SHADOW_DISPATCH_PUNC_SMP 0 |
|||
#define SHADOW_DISPATCH_PUNC_ALG GPUSHADOWALGORITHM_PCF_TENT_7X7 |
|||
|
|||
//#define SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ) |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L ) |
|||
Texture2DArray tex = shadowContext.tex2DArray[0]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[0]; |
|||
Texture2DArray tex = shadowContext.tex2DArray[SHADOW_DISPATCH_DIR_TEX]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[SHADOW_DISPATCH_DIR_SMP]; |
|||
uint algo = SHADOW_DISPATCH_DIR_ALG; |
|||
return EvalShadow_CascadedDepth( shadowContext, tex, compSamp, positionWS, shadowDataIndex, L ); |
|||
|
|||
//return EvalShadow_CascadedMomentum( shadowContext, positionWS, shadowDataIndex, L ); |
|||
return EvalShadow_CascadedDepth( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L ); |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
Texture2DArray tex = shadowContext.tex2DArray[0]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[0]; |
|||
|
|||
return EvalShadow_CascadedDepth( shadowContext, tex, compSamp, positionWS, shadowDataIndex, L ); |
|||
|
|||
//return EvalShadow_CascadedMomentum( shadowContext, positionWS, shadowDataIndex, L ); |
|||
return GetDirectionalShadowAttenuation( shadowContext, positionWS, normalWS, shadowDataIndex, L ); |
|||
|
|||
// This is an example of how to override the default dynamic resource dispatcher |
|||
// by hardcoding the resources used and calling the shadow sampling routines that take an explicit texture and sampler. |
|||
// It is the responsibility of the author to make sure that ShadowContext.hlsl binds the correct texture to the right slot, |
|||
// and that on the C# side the shadowContext bindDelegate binds the correct resource to the correct texture id. |
|||
//#define SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL |
|||
// example of overriding punctual lights |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ) |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L ) |
|||
Texture2DArray tex = shadowContext.tex2DArray[1]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[1]; |
|||
#ifdef SHADOW_DISPATCH_USE_SEPARATE_PUNC_ALGOS |
|||
// example for choosing different algos for point and spot lights |
|||
ShadowData sd = shadowContext.shadowDatas[shadowDataIndex]; |
|||
uint shadowType; |
|||
UnpackShadowType( sd.shadowType, shadowType ); |
|||
return EvalShadow_PunctualDepth( shadowContext, tex, compSamp, positionWS, shadowDataIndex, L ); |
|||
[branch] |
|||
if( shadowType == GPUSHADOWTYPE_POINT ) |
|||
{ |
|||
Texture2DArray tex = shadowContext.tex2DArray[SHADOW_DISPATCH_POINT_TEX]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[SHADOW_DISPATCH_POINT_SMP]; |
|||
uint algo = SHADOW_DISPATCH_POINT_ALG; |
|||
return EvalShadow_PointDepth( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L ); |
|||
} |
|||
else |
|||
{ |
|||
Texture2DArray tex = shadowContext.tex2DArray[SHADOW_DISPATCH_SPOT_TEX]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[SHADOW_DISPATCH_SPOT_SMP]; |
|||
uint algo = SHADOW_DISPATCH_SPOT_ALG; |
|||
return EvalShadow_SpotDepth( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L ); |
|||
} |
|||
#else |
|||
// example for choosing the same algo |
|||
Texture2DArray tex = shadowContext.tex2DArray[SHADOW_DISPATCH_PUNC_TEX]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[SHADOW_DISPATCH_PUNC_SMP]; |
|||
uint algo = SHADOW_DISPATCH_PUNC_ALG; |
|||
return EvalShadow_PunctualDepth( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L ); |
|||
#endif |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
Texture2DArray tex = shadowContext.tex2DArray[1]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[1]; |
|||
return GetPunctualShadowAttenuation( shadowContext, positionWS, normalWS, shadowDataIndex, L ); |
|||
} |
|||
#endif |
|||
return EvalShadow_PunctualDepth( shadowContext, tex, compSamp, positionWS, shadowDataIndex, L ); |
|||
} |
|||
// cleanup the defines |
|||
#undef SHADOW_DISPATCH_DIR_TEX |
|||
#undef SHADOW_DISPATCH_DIR_SMP |
|||
#undef SHADOW_DISPATCH_DIR_ALG |
|||
#undef SHADOW_DISPATCH_POINT_TEX |
|||
#undef SHADOW_DISPATCH_POINT_SMP |
|||
#undef SHADOW_DISPATCH_POINT_ALG |
|||
#undef SHADOW_DISPATCH_SPOT_TEX |
|||
#undef SHADOW_DISPATCH_SPOT_SMP |
|||
#undef SHADOW_DISPATCH_SPOT_ALG |
|||
#undef SHADOW_DISPATCH_PUNC_TEX |
|||
#undef SHADOW_DISPATCH_PUNC_SMP |
|||
#undef SHADOW_DISPATCH_PUNC_ALG |
|||
#ifdef SHADOW_DISPATCH_USE_SEPARATE_PUNC_ALGOS |
|||
#undef SHADOW_DISPATCH_USE_SEPARATE_PUNC_ALGOS |
|||
#endif |
|
|||
// Various shadow sampling logic. |
|||
// Again two versions, one for dynamic resource indexing, one for static resource access. |
|||
|
|||
// ------------------------------------------------------------------ |
|||
// PCF Filtering helpers |
|||
// ------------------------------------------------------------------ |
|||
|
|||
// Assuming a isoceles right angled triangle of height "triangleHeight" (as drawn below). |
|||
// This function return the area of the triangle above the first texel. |
|||
// 1 tap PCF sampling |
|||
// |\ <-- 45 degree slop isosceles right angled triangle |
|||
// | \ |
|||
// ---- <-- length of this side is "triangleHeight" |
|||
// _ _ _ _ <-- texels |
|||
float SampleShadow_GetTriangleTexelArea(float triangleHeight) |
|||
{ |
|||
return triangleHeight - 0.5; |
|||
} |
|||
|
|||
// Assuming a isoceles triangle of 1.5 texels height and 3 texels wide lying on 4 texels. |
|||
// This function return the area of the triangle above each of those texels. |
|||
// | <-- offset from -0.5 to 0.5, 0 meaning triangle is exactly in the center |
|||
// / \ <-- 45 degree slop isosceles triangle (ie tent projected in 2D) |
|||
// / \ |
|||
// _ _ _ _ <-- texels |
|||
// X Y Z W <-- result indices (in computedArea.xyzw and computedAreaUncut.xyzw) |
|||
void SampleShadow_GetTexelAreas_Tent_3x3(float offset, out float4 computedArea, out float4 computedAreaUncut) |
|||
{ |
|||
// Compute the exterior areas |
|||
float offset01SquaredHalved = (offset + 0.5) * (offset + 0.5) * 0.5; |
|||
computedAreaUncut.x = computedArea.x = offset01SquaredHalved - offset; |
|||
computedAreaUncut.w = computedArea.w = offset01SquaredHalved; |
|||
|
|||
// Compute the middle areas |
|||
// For Y : We find the area in Y of as if the left section of the isoceles triangle would |
|||
// intersect the axis between Y and Z (ie where offset = 0). |
|||
computedAreaUncut.y = SampleShadow_GetTriangleTexelArea(1.5 - offset); |
|||
// This area is superior to the one we are looking for if (offset < 0) thus we need to |
|||
// subtract the area of the triangle defined by (0,1.5-offset), (0,1.5+offset), (-offset,1.5). |
|||
float clampedOffsetLeft = min(offset,0); |
|||
float areaOfSmallLeftTriangle = clampedOffsetLeft * clampedOffsetLeft; |
|||
computedArea.y = computedAreaUncut.y - areaOfSmallLeftTriangle; |
|||
|
|||
// We do the same for the Z but with the right part of the isoceles triangle |
|||
computedAreaUncut.z = SampleShadow_GetTriangleTexelArea(1.5 + offset); |
|||
float clampedOffsetRight = max(offset,0); |
|||
float areaOfSmallRightTriangle = clampedOffsetRight * clampedOffsetRight; |
|||
computedArea.z = computedAreaUncut.z - areaOfSmallRightTriangle; |
|||
} |
|||
|
|||
// Assuming a isoceles triangle of 1.5 texels height and 3 texels wide lying on 4 texels. |
|||
// This function return the weight of each texels area relative to the full triangle area. |
|||
void SampleShadow_GetTexelWeights_Tent_3x3(float offset, out float4 computedWeight) |
|||
{ |
|||
float4 dummy; |
|||
SampleShadow_GetTexelAreas_Tent_3x3(offset, computedWeight, dummy); |
|||
computedWeight *= 0.44444;//0.44 == 1/(the triangle area) |
|||
} |
|||
|
|||
// Assuming a isoceles triangle of 2.5 texel height and 5 texels wide lying on 6 texels. |
|||
// This function return the weight of each texels area relative to the full triangle area. |
|||
// / \ |
|||
// _ _ _ _ _ _ <-- texels |
|||
// 0 1 2 3 4 5 <-- computed area indices (in texelsWeights[]) |
|||
void SampleShadow_GetTexelWeights_Tent_5x5(float offset, out float3 texelsWeightsA, out float3 texelsWeightsB) |
|||
{ |
|||
// See _UnityInternalGetAreaPerTexel_3TexelTriangleFilter for details. |
|||
float4 computedArea_From3texelTriangle; |
|||
float4 computedAreaUncut_From3texelTriangle; |
|||
SampleShadow_GetTexelAreas_Tent_3x3(offset, computedArea_From3texelTriangle, computedAreaUncut_From3texelTriangle); |
|||
|
|||
// Triangle slope is 45 degree thus we can almost reuse the result of the 3 texel wide computation. |
|||
// the 5 texel wide triangle can be seen as the 3 texel wide one but shifted up by one unit/texel. |
|||
// 0.16 is 1/(the triangle area) |
|||
texelsWeightsA.x = 0.16 * (computedArea_From3texelTriangle.x); |
|||
texelsWeightsA.y = 0.16 * (computedAreaUncut_From3texelTriangle.y); |
|||
texelsWeightsA.z = 0.16 * (computedArea_From3texelTriangle.y + 1); |
|||
texelsWeightsB.x = 0.16 * (computedArea_From3texelTriangle.z + 1); |
|||
texelsWeightsB.y = 0.16 * (computedAreaUncut_From3texelTriangle.z); |
|||
texelsWeightsB.z = 0.16 * (computedArea_From3texelTriangle.w); |
|||
} |
|||
|
|||
// Assuming a isoceles triangle of 3.5 texel height and 7 texels wide lying on 8 texels. |
|||
// This function return the weight of each texels area relative to the full triangle area. |
|||
// / \ |
|||
// _ _ _ _ _ _ _ _ <-- texels |
|||
// 0 1 2 3 4 5 6 7 <-- computed area indices (in texelsWeights[]) |
|||
void SampleShadow_GetTexelWeights_Tent_7x7(float offset, out float4 texelsWeightsA, out float4 texelsWeightsB) |
|||
{ |
|||
// See _UnityInternalGetAreaPerTexel_3TexelTriangleFilter for details. |
|||
float4 computedArea_From3texelTriangle; |
|||
float4 computedAreaUncut_From3texelTriangle; |
|||
SampleShadow_GetTexelAreas_Tent_3x3(offset, computedArea_From3texelTriangle, computedAreaUncut_From3texelTriangle); |
|||
|
|||
// Triangle slope is 45 degree thus we can almost reuse the result of the 3 texel wide computation. |
|||
// the 7 texel wide triangle can be seen as the 3 texel wide one but shifted up by two unit/texel. |
|||
// 0.081632 is 1/(the triangle area) |
|||
texelsWeightsA.x = 0.081632 * (computedArea_From3texelTriangle.x); |
|||
texelsWeightsA.y = 0.081632 * (computedAreaUncut_From3texelTriangle.y); |
|||
texelsWeightsA.z = 0.081632 * (computedAreaUncut_From3texelTriangle.y + 1); |
|||
texelsWeightsA.w = 0.081632 * (computedArea_From3texelTriangle.y + 2); |
|||
texelsWeightsB.x = 0.081632 * (computedArea_From3texelTriangle.z + 2); |
|||
texelsWeightsB.y = 0.081632 * (computedAreaUncut_From3texelTriangle.z + 1); |
|||
texelsWeightsB.z = 0.081632 * (computedAreaUncut_From3texelTriangle.z); |
|||
texelsWeightsB.w = 0.081632 * (computedArea_From3texelTriangle.w); |
|||
} |
|||
|
|||
// 3x3 Tent filter (45 degree sloped triangles in U and V) |
|||
void SampleShadow_ComputeSamples_Tent_3x3(float4 shadowMapTexture_TexelSize, float2 coord, out float fetchesWeights[4], out float2 fetchesUV[4]) |
|||
{ |
|||
// tent base is 3x3 base thus covering from 9 to 12 texels, thus we need 4 bilinear PCF fetches |
|||
float2 tentCenterInTexelSpace = coord.xy * shadowMapTexture_TexelSize.zw; |
|||
float2 centerOfFetchesInTexelSpace = floor(tentCenterInTexelSpace + 0.5); |
|||
float2 offsetFromTentCenterToCenterOfFetches = tentCenterInTexelSpace - centerOfFetchesInTexelSpace; |
|||
|
|||
// find the weight of each texel based |
|||
float4 texelsWeightsU, texelsWeightsV; |
|||
SampleShadow_GetTexelWeights_Tent_3x3(offsetFromTentCenterToCenterOfFetches.x, texelsWeightsU); |
|||
SampleShadow_GetTexelWeights_Tent_3x3(offsetFromTentCenterToCenterOfFetches.y, texelsWeightsV); |
|||
|
|||
// each fetch will cover a group of 2x2 texels, the weight of each group is the sum of the weights of the texels |
|||
float2 fetchesWeightsU = texelsWeightsU.xz + texelsWeightsU.yw; |
|||
float2 fetchesWeightsV = texelsWeightsV.xz + texelsWeightsV.yw; |
|||
|
|||
// move the PCF bilinear fetches to respect texels weights |
|||
float2 fetchesOffsetsU = texelsWeightsU.yw / fetchesWeightsU.xy + float2(-1.5,0.5); |
|||
float2 fetchesOffsetsV = texelsWeightsV.yw / fetchesWeightsV.xy + float2(-1.5,0.5); |
|||
fetchesOffsetsU *= shadowMapTexture_TexelSize.xx; |
|||
fetchesOffsetsV *= shadowMapTexture_TexelSize.yy; |
|||
|
|||
float2 bilinearFetchOrigin = centerOfFetchesInTexelSpace * shadowMapTexture_TexelSize.xy; |
|||
fetchesUV[0] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.x); |
|||
fetchesUV[1] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.x); |
|||
fetchesUV[2] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.y); |
|||
fetchesUV[3] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.y); |
|||
|
|||
fetchesWeights[0] = fetchesWeightsU.x * fetchesWeightsV.x; |
|||
fetchesWeights[1] = fetchesWeightsU.y * fetchesWeightsV.x; |
|||
fetchesWeights[2] = fetchesWeightsU.x * fetchesWeightsV.y; |
|||
fetchesWeights[3] = fetchesWeightsU.y * fetchesWeightsV.y; |
|||
} |
|||
|
|||
// 5x5 Tent filter (45 degree sloped triangles in U and V) |
|||
void SampleShadow_ComputeSamples_Tent_5x5(float4 shadowMapTexture_TexelSize, float2 coord, out float fetchesWeights[9], out float2 fetchesUV[9]) |
|||
{ |
|||
// tent base is 5x5 base thus covering from 25 to 36 texels, thus we need 9 bilinear PCF fetches |
|||
float2 tentCenterInTexelSpace = coord.xy * shadowMapTexture_TexelSize.zw; |
|||
float2 centerOfFetchesInTexelSpace = floor(tentCenterInTexelSpace + 0.5); |
|||
float2 offsetFromTentCenterToCenterOfFetches = tentCenterInTexelSpace - centerOfFetchesInTexelSpace; |
|||
|
|||
// find the weight of each texel based on the area of a 45 degree slop tent above each of them. |
|||
float3 texelsWeightsU_A, texelsWeightsU_B; |
|||
float3 texelsWeightsV_A, texelsWeightsV_B; |
|||
SampleShadow_GetTexelWeights_Tent_5x5(offsetFromTentCenterToCenterOfFetches.x, texelsWeightsU_A, texelsWeightsU_B); |
|||
SampleShadow_GetTexelWeights_Tent_5x5(offsetFromTentCenterToCenterOfFetches.y, texelsWeightsV_A, texelsWeightsV_B); |
|||
|
|||
// each fetch will cover a group of 2x2 texels, the weight of each group is the sum of the weights of the texels |
|||
float3 fetchesWeightsU = float3(texelsWeightsU_A.xz, texelsWeightsU_B.y) + float3(texelsWeightsU_A.y, texelsWeightsU_B.xz); |
|||
float3 fetchesWeightsV = float3(texelsWeightsV_A.xz, texelsWeightsV_B.y) + float3(texelsWeightsV_A.y, texelsWeightsV_B.xz); |
|||
|
|||
// move the PCF bilinear fetches to respect texels weights |
|||
float3 fetchesOffsetsU = float3(texelsWeightsU_A.y, texelsWeightsU_B.xz) / fetchesWeightsU.xyz + float3(-2.5,-0.5,1.5); |
|||
float3 fetchesOffsetsV = float3(texelsWeightsV_A.y, texelsWeightsV_B.xz) / fetchesWeightsV.xyz + float3(-2.5,-0.5,1.5); |
|||
fetchesOffsetsU *= shadowMapTexture_TexelSize.xxx; |
|||
fetchesOffsetsV *= shadowMapTexture_TexelSize.yyy; |
|||
|
|||
float2 bilinearFetchOrigin = centerOfFetchesInTexelSpace * shadowMapTexture_TexelSize.xy; |
|||
fetchesUV[0] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.x); |
|||
fetchesUV[1] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.x); |
|||
fetchesUV[2] = bilinearFetchOrigin + float2(fetchesOffsetsU.z, fetchesOffsetsV.x); |
|||
fetchesUV[3] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.y); |
|||
fetchesUV[4] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.y); |
|||
fetchesUV[5] = bilinearFetchOrigin + float2(fetchesOffsetsU.z, fetchesOffsetsV.y); |
|||
fetchesUV[6] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.z); |
|||
fetchesUV[7] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.z); |
|||
fetchesUV[8] = bilinearFetchOrigin + float2(fetchesOffsetsU.z, fetchesOffsetsV.z); |
|||
|
|||
fetchesWeights[0] = fetchesWeightsU.x * fetchesWeightsV.x; |
|||
fetchesWeights[1] = fetchesWeightsU.y * fetchesWeightsV.x; |
|||
fetchesWeights[2] = fetchesWeightsU.z * fetchesWeightsV.x; |
|||
fetchesWeights[3] = fetchesWeightsU.x * fetchesWeightsV.y; |
|||
fetchesWeights[4] = fetchesWeightsU.y * fetchesWeightsV.y; |
|||
fetchesWeights[5] = fetchesWeightsU.z * fetchesWeightsV.y; |
|||
fetchesWeights[6] = fetchesWeightsU.x * fetchesWeightsV.z; |
|||
fetchesWeights[7] = fetchesWeightsU.y * fetchesWeightsV.z; |
|||
fetchesWeights[8] = fetchesWeightsU.z * fetchesWeightsV.z; |
|||
} |
|||
|
|||
// 7x7 Tent filter (45 degree sloped triangles in U and V) |
|||
void SampleShadow_ComputeSamples_Tent_7x7(float4 shadowMapTexture_TexelSize, float2 coord, out float fetchesWeights[16], out float2 fetchesUV[16]) |
|||
{ |
|||
// tent base is 7x7 base thus covering from 49 to 64 texels, thus we need 16 bilinear PCF fetches |
|||
float2 tentCenterInTexelSpace = coord.xy * shadowMapTexture_TexelSize.zw; |
|||
float2 centerOfFetchesInTexelSpace = floor(tentCenterInTexelSpace + 0.5); |
|||
float2 offsetFromTentCenterToCenterOfFetches = tentCenterInTexelSpace - centerOfFetchesInTexelSpace; |
|||
|
|||
// find the weight of each texel based on the area of a 45 degree slop tent above each of them. |
|||
float4 texelsWeightsU_A, texelsWeightsU_B; |
|||
float4 texelsWeightsV_A, texelsWeightsV_B; |
|||
SampleShadow_GetTexelWeights_Tent_7x7(offsetFromTentCenterToCenterOfFetches.x, texelsWeightsU_A, texelsWeightsU_B); |
|||
SampleShadow_GetTexelWeights_Tent_7x7(offsetFromTentCenterToCenterOfFetches.y, texelsWeightsV_A, texelsWeightsV_B); |
|||
|
|||
// each fetch will cover a group of 2x2 texels, the weight of each group is the sum of the weights of the texels |
|||
float4 fetchesWeightsU = float4(texelsWeightsU_A.xz, texelsWeightsU_B.xz) + float4(texelsWeightsU_A.yw, texelsWeightsU_B.yw); |
|||
float4 fetchesWeightsV = float4(texelsWeightsV_A.xz, texelsWeightsV_B.xz) + float4(texelsWeightsV_A.yw, texelsWeightsV_B.yw); |
|||
|
|||
// move the PCF bilinear fetches to respect texels weights |
|||
float4 fetchesOffsetsU = float4(texelsWeightsU_A.yw, texelsWeightsU_B.yw) / fetchesWeightsU.xyzw + float4(-3.5,-1.5,0.5,2.5); |
|||
float4 fetchesOffsetsV = float4(texelsWeightsV_A.yw, texelsWeightsV_B.yw) / fetchesWeightsV.xyzw + float4(-3.5,-1.5,0.5,2.5); |
|||
fetchesOffsetsU *= shadowMapTexture_TexelSize.xxxx; |
|||
fetchesOffsetsV *= shadowMapTexture_TexelSize.yyyy; |
|||
|
|||
float2 bilinearFetchOrigin = centerOfFetchesInTexelSpace * shadowMapTexture_TexelSize.xy; |
|||
fetchesUV[0] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.x); |
|||
fetchesUV[1] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.x); |
|||
fetchesUV[2] = bilinearFetchOrigin + float2(fetchesOffsetsU.z, fetchesOffsetsV.x); |
|||
fetchesUV[3] = bilinearFetchOrigin + float2(fetchesOffsetsU.w, fetchesOffsetsV.x); |
|||
fetchesUV[4] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.y); |
|||
fetchesUV[5] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.y); |
|||
fetchesUV[6] = bilinearFetchOrigin + float2(fetchesOffsetsU.z, fetchesOffsetsV.y); |
|||
fetchesUV[7] = bilinearFetchOrigin + float2(fetchesOffsetsU.w, fetchesOffsetsV.y); |
|||
fetchesUV[8] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.z); |
|||
fetchesUV[9] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.z); |
|||
fetchesUV[10] = bilinearFetchOrigin + float2(fetchesOffsetsU.z, fetchesOffsetsV.z); |
|||
fetchesUV[11] = bilinearFetchOrigin + float2(fetchesOffsetsU.w, fetchesOffsetsV.z); |
|||
fetchesUV[12] = bilinearFetchOrigin + float2(fetchesOffsetsU.x, fetchesOffsetsV.w); |
|||
fetchesUV[13] = bilinearFetchOrigin + float2(fetchesOffsetsU.y, fetchesOffsetsV.w); |
|||
fetchesUV[14] = bilinearFetchOrigin + float2(fetchesOffsetsU.z, fetchesOffsetsV.w); |
|||
fetchesUV[15] = bilinearFetchOrigin + float2(fetchesOffsetsU.w, fetchesOffsetsV.w); |
|||
|
|||
fetchesWeights[0] = fetchesWeightsU.x * fetchesWeightsV.x; |
|||
fetchesWeights[1] = fetchesWeightsU.y * fetchesWeightsV.x; |
|||
fetchesWeights[2] = fetchesWeightsU.z * fetchesWeightsV.x; |
|||
fetchesWeights[3] = fetchesWeightsU.w * fetchesWeightsV.x; |
|||
fetchesWeights[4] = fetchesWeightsU.x * fetchesWeightsV.y; |
|||
fetchesWeights[5] = fetchesWeightsU.y * fetchesWeightsV.y; |
|||
fetchesWeights[6] = fetchesWeightsU.z * fetchesWeightsV.y; |
|||
fetchesWeights[7] = fetchesWeightsU.w * fetchesWeightsV.y; |
|||
fetchesWeights[8] = fetchesWeightsU.x * fetchesWeightsV.z; |
|||
fetchesWeights[9] = fetchesWeightsU.y * fetchesWeightsV.z; |
|||
fetchesWeights[10] = fetchesWeightsU.z * fetchesWeightsV.z; |
|||
fetchesWeights[11] = fetchesWeightsU.w * fetchesWeightsV.z; |
|||
fetchesWeights[12] = fetchesWeightsU.x * fetchesWeightsV.w; |
|||
fetchesWeights[13] = fetchesWeightsU.y * fetchesWeightsV.w; |
|||
fetchesWeights[14] = fetchesWeightsU.z * fetchesWeightsV.w; |
|||
fetchesWeights[15] = fetchesWeightsU.w * fetchesWeightsV.w; |
|||
} |
|||
|
|||
// ------------------------------------------------------------------ |
|||
// PCF Filtering methods |
|||
// ------------------------------------------------------------------ |
|||
|
|||
float SampleShadow_PCF_1tap( ShadowContext shadowContext, float3 tcs, uint slice, uint texIdx, uint sampIdx ) |
|||
// 1 tap PCF sampling |
|||
// |
|||
float SampleShadow_PCF_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, float bias, uint slice, uint texIdx, uint sampIdx ) |
|||
// sample the texture |
|||
return SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, tcs, slice ).x; |
|||
float depthBias = asfloat( shadowContext.payloads[payloadOffset].x ); |
|||
payloadOffset++; |
|||
|
|||
// add the depth bias |
|||
tcs.z += depthBias; |
|||
// sample the texture |
|||
return SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, tcs, slice ).x; |
|||
float SampleShadow_PCF_1tap( ShadowContext shadowContext, float3 tcs, uint slice, Texture2DArray tex, SamplerComparisonState compSamp ) |
|||
float SampleShadow_PCF_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, float bias, uint slice, Texture2DArray tex, SamplerComparisonState compSamp ) |
|||
// sample the texture |
|||
return SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, tcs, slice ); |
|||
float depthBias = asfloat( shadowContext.payloads[payloadOffset].x ); |
|||
payloadOffset++; |
|||
|
|||
// add the depth bias |
|||
tcs.z += depthBias; |
|||
// sample the texture |
|||
return SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, tcs, slice ); |
|||
// 9 tap adaptive PCF sampling |
|||
// 3x3 tent PCF sampling (4 taps) |
|||
float SampleShadow_PCF_9tap_Adaptive( ShadowContext shadowContext, float2 texelSizeRcp, float3 tcs, uint slice, uint texIdx, uint sampIdx ) |
|||
float SampleShadow_PCF_Tent_3x3( ShadowContext shadowContext, inout uint payloadOffset, float4 texelSizeRcp, float3 coord, uint slice, uint texIdx, uint sampIdx ) |
|||
// Terms0 are weights for the individual samples, the other terms are offsets in texel space |
|||
float4 vShadow3x3PCFTerms0 = float4( 20.0f / 267.0f, 33.0f / 267.0f, 55.0f / 267.0f, 0.0f ); |
|||
float4 vShadow3x3PCFTerms1 = float4( texelSizeRcp.x, texelSizeRcp.y, -texelSizeRcp.x, -texelSizeRcp.y ); |
|||
float4 vShadow3x3PCFTerms2 = float4( texelSizeRcp.x, texelSizeRcp.y, 0.0f, 0.0f ); |
|||
float4 vShadow3x3PCFTerms3 = float4(-texelSizeRcp.x, -texelSizeRcp.y, 0.0f, 0.0f ); |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float depthBias = params.x; |
|||
payloadOffset++; |
|||
float4 v20Taps; |
|||
v20Taps.x = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms1.xy, tcs.z ), slice ).x; // 1 1 |
|||
v20Taps.y = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms1.zy, tcs.z ), slice ).x; // -1 1 |
|||
v20Taps.z = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms1.xw, tcs.z ), slice ).x; // 1 -1 |
|||
v20Taps.w = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms1.zw, tcs.z ), slice ).x; // -1 -1 |
|||
float flSum = dot( v20Taps.xyzw, float4( 0.25, 0.25, 0.25, 0.25 ) ); |
|||
// fully in light or shadow? -> bail |
|||
if( ( flSum == 0.0 ) || ( flSum == 1.0 ) ) |
|||
return flSum; |
|||
// TODO move this to shadow data to avoid the rcp? |
|||
float4 shadowMapTexture_TexelSize = float4(texelSizeRcp.xy, rcp(texelSizeRcp.xy)); |
|||
|
|||
// add the depth bias |
|||
coord.z += depthBias; |
|||
|
|||
float shadow = 0.0; |
|||
float fetchesWeights[4]; |
|||
float2 fetchesUV[4]; |
|||
|
|||
SampleShadow_ComputeSamples_Tent_3x3(shadowMapTexture_TexelSize, coord.xy, fetchesWeights, fetchesUV); |
|||
[loop] for (int i = 0; i < 4; i++) |
|||
{ |
|||
shadow += fetchesWeights[i] * SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( fetchesUV[i].xy, coord.z ), slice ).x; |
|||
} |
|||
return shadow; |
|||
} |
|||
|
|||
float SampleShadow_PCF_Tent_3x3(ShadowContext shadowContext, inout uint payloadOffset, float4 texelSizeRcp, float3 coord, uint slice, Texture2DArray tex, SamplerComparisonState compSamp ) |
|||
{ |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float depthBias = params.x; |
|||
payloadOffset++; |
|||
// we're in a transition area, do 5 more taps |
|||
flSum *= vShadow3x3PCFTerms0.x * 4.0; |
|||
// TODO move this to shadow data to avoid the rcp? |
|||
float4 shadowMapTexture_TexelSize = float4(texelSizeRcp.xy, rcp(texelSizeRcp.xy)); |
|||
float4 v33Taps; |
|||
v33Taps.x = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms2.xz, tcs.z ), slice ).x; // 1 0 |
|||
v33Taps.y = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms3.xz, tcs.z ), slice ).x; // -1 0 |
|||
v33Taps.z = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms3.zy, tcs.z ), slice ).x; // 0 -1 |
|||
v33Taps.w = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms2.zy, tcs.z ), slice ).x; // 0 1 |
|||
flSum += dot( v33Taps.xyzw, vShadow3x3PCFTerms0.yyyy ); |
|||
// add the depth bias |
|||
coord.z += depthBias; |
|||
flSum += SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, tcs, slice ).x * vShadow3x3PCFTerms0.z; |
|||
float shadow = 0.0; |
|||
float fetchesWeights[4]; |
|||
float2 fetchesUV[4]; |
|||
return flSum; |
|||
SampleShadow_ComputeSamples_Tent_3x3(shadowMapTexture_TexelSize, coord.xy, fetchesWeights, fetchesUV); |
|||
for (int i = 0; i < 4; i++) |
|||
{ |
|||
shadow += fetchesWeights[i] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[i].xy, coord.z ), slice ).x; |
|||
} |
|||
return shadow; |
|||
float SampleShadow_PCF_9tap_Adaptive(ShadowContext shadowContext, float2 texelSizeRcp, float3 tcs, uint slice, Texture2DArray tex, SamplerComparisonState compSamp ) |
|||
// |
|||
// 5x5 tent PCF sampling (9 taps) |
|||
// |
|||
float SampleShadow_PCF_Tent_5x5( ShadowContext shadowContext, inout uint payloadOffset, float4 texelSizeRcp, float3 coord, uint slice, uint texIdx, uint sampIdx ) |
|||
// Terms0 are weights for the individual samples, the other terms are offsets in texel space |
|||
float4 vShadow3x3PCFTerms0 = float4(20.0f / 267.0f, 33.0f / 267.0f, 55.0f / 267.0f, 0.0f); |
|||
float4 vShadow3x3PCFTerms1 = float4( texelSizeRcp.x, texelSizeRcp.y, -texelSizeRcp.x, -texelSizeRcp.y); |
|||
float4 vShadow3x3PCFTerms2 = float4( texelSizeRcp.x, texelSizeRcp.y, 0.0f, 0.0f); |
|||
float4 vShadow3x3PCFTerms3 = float4(-texelSizeRcp.x, -texelSizeRcp.y, 0.0f, 0.0f); |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float depthBias = params.x; |
|||
payloadOffset++; |
|||
float4 v20Taps; |
|||
v20Taps.x = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms1.xy, tcs.z ), slice ).x; // 1 1 |
|||
v20Taps.y = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms1.zy, tcs.z ), slice ).x; // -1 1 |
|||
v20Taps.z = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms1.xw, tcs.z ), slice ).x; // 1 -1 |
|||
v20Taps.w = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms1.zw, tcs.z ), slice ).x; // -1 -1 |
|||
float flSum = dot( v20Taps.xyzw, float4( 0.25, 0.25, 0.25, 0.25 ) ); |
|||
// fully in light or shadow? -> bail |
|||
if( ( flSum == 0.0 ) || ( flSum == 1.0 ) ) |
|||
return flSum; |
|||
// TODO move this to shadow data to avoid the rcp? |
|||
float4 shadowMapTexture_TexelSize = float4(texelSizeRcp.xy, rcp(texelSizeRcp.xy)); |
|||
// we're in a transition area, do 5 more taps |
|||
flSum *= vShadow3x3PCFTerms0.x * 4.0; |
|||
// add the depth bias |
|||
coord.z += depthBias; |
|||
float4 v33Taps; |
|||
v33Taps.x = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms2.xz, tcs.z ), slice ).x; // 1 0 |
|||
v33Taps.y = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms3.xz, tcs.z ), slice ).x; // -1 0 |
|||
v33Taps.z = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms3.zy, tcs.z ), slice ).x; // 0 -1 |
|||
v33Taps.w = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms2.zy, tcs.z ), slice ).x; // 0 1 |
|||
flSum += dot( v33Taps.xyzw, vShadow3x3PCFTerms0.yyyy ); |
|||
float shadow = 0.0; |
|||
float fetchesWeights[9]; |
|||
float2 fetchesUV[9]; |
|||
|
|||
SampleShadow_ComputeSamples_Tent_5x5(shadowMapTexture_TexelSize, coord.xy, fetchesWeights, fetchesUV); |
|||
[loop] for (int i = 0; i < 9; i++) |
|||
{ |
|||
shadow += fetchesWeights[i] * SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( fetchesUV[i].xy, coord.z ), slice ).x; |
|||
} |
|||
return shadow; |
|||
} |
|||
|
|||
float SampleShadow_PCF_Tent_5x5(ShadowContext shadowContext, inout uint payloadOffset, float4 texelSizeRcp, float3 coord, uint slice, Texture2DArray tex, SamplerComparisonState compSamp ) |
|||
{ |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float depthBias = params.x; |
|||
payloadOffset++; |
|||
|
|||
// TODO move this to shadow data to avoid the rcp |
|||
float4 shadowMapTexture_TexelSize = float4(texelSizeRcp.xy, rcp(texelSizeRcp.xy)); |
|||
|
|||
// add the depth bias |
|||
coord.z += depthBias; |
|||
|
|||
float shadow = 0.0; |
|||
float fetchesWeights[9]; |
|||
float2 fetchesUV[9]; |
|||
|
|||
SampleShadow_ComputeSamples_Tent_5x5(shadowMapTexture_TexelSize, coord.xy, fetchesWeights, fetchesUV); |
|||
for (int i = 0; i < 9; i++) |
|||
{ |
|||
shadow += fetchesWeights[i] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[i].xy, coord.z ), slice ).x; |
|||
} |
|||
return shadow; |
|||
} |
|||
|
|||
// |
|||
// 7x7 tent PCF sampling (16 taps) |
|||
// |
|||
float SampleShadow_PCF_Tent_7x7( ShadowContext shadowContext, inout uint payloadOffset, float4 texelSizeRcp, float3 coord, uint slice, uint texIdx, uint sampIdx ) |
|||
{ |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float depthBias = params.x; |
|||
payloadOffset++; |
|||
|
|||
// TODO move this to shadow data to avoid the rcp |
|||
float4 shadowMapTexture_TexelSize = float4(texelSizeRcp.xy, rcp(texelSizeRcp.xy)); |
|||
|
|||
// add the depth bias |
|||
coord.z += depthBias; |
|||
|
|||
float shadow = 0.0; |
|||
float fetchesWeights[16]; |
|||
float2 fetchesUV[16]; |
|||
|
|||
SampleShadow_ComputeSamples_Tent_7x7(shadowMapTexture_TexelSize, coord.xy, fetchesWeights, fetchesUV); |
|||
[loop] for (int i = 0; i < 16; i++) |
|||
{ |
|||
shadow += fetchesWeights[i] * SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( fetchesUV[i].xy, coord.z ), slice ).x; |
|||
} |
|||
|
|||
return shadow; |
|||
} |
|||
|
|||
float SampleShadow_PCF_Tent_7x7(ShadowContext shadowContext, inout uint payloadOffset, float4 texelSizeRcp, float3 coord, uint slice, Texture2DArray tex, SamplerComparisonState compSamp ) |
|||
{ |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float depthBias = params.x; |
|||
payloadOffset++; |
|||
|
|||
// TODO move this to shadow data to avoid the rcp |
|||
float4 shadowMapTexture_TexelSize = float4(texelSizeRcp.xy, rcp(texelSizeRcp.xy)); |
|||
|
|||
// add the depth bias |
|||
coord.z += depthBias; |
|||
|
|||
float shadow = 0.0; |
|||
float fetchesWeights[16]; |
|||
float2 fetchesUV[16]; |
|||
|
|||
SampleShadow_ComputeSamples_Tent_7x7(shadowMapTexture_TexelSize, coord.xy, fetchesWeights, fetchesUV); |
|||
for (int i = 0; i < 16; i++) |
|||
{ |
|||
shadow += fetchesWeights[i] * SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( fetchesUV[i].xy, coord.z ), slice ).x; |
|||
} |
|||
|
|||
return shadow; |
|||
} |
|||
|
|||
// |
|||
// 9 tap adaptive PCF sampling |
|||
// |
|||
float SampleShadow_PCF_9tap_Adaptive( ShadowContext shadowContext, inout uint payloadOffset, float4 texelSizeRcp, float3 tcs, float bias, uint slice, uint texIdx, uint sampIdx ) |
|||
{ |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float depthBias = params.x; |
|||
float filterSize = params.y; |
|||
payloadOffset++; |
|||
|
|||
texelSizeRcp *= filterSize; |
|||
|
|||
// add the depth bias |
|||
tcs.z += depthBias; |
|||
|
|||
// Terms0 are weights for the individual samples, the other terms are offsets in texel space |
|||
float4 vShadow3x3PCFTerms0 = float4( 20.0f / 267.0f, 33.0f / 267.0f, 55.0f / 267.0f, 0.0f ); |
|||
float4 vShadow3x3PCFTerms1 = float4( texelSizeRcp.x, texelSizeRcp.y, -texelSizeRcp.x, -texelSizeRcp.y ); |
|||
float4 vShadow3x3PCFTerms2 = float4( texelSizeRcp.x, texelSizeRcp.y, 0.0f, 0.0f ); |
|||
float4 vShadow3x3PCFTerms3 = float4(-texelSizeRcp.x, -texelSizeRcp.y, 0.0f, 0.0f ); |
|||
|
|||
float4 v20Taps; |
|||
v20Taps.x = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms1.xy, tcs.z ), slice ).x; // 1 1 |
|||
v20Taps.y = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms1.zy, tcs.z ), slice ).x; // -1 1 |
|||
v20Taps.z = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms1.xw, tcs.z ), slice ).x; // 1 -1 |
|||
v20Taps.w = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms1.zw, tcs.z ), slice ).x; // -1 -1 |
|||
float flSum = dot( v20Taps.xyzw, float4( 0.25, 0.25, 0.25, 0.25 ) ); |
|||
// fully in light or shadow? -> bail |
|||
if( ( flSum == 0.0 ) || ( flSum == 1.0 ) ) |
|||
return flSum; |
|||
|
|||
// we're in a transition area, do 5 more taps |
|||
flSum *= vShadow3x3PCFTerms0.x * 4.0; |
|||
|
|||
float4 v33Taps; |
|||
v33Taps.x = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms2.xz, tcs.z ), slice ).x; // 1 0 |
|||
v33Taps.y = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms3.xz, tcs.z ), slice ).x; // -1 0 |
|||
v33Taps.z = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms3.zy, tcs.z ), slice ).x; // 0 -1 |
|||
v33Taps.w = SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, float3( tcs.xy + vShadow3x3PCFTerms2.zy, tcs.z ), slice ).x; // 0 1 |
|||
flSum += dot( v33Taps.xyzw, vShadow3x3PCFTerms0.yyyy ); |
|||
|
|||
flSum += SampleCompShadow_T2DA( shadowContext, texIdx, sampIdx, tcs, slice ).x * vShadow3x3PCFTerms0.z; |
|||
|
|||
return flSum; |
|||
} |
|||
|
|||
float SampleShadow_PCF_9tap_Adaptive(ShadowContext shadowContext, inout uint payloadOffset, float4 texelSizeRcp, float3 tcs, float bias, uint slice, Texture2DArray tex, SamplerComparisonState compSamp ) |
|||
{ |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float depthBias = params.x; |
|||
float filterSize = params.y; |
|||
payloadOffset++; |
|||
|
|||
texelSizeRcp *= filterSize; |
|||
|
|||
// add the depth bias |
|||
tcs.z += depthBias; |
|||
|
|||
// Terms0 are weights for the individual samples, the other terms are offsets in texel space |
|||
float4 vShadow3x3PCFTerms0 = float4(20.0f / 267.0f, 33.0f / 267.0f, 55.0f / 267.0f, 0.0f); |
|||
float4 vShadow3x3PCFTerms1 = float4( texelSizeRcp.x, texelSizeRcp.y, -texelSizeRcp.x, -texelSizeRcp.y); |
|||
float4 vShadow3x3PCFTerms2 = float4( texelSizeRcp.x, texelSizeRcp.y, 0.0f, 0.0f); |
|||
float4 vShadow3x3PCFTerms3 = float4(-texelSizeRcp.x, -texelSizeRcp.y, 0.0f, 0.0f); |
|||
|
|||
float4 v20Taps; |
|||
v20Taps.x = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms1.xy, tcs.z ), slice ).x; // 1 1 |
|||
v20Taps.y = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms1.zy, tcs.z ), slice ).x; // -1 1 |
|||
v20Taps.z = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms1.xw, tcs.z ), slice ).x; // 1 -1 |
|||
v20Taps.w = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms1.zw, tcs.z ), slice ).x; // -1 -1 |
|||
float flSum = dot( v20Taps.xyzw, float4( 0.25, 0.25, 0.25, 0.25 ) ); |
|||
// fully in light or shadow? -> bail |
|||
if( ( flSum == 0.0 ) || ( flSum == 1.0 ) ) |
|||
return flSum; |
|||
|
|||
// we're in a transition area, do 5 more taps |
|||
flSum *= vShadow3x3PCFTerms0.x * 4.0; |
|||
|
|||
float4 v33Taps; |
|||
v33Taps.x = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms2.xz, tcs.z ), slice ).x; // 1 0 |
|||
v33Taps.y = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms3.xz, tcs.z ), slice ).x; // -1 0 |
|||
v33Taps.z = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms3.zy, tcs.z ), slice ).x; // 0 -1 |
|||
v33Taps.w = SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, float3( tcs.xy + vShadow3x3PCFTerms2.zy, tcs.z ), slice ).x; // 0 1 |
|||
flSum += dot( v33Taps.xyzw, vShadow3x3PCFTerms0.yyyy ); |
|||
|
|||
flSum += SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, tcs, slice ).x * vShadow3x3PCFTerms0.z; |
|||
|
|||
return flSum; |
|||
} |
|||
|
|||
#include "ShadowMoments.hlsl" |
|||
|
|||
// |
|||
// 1 tap VSM sampling |
|||
// |
|||
float SampleShadow_VSM_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, uint texIdx, uint sampIdx ) |
|||
{ |
|||
float depth = tcs.z; |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float lightLeakBias = params.x; |
|||
float varianceBias = params.y; |
|||
payloadOffset++; |
|||
|
|||
float2 moments = SampleShadow_T2DA( shadowContext, texIdx, sampIdx, tcs.xy, slice ).xy; |
|||
|
|||
return ShadowMoments_ChebyshevsInequality( moments, depth, varianceBias, lightLeakBias ); |
|||
} |
|||
|
|||
float SampleShadow_VSM_1tap(ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, Texture2DArray tex, SamplerState samp ) |
|||
{ |
|||
float depth = tcs.z; |
|||
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|||
float lightLeakBias = params.x; |
|||
float varianceBias = params.y; |
|||
payloadOffset++; |
|||
|
|||
float2 moments = SAMPLE_TEXTURE2D_ARRAY_LOD( tex, samp, tcs.xy, slice, 0.0 ).xy; |
|||
|
|||
return ShadowMoments_ChebyshevsInequality( moments, depth, varianceBias, lightLeakBias ); |
|||
} |
|||
|
|||
// |
|||
// 1 tap EVSM sampling |
|||
// |
|||
float SampleShadow_EVSM_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, uint texIdx, uint sampIdx, bool fourMoments ) |
|||
{ |
|||
float depth = tcs.z; |
|||
float4 params = asfloat( shadowContext.payloads[payloadOffset] ); |
|||
float lightLeakBias = params.x; |
|||
float varianceBias = params.y; |
|||
float2 evsmExponents = params.zw; |
|||
payloadOffset++; |
|||
|
|||
float2 warpedDepth = ShadowMoments_WarpDepth( depth, evsmExponents ); |
|||
|
|||
float4 moments = SampleShadow_T2DA( shadowContext, texIdx, sampIdx, tcs.xy, slice ); |
|||
|
|||
// Derivate of warping at depth |
|||
float2 depthScale = evsmExponents * warpedDepth; |
|||
float2 minVariance = depthScale * depthScale * varianceBias; |
|||
|
|||
[branch] |
|||
if( fourMoments ) |
|||
{ |
|||
float posContrib = ShadowMoments_ChebyshevsInequality( moments.xz, warpedDepth.x, minVariance.x, lightLeakBias ); |
|||
float negContrib = ShadowMoments_ChebyshevsInequality( moments.yw, warpedDepth.y, minVariance.y, lightLeakBias ); |
|||
return min( posContrib, negContrib ); |
|||
} |
|||
else |
|||
{ |
|||
return ShadowMoments_ChebyshevsInequality( moments.xy, warpedDepth.x, minVariance.x, lightLeakBias ); |
|||
} |
|||
} |
|||
|
|||
float SampleShadow_EVSM_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, Texture2DArray tex, SamplerState samp, bool fourMoments ) |
|||
{ |
|||
float depth = tcs.z; |
|||
float4 params = asfloat( shadowContext.payloads[payloadOffset] ); |
|||
float lightLeakBias = params.x; |
|||
float varianceBias = params.y; |
|||
float2 evsmExponents = params.zw; |
|||
payloadOffset++; |
|||
|
|||
float2 warpedDepth = ShadowMoments_WarpDepth( depth, evsmExponents ); |
|||
flSum += SAMPLE_TEXTURE2D_ARRAY_SHADOW( tex, compSamp, tcs, slice ).x * vShadow3x3PCFTerms0.z; |
|||
float4 moments = SAMPLE_TEXTURE2D_ARRAY_LOD( tex, samp, tcs.xy, slice, 0.0 ); |
|||
return flSum; |
|||
// Derivate of warping at depth |
|||
float2 depthScale = evsmExponents * warpedDepth; |
|||
float2 minVariance = depthScale * depthScale * varianceBias; |
|||
|
|||
[branch] |
|||
if( fourMoments ) |
|||
{ |
|||
float posContrib = ShadowMoments_ChebyshevsInequality( moments.xz, warpedDepth.x, minVariance.x, lightLeakBias ); |
|||
float negContrib = ShadowMoments_ChebyshevsInequality( moments.yw, warpedDepth.y, minVariance.y, lightLeakBias ); |
|||
return min( posContrib, negContrib ); |
|||
} |
|||
else |
|||
{ |
|||
return ShadowMoments_ChebyshevsInequality( moments.xy, warpedDepth.x, minVariance.x, lightLeakBias ); |
|||
} |
|||
} |
|||
|
|||
|
|||
// |
|||
// 1 tap MSM sampling |
|||
// |
|||
float SampleShadow_MSM_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, uint texIdx, uint sampIdx, bool useHamburger ) |
|||
{ |
|||
float4 params = asfloat( shadowContext.payloads[payloadOffset] ); |
|||
float lightLeakBias = params.x; |
|||
float momentBias = params.y; |
|||
float depthBias = params.z; |
|||
float bpp16 = params.w; |
|||
float depth = tcs.z + depthBias; |
|||
payloadOffset++; |
|||
|
|||
float4 moments = SampleShadow_T2DA( shadowContext, texIdx, sampIdx, tcs.xy, slice ); |
|||
if( bpp16 != 0.0 ) |
|||
moments = ShadowMoments_Decode16MSM( moments ); |
|||
|
|||
float3 z; |
|||
float4 b; |
|||
ShadowMoments_SolveMSM( moments, depth, momentBias, z, b ); |
|||
|
|||
if( useHamburger ) |
|||
return ShadowMoments_SolveDelta3MSM( z, b.xy, lightLeakBias ); |
|||
else |
|||
return (z[1] < 0.0 || z[2] > 1.0) ? ShadowMoments_SolveDelta4MSM( z, b, lightLeakBias ) : ShadowMoments_SolveDelta3MSM( z, b.xy, lightLeakBias ); |
|||
} |
|||
|
|||
float SampleShadow_MSM_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, Texture2DArray tex, SamplerState samp, bool useHamburger ) |
|||
{ |
|||
float4 params = asfloat( shadowContext.payloads[payloadOffset] ); |
|||
float lightLeakBias = params.x; |
|||
float momentBias = params.y; |
|||
float depthBias = params.z; |
|||
float bpp16 = params.w; |
|||
float depth = tcs.z + depthBias; |
|||
payloadOffset++; |
|||
|
|||
float4 moments = SAMPLE_TEXTURE2D_ARRAY_LOD( tex, samp, tcs.xy, slice, 0.0 ); |
|||
if( bpp16 != 0.0 ) |
|||
moments = ShadowMoments_Decode16MSM( moments ); |
|||
|
|||
float3 z; |
|||
float4 b; |
|||
ShadowMoments_SolveMSM( moments, depth, momentBias, z, b ); |
|||
|
|||
if( useHamburger ) |
|||
return ShadowMoments_SolveDelta3MSM( z, b.xy, lightLeakBias ); |
|||
else |
|||
return (z[1] < 0.0 || z[2] > 1.0) ? ShadowMoments_SolveDelta4MSM( z, b, lightLeakBias ) : ShadowMoments_SolveDelta3MSM( z, b.xy, lightLeakBias ); |
|||
} |
|||
|
|||
//----------------------------------------------------------------------------------------------------- |
|||
// helper function to dispatch a specific shadow algorithm |
|||
float SampleShadow_SelectAlgorithm( ShadowContext shadowContext, ShadowData shadowData, inout uint payloadOffset, float3 posTC, float depthBias, uint slice, uint algorithm, uint texIdx, uint sampIdx ) |
|||
{ |
|||
[branch] |
|||
switch( algorithm ) |
|||
{ |
|||
case GPUSHADOWALGORITHM_PCF_1TAP : return SampleShadow_PCF_1tap( shadowContext, payloadOffset, posTC, depthBias, slice, texIdx, sampIdx ); |
|||
case GPUSHADOWALGORITHM_PCF_9TAP : return SampleShadow_PCF_9tap_Adaptive( shadowContext, payloadOffset, shadowData.texelSizeRcp, posTC, depthBias, slice, texIdx, sampIdx ); |
|||
case GPUSHADOWALGORITHM_PCF_TENT_3X3 : return SampleShadow_PCF_Tent_3x3( shadowContext, payloadOffset, shadowData.texelSizeRcp, posTC, slice, texIdx, sampIdx ); |
|||
case GPUSHADOWALGORITHM_PCF_TENT_5X5 : return SampleShadow_PCF_Tent_5x5( shadowContext, payloadOffset, shadowData.texelSizeRcp, posTC, slice, texIdx, sampIdx ); |
|||
case GPUSHADOWALGORITHM_PCF_TENT_7X7 : return SampleShadow_PCF_Tent_7x7( shadowContext, payloadOffset, shadowData.texelSizeRcp, posTC, slice, texIdx, sampIdx ); |
|||
case GPUSHADOWALGORITHM_VSM : return SampleShadow_VSM_1tap( shadowContext, payloadOffset, posTC, slice, texIdx, sampIdx ); |
|||
case GPUSHADOWALGORITHM_EVSM_2 : return SampleShadow_EVSM_1tap( shadowContext, payloadOffset, posTC, slice, texIdx, sampIdx, false ); |
|||
case GPUSHADOWALGORITHM_EVSM_4 : return SampleShadow_EVSM_1tap( shadowContext, payloadOffset, posTC, slice, texIdx, sampIdx, true ); |
|||
case GPUSHADOWALGORITHM_MSM_HAM : return SampleShadow_MSM_1tap( shadowContext, payloadOffset, posTC, slice, texIdx, sampIdx, true ); |
|||
case GPUSHADOWALGORITHM_MSM_HAUS : return SampleShadow_MSM_1tap( shadowContext, payloadOffset, posTC, slice, texIdx, sampIdx, false ); |
|||
default: return 1.0; |
|||
} |
|||
} |
|||
|
|||
float SampleShadow_SelectAlgorithm( ShadowContext shadowContext, ShadowData shadowData, inout uint payloadOffset, float3 posTC, float depthBias, uint slice, uint algorithm, Texture2DArray tex, SamplerComparisonState compSamp ) |
|||
{ |
|||
[branch] |
|||
switch( algorithm ) |
|||
{ |
|||
case GPUSHADOWALGORITHM_PCF_1TAP : return SampleShadow_PCF_1tap( shadowContext, payloadOffset, posTC, depthBias, slice, tex, compSamp ); |
|||
case GPUSHADOWALGORITHM_PCF_9TAP : return SampleShadow_PCF_9tap_Adaptive( shadowContext, payloadOffset, shadowData.texelSizeRcp, posTC, depthBias, slice, tex, compSamp ); |
|||
case GPUSHADOWALGORITHM_PCF_TENT_3X3 : return SampleShadow_PCF_Tent_3x3( shadowContext, payloadOffset, shadowData.texelSizeRcp, posTC, slice, tex, compSamp ); |
|||
case GPUSHADOWALGORITHM_PCF_TENT_5X5 : return SampleShadow_PCF_Tent_5x5( shadowContext, payloadOffset, shadowData.texelSizeRcp, posTC, slice, tex, compSamp ); |
|||
case GPUSHADOWALGORITHM_PCF_TENT_7X7 : return SampleShadow_PCF_Tent_7x7( shadowContext, payloadOffset, shadowData.texelSizeRcp, posTC, slice, tex, compSamp ); |
|||
|
|||
default: return 1.0; |
|||
} |
|||
} |
|||
|
|||
float SampleShadow_SelectAlgorithm( ShadowContext shadowContext, ShadowData shadowData, inout uint payloadOffset, float3 posTC, float depthBias, uint slice, uint algorithm, Texture2DArray tex, SamplerState samp ) |
|||
{ |
|||
[branch] |
|||
switch( algorithm ) |
|||
{ |
|||
case GPUSHADOWALGORITHM_VSM : return SampleShadow_VSM_1tap( shadowContext, payloadOffset, posTC, slice, tex, samp ); |
|||
case GPUSHADOWALGORITHM_EVSM_2 : return SampleShadow_EVSM_1tap( shadowContext, payloadOffset, posTC, slice, tex, samp, false ); |
|||
case GPUSHADOWALGORITHM_EVSM_4 : return SampleShadow_EVSM_1tap( shadowContext, payloadOffset, posTC, slice, tex, samp, true ); |
|||
case GPUSHADOWALGORITHM_MSM_HAM : return SampleShadow_MSM_1tap( shadowContext, payloadOffset, posTC, slice, tex, samp, true ); |
|||
case GPUSHADOWALGORITHM_MSM_HAUS : return SampleShadow_MSM_1tap( shadowContext, payloadOffset, posTC, slice, tex, samp, false ); |
|||
default: return 1.0; |
|||
} |
|||
} |
998
Assets/ScriptableRenderPipeline/common/Shadow/Shadow.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: b0e81431fe3a7604fb9f9dd2a96bd7e0 |
|||
timeCreated: 1491321445 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: e7e55b7306a2b2f43886918882a8935a |
|||
timeCreated: 1491321445 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: d52d6e1ad3dca474ebd73d054d17fb2e |
|||
folderAsset: yes |
|||
timeCreated: 1491314187 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// This file is inlined by ShaderLibrary/Shadow/Shadow.hlsl twice. |
|||
// Each time either SHADOW_CONTEXT_INCLUDE or SHADOW_DISPATCH_INCLUDE is defined. |
|||
// In the case of SHADOW_CONTEXT_INCLUDE a valid path must be given to a file that contains |
|||
// the code to initialize a shadow context. |
|||
// SHADOW_DISPATCH_INCLUDE is optional. |
|||
|
|||
#ifdef SHADOW_CONTEXT_INCLUDE |
|||
# ifdef SHADOW_TILEPASS |
|||
# include "HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl" |
|||
# elif defined( SHADOW_FPTL ) |
|||
# include "fptl/ShadowContext.hlsl" |
|||
# else |
|||
# error "No valid path to the shadow context has been given." |
|||
# endif |
|||
#endif |
|||
|
|||
#ifdef SHADOW_DISPATCH_INCLUDE |
|||
# ifdef SHADOW_TILEPASS |
|||
# include "HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl" |
|||
# elif defined( SHADOW_FPTL ) |
|||
# include "fptl/ShadowDispatch.hlsl" |
|||
# else |
|||
// It's ok not to have a dispatcher include as it only acts as an override |
|||
# endif |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: cbc2765f95de56a47a8f39f5f1badd58 |
|||
timeCreated: 1491314187 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: d49f97c73daab8a4a8d389c977c2345f |
|||
folderAsset: yes |
|||
timeCreated: 1491321440 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
|
|||
// This can be custom for each project and needs to be in sync with the ShadowMgr |
|||
|
|||
#define SHADOWCONTEXT_MAX_TEX2DARRAY 1 |
|||
#define SHADOWCONTEXT_MAX_TEXCUBEARRAY 0 |
|||
#define SHADOWCONTEXT_MAX_SAMPLER 0 |
|||
#define SHADOWCONTEXT_MAX_COMPSAMPLER 1 |
|||
|
|||
SHADOWCONTEXT_DECLARE( SHADOWCONTEXT_MAX_TEX2DARRAY, SHADOWCONTEXT_MAX_TEXCUBEARRAY, SHADOWCONTEXT_MAX_COMPSAMPLER, SHADOWCONTEXT_MAX_SAMPLER ); |
|||
|
|||
TEXTURE2D_ARRAY(_ShadowmapExp_PCF); |
|||
SAMPLER2D_SHADOW(sampler_ShadowmapExp_PCF); |
|||
|
|||
StructuredBuffer<ShadowData> _ShadowDatasExp; |
|||
StructuredBuffer<int4> _ShadowPayloads; |
|||
|
|||
ShadowContext InitShadowContext() |
|||
{ |
|||
ShadowContext sc; |
|||
sc.shadowDatas = _ShadowDatasExp; |
|||
sc.payloads = _ShadowPayloads; |
|||
sc.tex2DArray[0] = _ShadowmapExp_PCF; |
|||
sc.compSamplers[0] = sampler_ShadowmapExp_PCF; |
|||
return sc; |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 30016f0dcc663b14483b62ccf2e8a7ce |
|||
timeCreated: 1491395507 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#define SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL // enables hardcoded resources and algorithm for directional lights |
|||
#define SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL // enables hardcoded resources and algorithm for punctual lights |
|||
|
|||
// example of overriding directional lights |
|||
#ifdef SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L ) |
|||
{ |
|||
Texture2DArray tex = shadowContext.tex2DArray[0]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[0]; |
|||
uint algo = GPUSHADOWALGORITHM_PCF_9TAP; |
|||
|
|||
return EvalShadow_CascadedDepth( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L ); |
|||
} |
|||
|
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
{ |
|||
return GetDirectionalShadowAttenuation( shadowContext, positionWS, normalWS, shadowDataIndex, L ); |
|||
} |
|||
#endif |
|||
|
|||
|
|||
// example of overriding punctual lights |
|||
#ifdef SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L ) |
|||
{ |
|||
// example for choosing the same algo |
|||
Texture2DArray tex = shadowContext.tex2DArray[0]; |
|||
SamplerComparisonState compSamp = shadowContext.compSamplers[0]; |
|||
uint algo = GPUSHADOWALGORITHM_PCF_9TAP; |
|||
return EvalShadow_PunctualDepth( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L ); |
|||
} |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
{ |
|||
return GetPunctualShadowAttenuation( shadowContext, positionWS, normalWS, shadowDataIndex, L ); |
|||
} |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 631ee816f7a634d48ae2c70c43a46e98 |
|||
timeCreated: 1491395507 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: f2f1273335a3dc54686dd5620bfc6790 |
|||
folderAsset: yes |
|||
timeCreated: 1491321440 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: fb36979473602464fa32deacb9630c08 |
|||
timeCreated: 1488205058 |
|||
licenseType: Pro |
|||
ComputeShaderImporter: |
|||
currentAPIMask: 4 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#define VSM 0 |
|||
#define EVSM_2 1 |
|||
#define EVSM_4 2 |
|||
#define MSM 3 |
|||
#define THREADS 16 |
|||
#define MAX_BLUR_SIZE 17 |
|||
|
|||
#pragma kernel main_VSM_3 KERNEL_MAIN=main_VSM_3 SHADOW_MOMENT_ALGORITHM=VSM MAX_MSAA=1 BLUR_SIZE=3 |
|||
#pragma kernel main_VSM_5 KERNEL_MAIN=main_VSM_5 SHADOW_MOMENT_ALGORITHM=VSM MAX_MSAA=1 BLUR_SIZE=5 |
|||
#pragma kernel main_VSM_7 KERNEL_MAIN=main_VSM_7 SHADOW_MOMENT_ALGORITHM=VSM MAX_MSAA=1 BLUR_SIZE=7 |
|||
#pragma kernel main_VSM_9 KERNEL_MAIN=main_VSM_9 SHADOW_MOMENT_ALGORITHM=VSM MAX_MSAA=1 BLUR_SIZE=9 |
|||
#pragma kernel main_VSM_11 KERNEL_MAIN=main_VSM_11 SHADOW_MOMENT_ALGORITHM=VSM MAX_MSAA=1 BLUR_SIZE=11 |
|||
#pragma kernel main_VSM_13 KERNEL_MAIN=main_VSM_13 SHADOW_MOMENT_ALGORITHM=VSM MAX_MSAA=1 BLUR_SIZE=13 |
|||
#pragma kernel main_VSM_15 KERNEL_MAIN=main_VSM_15 SHADOW_MOMENT_ALGORITHM=VSM MAX_MSAA=1 BLUR_SIZE=15 |
|||
#pragma kernel main_VSM_17 KERNEL_MAIN=main_VSM_17 SHADOW_MOMENT_ALGORITHM=VSM MAX_MSAA=1 BLUR_SIZE=17 |
|||
|
|||
#pragma kernel main_EVSM_2_3 KERNEL_MAIN=main_EVSM_2_3 SHADOW_MOMENT_ALGORITHM=EVSM_2 MAX_MSAA=1 BLUR_SIZE=3 |
|||
#pragma kernel main_EVSM_2_5 KERNEL_MAIN=main_EVSM_2_5 SHADOW_MOMENT_ALGORITHM=EVSM_2 MAX_MSAA=1 BLUR_SIZE=5 |
|||
#pragma kernel main_EVSM_2_7 KERNEL_MAIN=main_EVSM_2_7 SHADOW_MOMENT_ALGORITHM=EVSM_2 MAX_MSAA=1 BLUR_SIZE=7 |
|||
#pragma kernel main_EVSM_2_9 KERNEL_MAIN=main_EVSM_2_9 SHADOW_MOMENT_ALGORITHM=EVSM_2 MAX_MSAA=1 BLUR_SIZE=9 |
|||
#pragma kernel main_EVSM_2_11 KERNEL_MAIN=main_EVSM_2_11 SHADOW_MOMENT_ALGORITHM=EVSM_2 MAX_MSAA=1 BLUR_SIZE=11 |
|||
#pragma kernel main_EVSM_2_13 KERNEL_MAIN=main_EVSM_2_13 SHADOW_MOMENT_ALGORITHM=EVSM_2 MAX_MSAA=1 BLUR_SIZE=13 |
|||
#pragma kernel main_EVSM_2_15 KERNEL_MAIN=main_EVSM_2_15 SHADOW_MOMENT_ALGORITHM=EVSM_2 MAX_MSAA=1 BLUR_SIZE=15 |
|||
#pragma kernel main_EVSM_2_17 KERNEL_MAIN=main_EVSM_2_17 SHADOW_MOMENT_ALGORITHM=EVSM_2 MAX_MSAA=1 BLUR_SIZE=17 |
|||
|
|||
#pragma kernel main_EVSM_4_3 KERNEL_MAIN=main_EVSM_4_3 SHADOW_MOMENT_ALGORITHM=EVSM_4 MAX_MSAA=1 BLUR_SIZE=3 |
|||
#pragma kernel main_EVSM_4_5 KERNEL_MAIN=main_EVSM_4_5 SHADOW_MOMENT_ALGORITHM=EVSM_4 MAX_MSAA=1 BLUR_SIZE=5 |
|||
#pragma kernel main_EVSM_4_7 KERNEL_MAIN=main_EVSM_4_7 SHADOW_MOMENT_ALGORITHM=EVSM_4 MAX_MSAA=1 BLUR_SIZE=7 |
|||
#pragma kernel main_EVSM_4_9 KERNEL_MAIN=main_EVSM_4_9 SHADOW_MOMENT_ALGORITHM=EVSM_4 MAX_MSAA=1 BLUR_SIZE=9 |
|||
#pragma kernel main_EVSM_4_11 KERNEL_MAIN=main_EVSM_4_11 SHADOW_MOMENT_ALGORITHM=EVSM_4 MAX_MSAA=1 BLUR_SIZE=11 |
|||
#pragma kernel main_EVSM_4_13 KERNEL_MAIN=main_EVSM_4_13 SHADOW_MOMENT_ALGORITHM=EVSM_4 MAX_MSAA=1 BLUR_SIZE=13 |
|||
#pragma kernel main_EVSM_4_15 KERNEL_MAIN=main_EVSM_4_15 SHADOW_MOMENT_ALGORITHM=EVSM_4 MAX_MSAA=1 BLUR_SIZE=15 |
|||
#pragma kernel main_EVSM_4_17 KERNEL_MAIN=main_EVSM_4_17 SHADOW_MOMENT_ALGORITHM=EVSM_4 MAX_MSAA=1 BLUR_SIZE=17 |
|||
|
|||
#pragma kernel main_MSM_3 KERNEL_MAIN=main_MSM_3 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=1 BLUR_SIZE=3 |
|||
#pragma kernel main_MSM_5 KERNEL_MAIN=main_MSM_5 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=1 BLUR_SIZE=5 |
|||
#pragma kernel main_MSM_7 KERNEL_MAIN=main_MSM_7 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=1 BLUR_SIZE=7 |
|||
#pragma kernel main_MSM_9 KERNEL_MAIN=main_MSM_9 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=1 BLUR_SIZE=9 |
|||
#pragma kernel main_MSM_11 KERNEL_MAIN=main_MSM_11 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=1 BLUR_SIZE=11 |
|||
#pragma kernel main_MSM_13 KERNEL_MAIN=main_MSM_13 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=1 BLUR_SIZE=13 |
|||
#pragma kernel main_MSM_15 KERNEL_MAIN=main_MSM_15 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=1 BLUR_SIZE=15 |
|||
#pragma kernel main_MSM_17 KERNEL_MAIN=main_MSM_17 SHADOW_MOMENT_ALGORITHM=MSM MAX_MSAA=1 BLUR_SIZE=17 |
|||
|
|||
#include "ShaderLibrary/common.hlsl" |
|||
#include "ShaderLibrary/Shadow/ShadowMoments.hlsl" |
|||
|
|||
#define BLUR_BORDER (BLUR_SIZE / 2) |
|||
#define LDS_SIZE (THREADS + BLUR_BORDER + BLUR_BORDER) |
|||
|
|||
#if MAX_MSAA == 1 |
|||
Texture2D<float> depthTex; |
|||
#else |
|||
Texture2DMS<float> depthTex; |
|||
#endif |
|||
|
|||
uniform uint4 srcRect; // .xy = offset, .zw = width/height |
|||
uniform uint4 dstRect; // .xy = offset, .z = array slice , .w = Flags: 1 := 16bpp, 2 := 2 channels pp |
|||
|
|||
uniform float4 blurWeightsStorage[3]; // Unity expects float arrays to be tightly packed |
|||
static float blurWeights[12] = (float[12])blurWeightsStorage; |
|||
|
|||
static const int kBits_16 = 1; // 16 bits per channel |
|||
static const int kChannels_2 = 2; // 2 channels per pixel |
|||
|
|||
#if (SHADOW_MOMENT_ALGORITHM == VSM) |
|||
# define SHADOW_MOMENTS 2 |
|||
float2 DepthToMoments( float depth ) |
|||
{ |
|||
return float2( depth, depth * depth ); |
|||
} |
|||
#elif SHADOW_MOMENT_ALGORITHM == EVSM_2 |
|||
# define SHADOW_MOMENTS 2 |
|||
|
|||
uniform float evsmExponent; |
|||
|
|||
float2 DepthToMoments( float depth ) |
|||
{ |
|||
float2 moments = ShadowMoments_WarpDepth( depth, evsmExponent.xx ); |
|||
return float2( moments.x, moments.x * moments.x ); |
|||
} |
|||
#elif SHADOW_MOMENT_ALGORITHM == EVSM_4 |
|||
# define SHADOW_MOMENTS 4 |
|||
|
|||
uniform float2 evsmExponents; |
|||
|
|||
float4 DepthToMoments( float depth ) |
|||
{ |
|||
float2 moments = ShadowMoments_WarpDepth( depth, evsmExponents ); |
|||
return float4( moments.xy, moments.xy * moments.xy ); |
|||
} |
|||
|
|||
#elif SHADOW_MOMENT_ALGORITHM == MSM |
|||
# define SHADOW_MOMENTS 4 |
|||
float4 DepthToMoments( float depth ) |
|||
{ |
|||
[branch] |
|||
if( (dstRect.w & kBits_16) != 0 ) |
|||
return ShadowMoments_Encode16MSM( depth ); |
|||
else |
|||
{ |
|||
float dsq = depth * depth; |
|||
return float4( depth, dsq, depth * dsq, dsq * dsq ); |
|||
} |
|||
} |
|||
#else |
|||
# error "No valid shadow moment algorithm has been set to the define SHADOW_MOMENT_ALGORITHM." |
|||
#endif |
|||
|
|||
|
|||
#define moment_t MERGE_NAME( float, SHADOW_MOMENTS ) |
|||
RWTexture2DArray<moment_t> outputTex; |
|||
groupshared moment_t moments[LDS_SIZE][LDS_SIZE]; |
|||
|
|||
|
|||
|
|||
[numthreads( THREADS, THREADS, 1 )] |
|||
void KERNEL_MAIN(uint3 dispatchId : SV_DispatchThreadID, uint3 groupThreadId : SV_GroupThreadID) |
|||
{ |
|||
uint i, j; // because the compiler scopes like its 1999. |
|||
|
|||
#if MAX_MSAA > 1 |
|||
uint width, height, sampleCnt; |
|||
depthTex.GetDimensions(width, height, sampleCnt); |
|||
sampleCnt = Clamp(0, MAX_MSAA, sampleCnt); |
|||
float sampleCntRcp = 1.0 / sampleCnt; |
|||
|
|||
// calculate weights based on sample positions |
|||
float sumWeights = 0; |
|||
float sampleWeights[MAX_MSAA]; |
|||
for (i = 0; i < sampleCnt; i++) |
|||
{ |
|||
float2 spos = depthTex.GetSamplePosition( i ); |
|||
sampleWeights[i] = sampleCntRcp; // TODO: find a better weight filter |
|||
sumWeights += sampleWeights[i]; |
|||
} |
|||
sumWeights = 1.0 / sumWeights; |
|||
#endif |
|||
|
|||
// load moments into LDS |
|||
// each workgroup works on THREADS * THREADS tiles, but the blur filter requires |
|||
// us to fetch enough data around the border of the current tile. |
|||
// We assume that the blur filter's support does not exceed THREADS, so we fetch |
|||
// the data in 4 blocks. |
|||
const int blurBorder = BLUR_BORDER; |
|||
const int2 ldsSize = int2( LDS_SIZE, LDS_SIZE ); |
|||
const int2 threadsCnt = int2( THREADS, THREADS ); |
|||
const int4 validSrc = int4( srcRect.xy, srcRect.xy + srcRect.zw - 1 ); |
|||
int2 srcIdx = ((int2) dispatchId.xy) - blurBorder.xx + srcRect.xy; |
|||
int2 ldsIdx = groupThreadId.xy; |
|||
|
|||
// calculate an average moment over all samples for a given pixel and load the result into LDS |
|||
uint iw, ih, is; |
|||
[unroll] |
|||
for( ih = 0; ih < 2; ih++ ) |
|||
{ |
|||
[branch] |
|||
if (ldsIdx.y >= ldsSize.y) |
|||
continue; |
|||
[unroll] |
|||
for( iw = 0; iw < 2; iw++ ) |
|||
{ |
|||
[branch] |
|||
if (ldsIdx.x >= ldsSize.x) |
|||
continue; |
|||
|
|||
moment_t avgMoments = 0.0; |
|||
#if MAX_MSAA > 1 |
|||
for( is = 0; is < sampleCnt; is++ ) |
|||
{ |
|||
float depth = depthTex.Load( Clamp( srcIdx, validSrc.xy, validSrc.zw ), is ).x; |
|||
moment_t moments = DepthToMoments( depth ); |
|||
avgMoments += sampleWeights[is] * moments; |
|||
} |
|||
avgMoments *= sumWeights; |
|||
#else |
|||
avgMoments = DepthToMoments( depthTex.Load( int3( Clamp( srcIdx, validSrc.xy, validSrc.zw ), 0 ) ).x ); |
|||
#endif |
|||
moments[ldsIdx.y][ldsIdx.x] = avgMoments; |
|||
|
|||
ldsIdx.x += threadsCnt.x; |
|||
srcIdx.x += threadsCnt.x; |
|||
} |
|||
ldsIdx.x = groupThreadId.x; |
|||
srcIdx.x = (int) dispatchId.x - blurBorder + srcRect.x; |
|||
ldsIdx.y += threadsCnt.y; |
|||
srcIdx.y += threadsCnt.y; |
|||
} |
|||
|
|||
// sync across all threads so LDS contains the moments for each pixel that we need for the blur |
|||
GroupMemoryBarrierWithGroupSync(); |
|||
|
|||
// first pass blurs horizontally |
|||
ldsIdx = groupThreadId.xy + int2( blurBorder, 0 ); |
|||
moment_t hblurredMoment = 0.0, hblurredMoment2 = 0.0; |
|||
int blurOffset; |
|||
for( blurOffset = -blurBorder; blurOffset <= blurBorder; blurOffset++ ) |
|||
{ |
|||
hblurredMoment += moments[ldsIdx.y][ldsIdx.x + blurOffset] * blurWeights[abs( blurOffset )]; |
|||
} |
|||
ldsIdx.y += threadsCnt.y; |
|||
[branch] |
|||
if( ldsIdx.y < ldsSize.y ) |
|||
{ |
|||
for( blurOffset = -blurBorder; blurOffset <= blurBorder; blurOffset++ ) |
|||
{ |
|||
hblurredMoment2 += moments[ldsIdx.y][ldsIdx.x + blurOffset] * blurWeights[abs(blurOffset)]; |
|||
} |
|||
} |
|||
|
|||
// make sure all reads/writes are done |
|||
GroupMemoryBarrierWithGroupSync(); |
|||
// replace LDS values with the horizontally blurred values |
|||
moments[groupThreadId.y][ldsIdx.x] = hblurredMoment; |
|||
[branch] |
|||
if( ldsIdx.y < ldsSize.y ) |
|||
moments[ldsIdx.y][ldsIdx.x] = hblurredMoment2; |
|||
GroupMemoryBarrierWithGroupSync(); |
|||
|
|||
|
|||
// second pass blurs vertically |
|||
ldsIdx = groupThreadId.xy + blurBorder.xx; |
|||
moment_t vblurredMoment = 0.0; |
|||
for( blurOffset = -blurBorder; blurOffset <= blurBorder; blurOffset++ ) |
|||
{ |
|||
vblurredMoment += moments[ldsIdx.y + blurOffset][ldsIdx.x] * blurWeights[abs( blurOffset )]; |
|||
} |
|||
|
|||
// and write out the result |
|||
if( all( dispatchId.xy < srcRect.zw ) ) |
|||
{ |
|||
dispatchId.z = dstRect.z; |
|||
dispatchId.xy += dstRect.xy; |
|||
outputTex[dispatchId] = vblurredMoment; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3d03971a8848ee14bb29a3c4ee9790b8 |
|||
timeCreated: 1491321444 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// Various shadow algorithms |
|||
// There are two variants provided, one takes the texture and sampler explicitly so they can be statically passed in. |
|||
// The variant without resource parameters dynamically accesses the texture when sampling. |
|||
|
|||
// Helper function to offset depth based on the surface normal and light direction. |
|||
// If the light hits the surface perpendicularly there will be no offset. |
|||
float3 EvalShadow_NormalBias( float3 normalWS, float NoL, float2 texelSize, float normalBias ) |
|||
{ |
|||
return max( texelSize.x, texelSize.y ) * normalBias * (1.0 - NoL) * normalWS; |
|||
} |
|||
|
|||
// function called by spot, point and directional eval routines to calculate shadow coordinates |
|||
float3 EvalShadow_GetTexcoords( ShadowData sd, float3 positionWS ) |
|||
{ |
|||
float4 posCS = mul( float4( positionWS, 1.0 ), sd.worldToShadow ); |
|||
posCS.z -= sd.bias * posCS.w; |
|||
float3 posNDC = posCS.xyz / posCS.w; |
|||
// calc TCs |
|||
float3 posTC = posNDC * 0.5 + 0.5; |
|||
posTC.xy = posTC.xy * sd.scaleOffset.xy + sd.scaleOffset.zw; |
|||
#if UNITY_REVERSED_Z |
|||
posTC.z = 1.0 - posTC.z; |
|||
#endif |
|||
return posTC; |
|||
} |
|||
|
|||
int EvalShadow_GetCubeFaceID( float3 dir ) |
|||
{ |
|||
// TODO: Use faceID intrinsic on console |
|||
float3 adir = abs(dir); |
|||
|
|||
// +Z -Z |
|||
int faceIndex = dir.z > 0.0 ? CUBEMAPFACE_NEGATIVE_Z : CUBEMAPFACE_POSITIVE_Z; |
|||
|
|||
// +X -X |
|||
if (adir.x > adir.y && adir.x > adir.z) |
|||
{ |
|||
faceIndex = dir.x > 0.0 ? CUBEMAPFACE_NEGATIVE_X : CUBEMAPFACE_POSITIVE_X; |
|||
} |
|||
// +Y -Y |
|||
else if (adir.y > adir.x && adir.y > adir.z) |
|||
{ |
|||
faceIndex = dir.y > 0.0 ? CUBEMAPFACE_NEGATIVE_Y : CUBEMAPFACE_POSITIVE_Y; |
|||
} |
|||
return faceIndex; |
|||
} |
|||
|
|||
|
|||
// |
|||
// Point shadows |
|||
// |
|||
float EvalShadow_PointDepth( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
int faceIndex = EvalShadow_GetCubeFaceID( L ) + 1; |
|||
ShadowData sd = shadowContext.shadowDatas[index + faceIndex]; |
|||
uint payloadOffset = GetPayloadOffset( sd ); |
|||
// normal based bias |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// get the algorithm |
|||
uint shadowType, shadowAlgorithm; |
|||
UnpackShadowType( sd.shadowType, shadowType, shadowAlgorithm ); |
|||
// sample the texture according to the given algorithm |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, texIdx, sampIdx ); |
|||
} |
|||
|
|||
#define EvalShadow_PointDepth_( _samplerType ) \ |
|||
float EvalShadow_PointDepth( ShadowContext shadowContext, uint shadowAlgorithm, Texture2DArray tex, _samplerType samp, float3 positionWS, float3 normalWS, int index, float3 L ) \ |
|||
{ \ |
|||
/* load the right shadow data for the current face */ \ |
|||
int faceIndex = EvalShadow_GetCubeFaceID( L ) + 1; \ |
|||
ShadowData sd = shadowContext.shadowDatas[index + faceIndex]; \ |
|||
uint payloadOffset = GetPayloadOffset( sd ); \ |
|||
/* normal based bias */ \ |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); \ |
|||
/* get shadowmap texcoords */ \ |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); \ |
|||
/* sample the texture */ \ |
|||
float slice; \ |
|||
UnpackShadowmapId( sd.id, slice ); \ |
|||
return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, tex, samp ); \ |
|||
} |
|||
EvalShadow_PointDepth_( SamplerComparisonState ) |
|||
EvalShadow_PointDepth_( SamplerState ) |
|||
#undef EvalShadow_PointDepth_ |
|||
|
|||
// |
|||
// Spot shadows |
|||
// |
|||
float EvalShadow_SpotDepth( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
ShadowData sd = shadowContext.shadowDatas[index]; |
|||
uint payloadOffset = GetPayloadOffset( sd ); |
|||
// normal based bias |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// get the algorithm |
|||
uint shadowType, shadowAlgorithm; |
|||
UnpackShadowType( sd.shadowType, shadowType, shadowAlgorithm ); |
|||
// sample the texture according to the given algorithm |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, texIdx, sampIdx ); |
|||
} |
|||
|
|||
#define EvalShadow_SpotDepth_( _samplerType ) \ |
|||
float EvalShadow_SpotDepth( ShadowContext shadowContext, uint shadowAlgorithm, Texture2DArray tex, _samplerType samp, float3 positionWS, float3 normalWS, int index, float3 L ) \ |
|||
{ \ |
|||
/* load the right shadow data for the current face */ \ |
|||
ShadowData sd = shadowContext.shadowDatas[index]; \ |
|||
uint payloadOffset = GetPayloadOffset( sd ); \ |
|||
/* normal based bias */ \ |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); \ |
|||
/* get shadowmap texcoords */ \ |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); \ |
|||
/* sample the texture */ \ |
|||
float slice; \ |
|||
UnpackShadowmapId( sd.id, slice ); \ |
|||
return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, tex, samp ); \ |
|||
} |
|||
EvalShadow_SpotDepth_( SamplerComparisonState ) |
|||
EvalShadow_SpotDepth_( SamplerState ) |
|||
#undef EvalShadow_SpotDepth_ |
|||
|
|||
// |
|||
// Punctual shadows for Point and Spot |
|||
// |
|||
float EvalShadow_PunctualDepth( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
int faceIndex = 0; |
|||
// get the algorithm |
|||
uint shadowType, shadowAlgorithm; |
|||
UnpackShadowType( shadowContext.shadowDatas[index].shadowType, shadowType ); |
|||
|
|||
[branch] |
|||
if( shadowType == GPUSHADOWTYPE_POINT ) |
|||
{ |
|||
faceIndex = EvalShadow_GetCubeFaceID( L ) + 1; |
|||
} |
|||
|
|||
ShadowData sd = shadowContext.shadowDatas[index + faceIndex]; |
|||
uint payloadOffset = GetPayloadOffset( sd ); |
|||
// normal based bias |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// sample the texture according to the given algorithm |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
UnpackShadowType( sd.shadowType, shadowType, shadowAlgorithm ); |
|||
return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, texIdx, sampIdx ); |
|||
} |
|||
|
|||
#define EvalShadow_PunctualDepth_( _samplerType ) \ |
|||
float EvalShadow_PunctualDepth( ShadowContext shadowContext, uint shadowAlgorithm, Texture2DArray tex, _samplerType samp, float3 positionWS, float3 normalWS, int index, float3 L ) \ |
|||
{ \ |
|||
/* load the right shadow data for the current face */ \ |
|||
int faceIndex = 0; \ |
|||
/* get the shadow type */ \ |
|||
uint shadowType; \ |
|||
UnpackShadowType( shadowContext.shadowDatas[index].shadowType, shadowType ); \ |
|||
\ |
|||
[branch] \ |
|||
if( shadowType == GPUSHADOWTYPE_POINT ) \ |
|||
{ \ |
|||
faceIndex = EvalShadow_GetCubeFaceID( L ) + 1; \ |
|||
} \ |
|||
\ |
|||
ShadowData sd = shadowContext.shadowDatas[index + faceIndex]; \ |
|||
uint payloadOffset = GetPayloadOffset( sd ); \ |
|||
/* normal based bias */ \ |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); \ |
|||
/* get shadowmap texcoords */ \ |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); \ |
|||
/* sample the texture */ \ |
|||
float slice; \ |
|||
UnpackShadowmapId( sd.id, slice ); \ |
|||
return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, tex, samp ); \ |
|||
} |
|||
EvalShadow_PunctualDepth_( SamplerComparisonState ) |
|||
EvalShadow_PunctualDepth_( SamplerState ) |
|||
#undef EvalShadow_PunctualDepth_ |
|||
|
|||
// |
|||
// Directional shadows (cascaded shadow map) |
|||
// |
|||
int EvalShadow_GetSplitSphereIndexForDirshadows( float3 positionWS, float4 dirShadowSplitSpheres[4] ) |
|||
{ |
|||
float3 fromCenter0 = positionWS.xyz - dirShadowSplitSpheres[0].xyz; |
|||
float3 fromCenter1 = positionWS.xyz - dirShadowSplitSpheres[1].xyz; |
|||
float3 fromCenter2 = positionWS.xyz - dirShadowSplitSpheres[2].xyz; |
|||
float3 fromCenter3 = positionWS.xyz - dirShadowSplitSpheres[3].xyz; |
|||
float4 distances2 = float4(dot(fromCenter0, fromCenter0), dot(fromCenter1, fromCenter1), dot(fromCenter2, fromCenter2), dot(fromCenter3, fromCenter3)); |
|||
|
|||
float4 dirShadowSplitSphereSqRadii; |
|||
dirShadowSplitSphereSqRadii.x = dirShadowSplitSpheres[0].w; |
|||
dirShadowSplitSphereSqRadii.y = dirShadowSplitSpheres[1].w; |
|||
dirShadowSplitSphereSqRadii.z = dirShadowSplitSpheres[2].w; |
|||
dirShadowSplitSphereSqRadii.w = dirShadowSplitSpheres[3].w; |
|||
|
|||
if( distances2.w > dirShadowSplitSphereSqRadii.w ) |
|||
return -1; |
|||
|
|||
float4 weights = float4( distances2 < dirShadowSplitSphereSqRadii ); |
|||
weights.yzw = saturate( weights.yzw - weights.xyz ); |
|||
|
|||
return int( 4.0 - dot( weights, float4(4.0, 3.0, 2.0, 1.0 ) ) ); |
|||
} |
|||
|
|||
uint EvalShadow_LoadSplitSpheres( ShadowContext shadowContext, int index, out float4 splitSpheres[4] ) |
|||
{ |
|||
uint offset = GetPayloadOffset( shadowContext.shadowDatas[index] ); |
|||
|
|||
splitSpheres[0] = asfloat( shadowContext.payloads[offset + 0] ); |
|||
splitSpheres[1] = asfloat( shadowContext.payloads[offset + 1] ); |
|||
splitSpheres[2] = asfloat( shadowContext.payloads[offset + 2] ); |
|||
splitSpheres[3] = asfloat( shadowContext.payloads[offset + 3] ); |
|||
return offset + 4; |
|||
} |
|||
|
|||
float EvalShadow_CascadedDepth( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
float4 dirShadowSplitSpheres[4]; |
|||
uint payloadOffset = EvalShadow_LoadSplitSpheres( shadowContext, index, dirShadowSplitSpheres ); |
|||
int shadowSplitIndex = EvalShadow_GetSplitSphereIndexForDirshadows( positionWS, dirShadowSplitSpheres ); |
|||
if( shadowSplitIndex < 0 ) |
|||
return 1.0; |
|||
|
|||
ShadowData sd = shadowContext.shadowDatas[index + 1 + shadowSplitIndex]; |
|||
// normal based bias |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
|
|||
// sample the texture |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
|
|||
uint shadowType, shadowAlgorithm; |
|||
UnpackShadowType( sd.shadowType, shadowType, shadowAlgorithm ); |
|||
|
|||
return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, texIdx, sampIdx ); |
|||
} |
|||
|
|||
#define EvalShadow_CascadedDepth_( _samplerType ) \ |
|||
float EvalShadow_CascadedDepth( ShadowContext shadowContext, uint shadowAlgorithm, Texture2DArray tex, _samplerType samp, float3 positionWS, float3 normalWS, int index, float3 L ) \ |
|||
{ \ |
|||
/* load the right shadow data for the current face */ \ |
|||
float4 dirShadowSplitSpheres[4]; \ |
|||
uint payloadOffset = EvalShadow_LoadSplitSpheres( shadowContext, index, dirShadowSplitSpheres ); \ |
|||
uint shadowSplitIndex = EvalShadow_GetSplitSphereIndexForDirshadows( positionWS, dirShadowSplitSpheres ); \ |
|||
ShadowData sd = shadowContext.shadowDatas[index + 1 + shadowSplitIndex]; \ |
|||
/* normal based bias */ \ |
|||
positionWS += EvalShadow_NormalBias( normalWS, saturate( dot( normalWS, L ) ), sd.texelSizeRcp.zw, sd.normalBias ); \ |
|||
/* get shadowmap texcoords */ \ |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); \ |
|||
/* sample the texture */ \ |
|||
float slice; \ |
|||
UnpackShadowmapId( sd.id, slice ); \ |
|||
\ |
|||
return SampleShadow_SelectAlgorithm( shadowContext, sd, payloadOffset, posTC, sd.bias, slice, shadowAlgorithm, tex, samp ); \ |
|||
} |
|||
EvalShadow_CascadedDepth_( SamplerComparisonState ) |
|||
EvalShadow_CascadedDepth_( SamplerState ) |
|||
#undef EvalShadow_CascadedDepth_ |
|
|||
fileFormatVersion: 2 |
|||
guid: e2ca1e297ddf0b54f9d72244a419844b |
|||
timeCreated: 1491321445 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: aa4f463e1cdf08f42934e66c91cd612e |
|||
timeCreated: 1491321444 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// Library header containing various useful functions for doing moment based shadow maps. |
|||
// Supported flavors are VSM, EVSM and MSM |
|||
|
|||
|
|||
// conversion helper for VSM flavors |
|||
// Chebychev's inequality (one-tailed version) |
|||
// P( x >= t ) <= pmax(t) := sigma^2 / (sigma^2 + (t - u)^2) |
|||
// for us t is depth, u is E(x) i.d. the blurred depth |
|||
float ShadowMoments_ChebyshevsInequality( float2 moments, float depth, float minVariance, float lightLeakBias ) |
|||
{ |
|||
// variance sig^2 = E(x^2) - E(x)^2 |
|||
float variance = max( moments.y - (moments.x * moments.x), minVariance ); |
|||
|
|||
// probabilistic upper bound |
|||
float mD = depth - moments.x; |
|||
float p = variance / (variance + mD * mD); |
|||
|
|||
#if UNITY_REVERSED_Z |
|||
p = saturate( (p - lightLeakBias) / (1.0f - lightLeakBias) ); |
|||
return max( p, depth >= moments.x ); |
|||
#else |
|||
p = saturate( p / (1.0f - lightLeakBias) ); |
|||
return max( p, depth <= moments.x ); |
|||
#endif |
|||
} |
|||
|
|||
// helper for EVSM |
|||
float2 ShadowMoments_WarpDepth( float depth, float2 exponents ) |
|||
{ |
|||
// Rescale depth into [-1;1] |
|||
depth = 2.0 * depth - 1.0; |
|||
float pos = exp( exponents.x * depth ); |
|||
float neg = -exp(-exponents.y * depth ); |
|||
return float2( pos, neg ); |
|||
} |
|||
|
|||
// helpers for MSM |
|||
// Prepare the moments so there's little quantization error when storing the moments at half |
|||
// precision. This step becomes unnecessary if the moments are stored in 32bit floats. |
|||
float4 ShadowMoments_Encode16MSM( float depth ) |
|||
{ |
|||
float dsq = depth * depth; |
|||
float4 moments = { depth, dsq, depth * dsq, dsq * dsq }; |
|||
float4x4 mat = { - 2.07224649 , 13.7948857237, 0.105877704 , 9.7924062118, |
|||
32.23703778 , -59.4683975703, -1.9077466311, -33.7652110555, |
|||
-68.571074599 , 82.0359750338, 9.3496555107, 47.9456096605, |
|||
39.3703274134, -35.364903257 , -6.6543490743, -23.9728048165 }; |
|||
|
|||
float4 optimized = mul( moments, mat ); |
|||
optimized[0] += 0.035955884801; |
|||
|
|||
return optimized; |
|||
} |
|||
|
|||
float4 ShadowMoments_Decode16MSM( float4 moments ) |
|||
{ |
|||
moments[0] -= 0.035955884801; |
|||
float4x4 mat = { 0.2227744146, 0.1549679261, 0.1451988946, 0.163127443, |
|||
0.0771972861, 0.1394629426, 0.2120202157, 0.2591432266, |
|||
0.7926986636, 0.7963415838, 0.7258694464, 0.6539092497, |
|||
0.0319417555, -0.1722823173, -0.2758014811, -0.3376131734 }; |
|||
return mul( moments, mat ); |
|||
} |
|||
|
|||
void ShadowMoments_SolveMSM( float4 moments, float depth, float momentBias, out float3 z, out float4 b ) |
|||
{ |
|||
// Bias input data to avoid artifacts |
|||
z[0] = depth; |
|||
b = lerp( moments, 0.5.xxxx, momentBias ); |
|||
|
|||
// Compute a Cholesky factorization of the Hankel matrix B storing only non-trivial entries or related products |
|||
float L32D22 = mad( -b[0], b[1], b[2] ); |
|||
float D22 = mad( -b[0], b[0], b[1] ); |
|||
float sqDepthVar = mad( -b[1], b[1], b[3] ); |
|||
float D33D22 = dot( float2( sqDepthVar, -L32D22 ), float2( D22, L32D22 ) ); |
|||
float InvD22 = 1.0 / D22; |
|||
float L32 = L32D22 * InvD22; |
|||
// Obtain a scaled inverse image of bz = ( 1, z[0], z[0]*z[0] )^T |
|||
float3 c = float3( 1.0, z[0], z[0] * z[0] ); |
|||
// Forward substitution to solve L * c1 = bz; |
|||
c[1] -= b.x; |
|||
c[2] -= b.y + L32 * c[1]; |
|||
// Scaling to solve D * c2 = c1 |
|||
c[1] *= InvD22; |
|||
c[2] *= D22 / D33D22; |
|||
// Backward substitution to solve L^T * c3 = c2 |
|||
c[1] -= L32 * c[2]; |
|||
c[0] -= dot( c.yz, b.xy ); |
|||
// Solve the quadratic equation c[0] + c[1] * z + c[2] * z^2 to obtain solutions z[1] and z[2] |
|||
float p = c[1] / c[2]; |
|||
float q = c[0] / c[2]; |
|||
float D = ((p*p) * 0.25) - q; |
|||
float r = sqrt( D ); |
|||
z[1] = -(p * 0.5) - r; |
|||
z[2] = -(p * 0.5) + r; |
|||
} |
|||
|
|||
float ShadowMoments_SolveDelta3MSM( float3 z, float2 b, float lightLeakBias ) |
|||
{ |
|||
// Construct a solution composed of three Dirac-deltas and evaluate its CDF |
|||
float4 switchVal = (z[2] < z[0]) ? float4( z[1], z[0], 1.0, 1.0 ) |
|||
: ((z[1] < z[0]) ? float4( z[0], z[1], 0.0, 1.0 ) : 0.0.xxxx); |
|||
|
|||
float quotient = (switchVal[0] * z[2] - b[0] * (switchVal[0] + z[2]) + b[1]) / ((z[2] - switchVal[1]) * (z[0] - z[1])); |
|||
float attenuation = saturate( switchVal[2] + switchVal[3] * quotient ); |
|||
|
|||
#if UNITY_REVERSED_Z // probably |
|||
return saturate( (attenuation - lightLeakBias) / (1.0f - lightLeakBias) ); |
|||
#else |
|||
return saturate( ((1.0 - attenuation) - lightLeakBias) / (1.0f - lightLeakBias) ); |
|||
#endif |
|||
} |
|||
|
|||
float ShadowMoments_SolveDelta4MSM( float3 z, float4 b, float lightLeakBias) |
|||
{ |
|||
// Use a solution made of four deltas |
|||
float zFree = ((b[2] - b[1]) * z[0] + b[2] - b[3]) / ((b[1] - b[0]) * z[0] + b[1] - b[2]); |
|||
float w1Factor = (z[0] > zFree) ? 1.0 : 0.0; |
|||
float attenuation = saturate( (b[1] - b[0] + (b[2] - b[0] - (zFree + 1.0) * (b[1] - b[0])) * (zFree - w1Factor - z[0]) / (z[0] * (z[0] - zFree))) / (zFree - w1Factor) + 1.0 - b[0] ); |
|||
|
|||
#if UNITY_REVERSED_Z // probably |
|||
return saturate( (attenuation - lightLeakBias) / (1.0f - lightLeakBias) ); |
|||
#else |
|||
return saturate( ((1.0 - attenuation) - lightLeakBias) / (1.0f - lightLeakBias) ); |
|||
#endif |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 46258e7f416004a4db9dc7cc2c5a3b62 |
|||
timeCreated: 1491321444 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 870dbce0ad39569448fa01659ed39fd0 |
|||
timeCreated: 1491321444 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// This file contains various helper declarations for declaring and sampling members of the ShadowContext struct. |
|||
|
|||
// shadow lookup routines when dynamic array access is possible |
|||
#if SHADOW_SUPPORTS_DYNAMIC_INDEXING != 0 |
|||
|
|||
// Shader model >= 5.1 |
|||
# define SHADOW_DEFINE_SAMPLING_FUNC_T2DA_COMP( _Tex2DArraySlots , _SamplerCompSlots ) float4 SampleCompShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float slice ) { return SAMPLE_TEXTURE2D_ARRAY_SHADOW( ctxt.tex2DArray[texIdx], ctxt.compSamplers[sampIdx], tcs, slice ); } |
|||
# define SHADOW_DEFINE_SAMPLING_FUNC_T2DA_SAMP( _Tex2DArraySlots , _SamplerSlots ) float4 SampleShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float2 tcs, float slice, float lod = 0.0 ) { return SAMPLE_TEXTURE2D_ARRAY_LOD( ctxt.tex2DArray[texIdx], ctxt.samplers[sampIdx], tcs, slice, lod ); } |
|||
# define SHADOW_DEFINE_SAMPLING_FUNC_TCA_COMP( _TexCubeArraySlots, _SamplerCompSlots ) float4 SampleCompShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float4 tcs, float cubeIdx ) { return SAMPLE_TEXTURECUBE_ARRAY_SHADOW( ctxt.texCubeArray[texIdx], ctxt.compSamplers[sampIdx], tcs, cubeIdx );} |
|||
# define SHADOW_DEFINE_SAMPLING_FUNC_TCA_SAMP( _TexCubeArraySlots, _SamplerSlots ) float4 SampleShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float cubeIdx, float lod = 0.0 ) { return SAMPLE_TEXTURECUBE_ARRAY_LOD( ctxt.texCubeArray[texIdx], ctxt.samplers[sampIdx], tcs, cubeIdx, lod ); } |
|||
|
|||
#else // helper macros if dynamic indexing does not work |
|||
|
|||
// Sampler and texture combinations are static. No shadowmap will ever be sampled with two different samplers. |
|||
// Once shadowmaps and samplers are fixed consider writing custom dispatchers directly accessing textures and samplers. |
|||
# define SHADOW_DEFINE_SAMPLING_FUNC_T2DA_COMP( _Tex2DArraySlots, _SamplerCompSlots ) \ |
|||
float4 SampleCompShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float slice ) \ |
|||
{ \ |
|||
float4 res = 1.0.xxxx; \ |
|||
[unroll] for( uint i = 0; i < _Tex2DArraySlots; i++ ) \ |
|||
{ \ |
|||
[unroll] for( uint j = 0; j < _SamplerCompSlots; j++ ) \ |
|||
{ \ |
|||
[branch] if( i == texIdx && j == sampIdx ) \ |
|||
{ \ |
|||
res = SAMPLE_TEXTURE2D_ARRAY_SHADOW( ctxt.tex2DArray[i], ctxt.compSamplers[j], tcs, slice ); \ |
|||
break; \ |
|||
} \ |
|||
} \ |
|||
} \ |
|||
return res; \ |
|||
} |
|||
|
|||
# define SHADOW_DEFINE_SAMPLING_FUNC_T2DA_SAMP( _Tex2DArraySlots, _SamplerSlots ) \ |
|||
float4 SampleShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float2 tcs, float slice, float lod = 0.0 ) \ |
|||
{ \ |
|||
float4 res = 1.0.xxxx; \ |
|||
[unroll] for( uint i = 0; i < _Tex2DArraySlots; i++ ) \ |
|||
{ \ |
|||
[unroll] for( uint j = 0; j < _SamplerSlots; j++ ) \ |
|||
{ \ |
|||
[branch] if( i == texIdx && j == sampIdx ) \ |
|||
{ \ |
|||
res = SAMPLE_TEXTURE2D_ARRAY_LOD( ctxt.tex2DArray[i], ctxt.samplers[j], tcs, slice, lod ); \ |
|||
break; \ |
|||
} \ |
|||
} \ |
|||
} \ |
|||
return res; \ |
|||
} |
|||
|
|||
# define SHADOW_DEFINE_SAMPLING_FUNC_TCA_COMP( _TexCubeArraySlots, _SamplerCompSlots ) \ |
|||
float4 SampleCompShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float4 tcs, float cubeIdx ) \ |
|||
{ \ |
|||
float4 res = 1.0.xxxx; \ |
|||
[unroll] for( uint i = 0; i < _TexCubeArraySlots; i++ ) \ |
|||
{ \ |
|||
[unroll] for( uint j = 0; j < _SamplerCompSlots; j++ ) \ |
|||
{ \ |
|||
[branch] if( i == texIdx && j == sampIdx ) \ |
|||
{ \ |
|||
res = SAMPLE_TEXTURECUBE_ARRAY_SHADOW( ctxt.texCubeArray[i], ctxt.compSamplers[j], tcs, cubeIdx ); \ |
|||
break; \ |
|||
} \ |
|||
} \ |
|||
} \ |
|||
return res; \ |
|||
} |
|||
|
|||
# define SHADOW_DEFINE_SAMPLING_FUNC_TCA_SAMP( _TexCubeArraySlots, _SamplerSlots ) \ |
|||
float4 SampleShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float cubeIdx, float lod = 0.0 ) \ |
|||
{ \ |
|||
float4 res = 1.0.xxxx; \ |
|||
[unroll] for( uint i = 0; i < _TexCubeArraySlots; i++ ) \ |
|||
{ \ |
|||
[unroll] for( uint j = 0; j < _SamplerSlots; j++ ) \ |
|||
{ \ |
|||
[branch] if( i == texIdx && j == sampIdx ) \ |
|||
{ \ |
|||
res = SAMPLE_TEXTURECUBE_ARRAY_LOD( ctxt.texCubeArray[i], ctxt.samplers[j], tcs, cubeIdx, lod ); \ |
|||
break; \ |
|||
} \ |
|||
} \ |
|||
} \ |
|||
return res; \ |
|||
} |
|||
#endif // SHADOW_SUPPORTS_DYNAMIC_INDEXING != 0 |
|||
|
|||
// helper macro to suppress code generation if _cnt is 0 |
|||
#define SHADOW_DECLARE_SAMPLING_FUNC_T2DA_COMP( _Tex2DArraySlots , _SamplerCompSlots ) float4 SampleCompShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float slice ); |
|||
#define SHADOW_DECLARE_SAMPLING_FUNC_T2DA_SAMP( _Tex2DArraySlots , _SamplerSlots ) float4 SampleShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float2 tcs, float slice, float lod = 0.0 ); |
|||
#define SHADOW_DECLARE_SAMPLING_FUNC_TCA_COMP( _TexCubeArraySlots, _SamplerCompSlots ) float4 SampleCompShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float4 tcs, float cubeIdx ); |
|||
#define SHADOW_DECLARE_SAMPLING_FUNC_TCA_SAMP( _TexCubeArraySlots, _SamplerSlots ) float4 SampleShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float cubeIdx, float lod = 0.0 ); |
|||
|
|||
#define SHADOW_CAT( _left, _right ) _left ## _right |
|||
|
|||
#define SHADOW_CHECK_0( _macro ) |
|||
#define SHADOW_CHECK_1( _macro ) _macro |
|||
#define SHADOW_CHECK_2( _macro ) _macro |
|||
#define SHADOW_CHECK_3( _macro ) _macro |
|||
#define SHADOW_CHECK_4( _macro ) _macro |
|||
#define SHADOW_CHECK_5( _macro ) _macro |
|||
#define SHADOW_CHECK_6( _macro ) _macro |
|||
#define SHADOW_CHECK_7( _macro ) _macro |
|||
#define SHADOW_CHECK_8( _macro ) _macro |
|||
#define SHADOW_CHECK_9( _macro ) _macro |
|||
#define SHADOW_CHECK( _cnt, _macro ) SHADOW_CAT( SHADOW_CHECK_ , _cnt ) ( _macro ) |
|||
|
|||
|
|||
#define SHADOW_CHECK_ALT_0( _macro, _alt ) _alt |
|||
#define SHADOW_CHECK_ALT_1( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT_2( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT_3( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT_4( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT_5( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT_6( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT_7( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT_8( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT_9( _macro, _alt ) _macro |
|||
#define SHADOW_CHECK_ALT( _cnt, _macro, _alt ) SHADOW_CAT( SHADOW_CHECK_ALT_ , _cnt ) ( _macro, _alt ) |
|||
|
|||
// helper macro to declare texture members for the shadow context. |
|||
#define SHADOWCONTEXT_DECLARE_TEXTURES( _Tex2DArraySlots, _TexCubeArraySlots, _SamplerCompSlots, _SamplerSlots ) \ |
|||
SHADOW_CHECK( _Tex2DArraySlots , Texture2DArray tex2DArray[_Tex2DArraySlots]; ) \ |
|||
SHADOW_CHECK( _TexCubeArraySlots, TextureCubeArray texCubeArray[_TexCubeArraySlots]; ) \ |
|||
SHADOW_CHECK( _SamplerCompSlots , SamplerComparisonState compSamplers[_Tex2DArraySlots]; ) \ |
|||
SHADOW_CHECK( _SamplerSlots , SamplerState samplers[_Tex2DArraySlots]; ) |
|||
// helper macro to declare texture sampling functions for the shadow context. |
|||
#define SHADOW_DEFINE_SAMPLING_FUNCS( _Tex2DArraySlots, _TexCubeArraySlots, _SamplerCompSlots, _SamplerSlots ) \ |
|||
SHADOW_CHECK( _Tex2DArraySlots , SHADOW_CHECK_ALT( _SamplerCompSlots, SHADOW_DEFINE_SAMPLING_FUNC_T2DA_COMP( _Tex2DArraySlots, _SamplerCompSlots ), SHADOW_DECLARE_SAMPLING_FUNC_T2DA_COMP( _Tex2DArraySlots, _SamplerCompSlots ) ) ) \ |
|||
SHADOW_CHECK( _Tex2DArraySlots , SHADOW_CHECK_ALT( _SamplerSlots , SHADOW_DEFINE_SAMPLING_FUNC_T2DA_SAMP( _Tex2DArraySlots, _SamplerSlots ), SHADOW_DECLARE_SAMPLING_FUNC_T2DA_SAMP( _Tex2DArraySlots, _SamplerSlots ) ) ) \ |
|||
SHADOW_CHECK( _TexCubeArraySlots, SHADOW_CHECK_ALT( _SamplerCompSlots, SHADOW_DEFINE_SAMPLING_FUNC_TCA_COMP(_TexCubeArraySlots, _SamplerCompSlots ), SHADOW_DECLARE_SAMPLING_FUNC_TCA_COMP(_TexCubeArraySlots, _SamplerCompSlots ) ) ) \ |
|||
SHADOW_CHECK( _TexCubeArraySlots, SHADOW_CHECK_ALT( _SamplerSlots , SHADOW_DEFINE_SAMPLING_FUNC_TCA_SAMP(_TexCubeArraySlots, _SamplerSlots ), SHADOW_DECLARE_SAMPLING_FUNC_TCA_SAMP(_TexCubeArraySlots, _SamplerSlots ) ) ) |
|
|||
fileFormatVersion: 2 |
|||
guid: a9c17fbca36dfb744b42fb48d3829887 |
|||
timeCreated: 1491321444 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 11e59a3cb6482b245b20ac498cb3afd5 |
|||
timeCreated: 1491321441 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 78929777594e2d84aba05af5bf6463d0 |
|||
timeCreated: 1491321444 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 7640004f9f444ad40aba7003ccb31e7f |
|||
timeCreated: 1491321441 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
|
|||
namespace UnityEngine.Experimental.Rendering |
|||
{ |
|||
public class ShadowUtilsConstants |
|||
{ |
|||
// Matches ScriptableShadowsUtility.cpp
|
|||
public enum CubemapEdge |
|||
{ |
|||
kCubeEdgePX_PY = 0, |
|||
kCubeEdgePX_NY, |
|||
kCubeEdgePX_PZ, |
|||
kCubeEdgePX_NZ, |
|||
|
|||
kCubeEdgeNX_PY, |
|||
kCubeEdgeNX_NY, |
|||
kCubeEdgeNX_PZ, |
|||
kCubeEdgeNX_NZ, |
|||
|
|||
kCubeEdgePY_PZ, |
|||
kCubeEdgePY_NZ, |
|||
kCubeEdgeNY_PZ, |
|||
kCubeEdgeNY_NZ, |
|||
kCubeEdge_Count |
|||
}; |
|||
|
|||
public static readonly CubemapEdge[,] kCubemapEdgesPerFace = new CubemapEdge[6,4] |
|||
{ |
|||
{ CubemapEdge.kCubeEdgePX_PY, CubemapEdge.kCubeEdgePX_NY, CubemapEdge.kCubeEdgePX_PZ, CubemapEdge.kCubeEdgePX_NZ }, // PX
|
|||
{ CubemapEdge.kCubeEdgeNX_PY, CubemapEdge.kCubeEdgeNX_NY, CubemapEdge.kCubeEdgeNX_PZ, CubemapEdge.kCubeEdgeNX_NZ }, // NX
|
|||
{ CubemapEdge.kCubeEdgePX_PY, CubemapEdge.kCubeEdgeNX_PY, CubemapEdge.kCubeEdgePY_PZ, CubemapEdge.kCubeEdgePY_NZ }, // PY
|
|||
{ CubemapEdge.kCubeEdgePX_NY, CubemapEdge.kCubeEdgeNX_NY, CubemapEdge.kCubeEdgeNY_PZ, CubemapEdge.kCubeEdgeNY_NZ }, // NY
|
|||
{ CubemapEdge.kCubeEdgePX_PZ, CubemapEdge.kCubeEdgeNX_PZ, CubemapEdge.kCubeEdgePY_PZ, CubemapEdge.kCubeEdgeNY_PZ }, // PZ
|
|||
{ CubemapEdge.kCubeEdgePX_NZ, CubemapEdge.kCubeEdgeNX_NZ, CubemapEdge.kCubeEdgePY_NZ, CubemapEdge.kCubeEdgeNY_NZ } // NZ
|
|||
}; |
|||
|
|||
const float oneOverSqr2 = 0.70710678118654752440084436210485f; |
|||
public static readonly Vector3[] kCubemapEdgeDirections = new Vector3[(int)CubemapEdge.kCubeEdge_Count] |
|||
{ |
|||
new Vector3( oneOverSqr2, oneOverSqr2, 0 ), |
|||
new Vector3( oneOverSqr2, -oneOverSqr2, 0 ), |
|||
new Vector3( oneOverSqr2, 0, oneOverSqr2 ), |
|||
new Vector3( oneOverSqr2, 0, -oneOverSqr2 ), |
|||
|
|||
new Vector3( -oneOverSqr2, oneOverSqr2, 0 ), |
|||
new Vector3( -oneOverSqr2, -oneOverSqr2, 0 ), |
|||
new Vector3( -oneOverSqr2, 0, oneOverSqr2 ), |
|||
new Vector3( -oneOverSqr2, 0, -oneOverSqr2 ), |
|||
|
|||
new Vector3( 0, oneOverSqr2, oneOverSqr2 ), |
|||
new Vector3( 0, oneOverSqr2, -oneOverSqr2 ), |
|||
new Vector3( 0, -oneOverSqr2, oneOverSqr2 ), |
|||
new Vector3( 0, -oneOverSqr2, -oneOverSqr2 ) |
|||
}; |
|||
|
|||
// Cubemap faces with flipped z coordinate.
|
|||
// These matrices do NOT match what we have in Skybox.cpp.
|
|||
// The C++ runtime flips y as well and requires patching up
|
|||
// the culling state. Using these matrices keeps the winding
|
|||
// order, but may need some special treatment if rendering
|
|||
// into an actual cubemap.
|
|||
public static readonly Matrix4x4[] kCubemapFaces = new Matrix4x4[] |
|||
{ |
|||
new Matrix4x4( // pos X
|
|||
new Vector4( 0.0f, 0.0f, -1.0f, 0.0f ), |
|||
new Vector4( 0.0f, 1.0f, 0.0f, 0.0f ), |
|||
new Vector4( -1.0f, 0.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ), |
|||
new Matrix4x4( // neg x
|
|||
new Vector4( 0.0f, 0.0f, 1.0f, 0.0f ), |
|||
new Vector4( 0.0f, 1.0f, 0.0f, 0.0f ), |
|||
new Vector4( 1.0f, 0.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ), |
|||
new Matrix4x4( // pos y
|
|||
new Vector4( 1.0f, 0.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, -1.0f, 0.0f ), |
|||
new Vector4( 0.0f, -1.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ), |
|||
new Matrix4x4( // neg y
|
|||
new Vector4( 1.0f, 0.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, 1.0f, 0.0f ), |
|||
new Vector4( 0.0f, 1.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ), |
|||
new Matrix4x4( // pos z
|
|||
new Vector4( 1.0f, 0.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 1.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, -1.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ), |
|||
new Matrix4x4( // neg z
|
|||
new Vector4( -1.0f, 0.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 1.0f, 0.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, 1.0f, 0.0f ), |
|||
new Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) ) |
|||
}; |
|||
|
|||
|
|||
|
|||
} |
|||
public class ShadowUtils |
|||
{ |
|||
public static Matrix4x4 ExtractSpotLightMatrix( VisibleLight vl, out Matrix4x4 view, out Matrix4x4 proj, out Vector4 lightDir, out ShadowSplitData splitData ) |
|||
{ |
|||
splitData = new ShadowSplitData(); |
|||
splitData.cullingSphere.Set( 0.0f, 0.0f, 0.0f, float.NegativeInfinity ); |
|||
splitData.cullingPlaneCount = 0; |
|||
// get lightDir
|
|||
lightDir = vl.light.transform.forward; |
|||
// calculate view
|
|||
Matrix4x4 scaleMatrix = Matrix4x4.identity; |
|||
scaleMatrix.m22 = -1.0f; |
|||
view = scaleMatrix * vl.localToWorld.inverse; |
|||
// following code is from SharedLightData::GetNearPlaneMinBound
|
|||
float percentageBound = 0.01f * vl.light.range; |
|||
float fixedBound = 0.1f; |
|||
float nearmin = fixedBound <= percentageBound ? fixedBound : percentageBound; |
|||
// calculate projection
|
|||
float zfar = vl.range; |
|||
float znear = vl.light.shadowNearPlane >= nearmin ? vl.light.shadowNearPlane : nearmin; |
|||
float fov = vl.spotAngle; |
|||
proj = Matrix4x4.Perspective(fov, 1.0f, znear, zfar); |
|||
// and the compound
|
|||
return proj * view; |
|||
} |
|||
|
|||
|
|||
public static Matrix4x4 ExtractPointLightMatrix( VisibleLight vl, uint faceIdx, float fovBias, out Matrix4x4 view, out Matrix4x4 proj, out Vector4 lightDir, out ShadowSplitData splitData ) |
|||
{ |
|||
Debug.Assert( faceIdx <= (uint) CubemapFace.NegativeZ, "Tried to extract cubemap face " + faceIdx + "." ); |
|||
|
|||
splitData = new ShadowSplitData(); |
|||
splitData.cullingSphere.Set( 0.0f, 0.0f, 0.0f, float.NegativeInfinity ); |
|||
splitData.cullingPlaneCount = 4; |
|||
// get lightDir
|
|||
lightDir = vl.light.transform.forward; |
|||
// calculate the view matrices
|
|||
Vector3 lpos = vl.light.transform.position; |
|||
view = ShadowUtilsConstants.kCubemapFaces[faceIdx]; |
|||
Vector3 inverted_viewpos = ShadowUtilsConstants.kCubemapFaces[faceIdx].MultiplyPoint( -lpos ); |
|||
view.SetColumn( 3, new Vector4( inverted_viewpos.x, inverted_viewpos.y, inverted_viewpos.z, 1.0f ) ); |
|||
|
|||
for( int i = 0; i < 4; ++i ) |
|||
{ |
|||
ShadowUtilsConstants.CubemapEdge cubemapEdge = ShadowUtilsConstants.kCubemapEdgesPerFace[faceIdx,i]; |
|||
Vector3 cullingPlaneDirection = ShadowUtilsConstants.kCubemapEdgeDirections[(int)cubemapEdge]; |
|||
splitData.SetCullingPlane( i, new Plane( cullingPlaneDirection, lpos ) ); |
|||
} |
|||
// following code is from SharedLightData::GetNearPlaneMinBound
|
|||
float percentageBound = 0.01f * vl.light.range; |
|||
float fixedBound = 0.1f; |
|||
float nearmin = fixedBound <= percentageBound ? fixedBound : percentageBound; |
|||
// calculate projection
|
|||
float farPlane = vl.range; |
|||
float nearPlane = vl.light.shadowNearPlane >= nearmin ? vl.light.shadowNearPlane : nearmin; |
|||
proj = Matrix4x4.Perspective( 90.0f + fovBias, 1.0f, nearPlane, farPlane ); |
|||
// and the compound
|
|||
return proj * view; |
|||
} |
|||
|
|||
public static Matrix4x4 ExtractDirectionalLightMatrix( VisibleLight vl, uint cascadeIdx, int cascadeCount, Vector3 splitRatio, float nearPlaneOffset, uint width, uint height, out Matrix4x4 view, out Matrix4x4 proj, out Vector4 lightDir, out ShadowSplitData splitData, CullResults cullResults, int lightIndex ) |
|||
{ |
|||
Debug.Assert( width == height, "Currently the cascaded shadow mapping code requires square cascades." ); |
|||
splitData = new ShadowSplitData(); |
|||
splitData.cullingSphere.Set(0.0f, 0.0f, 0.0f, float.NegativeInfinity); |
|||
splitData.cullingPlaneCount = 0; |
|||
// get lightDir
|
|||
lightDir = vl.light.transform.forward; |
|||
// TODO: At some point this logic should be moved to C#, then the parameters cullResults and lightIndex can be removed as well
|
|||
// For directional lights shadow data is extracted from the cullResults, so that needs to be somehow provided here.
|
|||
// Check ScriptableShadowsUtility.cpp ComputeDirectionalShadowMatricesAndCullingPrimitives(...) for details.
|
|||
cullResults.ComputeDirectionalShadowMatricesAndCullingPrimitives( lightIndex, (int) cascadeIdx, cascadeCount, splitRatio, (int) width, nearPlaneOffset, out view, out proj, out splitData ); |
|||
// and the compound
|
|||
return proj * view; |
|||
} |
|||
|
|||
public static bool MapLightType( LightType lt, out HDPipeline.GPULightType gputype, out GPUShadowType shadowtype ) |
|||
{ |
|||
switch( lt ) |
|||
{ |
|||
case LightType.Spot : gputype = HDPipeline.GPULightType.Spot; shadowtype = GPUShadowType.Spot; return true; |
|||
case LightType.Directional : gputype = HDPipeline.GPULightType.Directional; shadowtype = GPUShadowType.Directional; return true; |
|||
case LightType.Point : gputype = HDPipeline.GPULightType.Point; shadowtype = GPUShadowType.Point; return true; |
|||
default: |
|||
case LightType.Area : gputype = HDPipeline.GPULightType.Rectangle; shadowtype = GPUShadowType.Unknown; return false; // area lights by themselves can't be mapped to any GPU type
|
|||
} |
|||
} |
|||
public static bool MapLightType(LightArchetype la, LightType lt, out GPUShadowType shadowtype) |
|||
{ |
|||
switch (la) |
|||
{ |
|||
case LightArchetype.Punctual: |
|||
return MapLightType(lt, out shadowtype); |
|||
case LightArchetype.Area: |
|||
shadowtype = GPUShadowType.Unknown; |
|||
return true; |
|||
case LightArchetype.Projector: |
|||
shadowtype = GPUShadowType.Unknown; |
|||
return true; |
|||
default: |
|||
shadowtype = GPUShadowType.Unknown; |
|||
return false; // <- probably not what you want
|
|||
} |
|||
|
|||
} |
|||
public static bool MapLightType(LightType lt, out GPUShadowType shadowtype) |
|||
{ |
|||
switch (lt) |
|||
{ |
|||
case LightType.Spot: |
|||
shadowtype = GPUShadowType.Spot; |
|||
return true; |
|||
case LightType.Directional: |
|||
shadowtype = GPUShadowType.Directional; |
|||
return true; |
|||
case LightType.Point: |
|||
shadowtype = GPUShadowType.Point; |
|||
return true; |
|||
default: |
|||
case LightType.Area: |
|||
shadowtype = GPUShadowType.Unknown; |
|||
return false; // area lights by themselves can't be mapped to any GPU type
|
|||
} |
|||
} |
|||
|
|||
public static GPUShadowAlgorithm Pack( ShadowAlgorithm algo, ShadowVariant vari, ShadowPrecision prec ) |
|||
{ |
|||
int precshift = ShadowConstants.Bits.k_ShadowVariant + ShadowConstants.Bits.k_ShadowAlgorithm; |
|||
int algoshift = ShadowConstants.Bits.k_ShadowVariant; |
|||
return (GPUShadowAlgorithm) ( (int) prec << precshift | ((int) algo << algoshift) | (int)vari); |
|||
} |
|||
public static ShadowAlgorithm ExtractAlgorithm( GPUShadowAlgorithm gpuAlgo ) { return (ShadowAlgorithm) ( ShadowConstants.Masks.k_ShadowAlgorithm & ((int)gpuAlgo >> ShadowConstants.Bits.k_ShadowVariant) ); } |
|||
public static ShadowVariant ExtractVariant( GPUShadowAlgorithm gpuAlgo ) { return (ShadowVariant ) ( ShadowConstants.Masks.k_ShadowVariant & (int)gpuAlgo ); } |
|||
public static ShadowPrecision ExtractPrecision( GPUShadowAlgorithm gpuAlgo ) { return (ShadowPrecision) ( ShadowConstants.Masks.k_ShadowPrecision & ((int)gpuAlgo >> (ShadowConstants.Bits.k_ShadowVariant + ShadowConstants.Bits.k_ShadowAlgorithm)) ); } |
|||
public static void Unpack( GPUShadowAlgorithm gpuAlgo, out ShadowAlgorithm algo, out ShadowVariant vari, out ShadowPrecision prec ) |
|||
{ |
|||
algo = ExtractAlgorithm( gpuAlgo ); |
|||
vari = ExtractVariant( gpuAlgo ); |
|||
prec = ExtractPrecision( gpuAlgo ); |
|||
} |
|||
public static GPUShadowAlgorithm ClearPrecision( GPUShadowAlgorithm gpuAlgo ) |
|||
{ |
|||
var algo = ExtractAlgorithm( gpuAlgo ); |
|||
var vari = ExtractVariant( gpuAlgo ); |
|||
return Pack( algo, vari, ShadowPrecision.Low ); |
|||
} |
|||
public static float Asfloat( uint val ) { return System.BitConverter.ToSingle( System.BitConverter.GetBytes( val ), 0 ); } |
|||
public static float Asfloat( int val ) { return System.BitConverter.ToSingle( System.BitConverter.GetBytes( val ), 0 ); } |
|||
public static int Asint( float val ) { return System.BitConverter.ToInt32( System.BitConverter.GetBytes( val ), 0 ); } |
|||
public static uint Asuint( float val ) { return System.BitConverter.ToUInt32( System.BitConverter.GetBytes( val ), 0 ); } |
|||
} |
|||
} // end of namespace UnityEngine.Experimental.ScriptableRenderLoop
|
|
|||
fileFormatVersion: 2 |
|||
guid: d53d8bd422ecef740865c3acd7e2c62b |
|||
timeCreated: 1491321441 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: b6860f4fd5236f648b2c48c6799c68a7 |
|||
timeCreated: 1491321441 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 1c64d27a91e935140a9f402077f52fa0 |
|||
timeCreated: 1477395059 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 6931cfbd757a1864f8822b5399719960 |
|||
timeCreated: 1485511432 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// Various shadow algorithms |
|||
// There are two variants provided, one takes the texture and sampler explicitly so they can be statically passed in. |
|||
// The variant without resource parameters dynamically accesses the texture when sampling. |
|||
|
|||
// function called by spot, point and directional eval routines to calculate shadow coordinates |
|||
float3 EvalShadow_GetTexcoords( ShadowData sd, float3 positionWS ) |
|||
{ |
|||
float4 posCS = mul( float4( positionWS, 1.0 ), sd.worldToShadow ); |
|||
// apply a bias |
|||
posCS.z -= sd.bias; |
|||
float3 posNDC = posCS.xyz / posCS.w; |
|||
// calc TCs |
|||
float3 posTC = posNDC * 0.5 + 0.5; |
|||
posTC.xy = posTC.xy * sd.scaleOffset.xy + sd.scaleOffset.zw; |
|||
#if UNITY_REVERSED_Z |
|||
posTC.z = 1.0 - posTC.z; |
|||
#endif |
|||
return posTC; |
|||
} |
|||
|
|||
// |
|||
// Point shadows |
|||
// |
|||
float EvalShadow_PointDepth( ShadowContext shadowContext, float3 positionWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
int faceIndex = 0; |
|||
GetCubeFaceID( L, faceIndex ); |
|||
ShadowData sd = shadowContext.shadowDatas[index + faceIndex]; |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// sample the texture |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
unpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, texIdx, sampIdx ); |
|||
} |
|||
|
|||
float EvalShadow_PointDepth( ShadowContext shadowContext, Texture2DArray tex, SamplerComparisonState compSamp, float3 positionWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
int faceIndex = 0; |
|||
GetCubeFaceID( L, faceIndex ); |
|||
ShadowData sd = shadowContext.shadowDatas[index + faceIndex]; |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// sample the texture |
|||
float slice; |
|||
unpackShadowmapId( sd.id, slice ); |
|||
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, tex, compSamp ); |
|||
} |
|||
|
|||
|
|||
// |
|||
// Spot shadows |
|||
// |
|||
float EvalShadow_SpotDepth( ShadowContext shadowContext, float3 positionWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
ShadowData sd = shadowContext.shadowDatas[index]; |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// sample the texture |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
unpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, texIdx, sampIdx ); |
|||
} |
|||
|
|||
float EvalShadow_SpotDepth( ShadowContext shadowContext, Texture2DArray tex, SamplerComparisonState compSamp, float3 positionWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
ShadowData sd = shadowContext.shadowDatas[index]; |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// sample the texture |
|||
float slice; |
|||
unpackShadowmapId( sd.id, slice ); |
|||
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, tex, compSamp ); |
|||
} |
|||
|
|||
// |
|||
// Punctual shadows for Point and Spot |
|||
// |
|||
float EvalShadow_PunctualDepth( ShadowContext shadowContext, float3 positionWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
int faceIndex = 0; |
|||
|
|||
[branch] |
|||
if( shadowContext.shadowDatas[index].shadowType == GPUSHADOWTYPE_POINT ) |
|||
GetCubeFaceID( L, faceIndex ); |
|||
|
|||
ShadowData sd = shadowContext.shadowDatas[index + faceIndex]; |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// sample the texture |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
unpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, texIdx, sampIdx ); |
|||
} |
|||
|
|||
float EvalShadow_PunctualDepth( ShadowContext shadowContext, Texture2DArray tex, SamplerComparisonState compSamp, float3 positionWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
int faceIndex = 0; |
|||
|
|||
[branch] |
|||
if( shadowContext.shadowDatas[index].shadowType == GPUSHADOWTYPE_POINT ) |
|||
GetCubeFaceID( L, faceIndex ); |
|||
|
|||
ShadowData sd = shadowContext.shadowDatas[index + faceIndex]; |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// sample the texture |
|||
float slice; |
|||
unpackShadowmapId( sd.id, slice ); |
|||
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, tex, compSamp ); |
|||
} |
|||
|
|||
// |
|||
// Directional shadows (cascaded shadow map) |
|||
// |
|||
uint EvalShadow_GetSplitSphereIndexForDirshadows( float3 positionWS, float4 dirShadowSplitSpheres[4] ) |
|||
{ |
|||
float3 fromCenter0 = positionWS.xyz - dirShadowSplitSpheres[0].xyz; |
|||
float3 fromCenter1 = positionWS.xyz - dirShadowSplitSpheres[1].xyz; |
|||
float3 fromCenter2 = positionWS.xyz - dirShadowSplitSpheres[2].xyz; |
|||
float3 fromCenter3 = positionWS.xyz - dirShadowSplitSpheres[3].xyz; |
|||
float4 distances2 = float4(dot(fromCenter0, fromCenter0), dot(fromCenter1, fromCenter1), dot(fromCenter2, fromCenter2), dot(fromCenter3, fromCenter3)); |
|||
|
|||
float4 dirShadowSplitSphereSqRadii; |
|||
dirShadowSplitSphereSqRadii.x = dirShadowSplitSpheres[0].w; |
|||
dirShadowSplitSphereSqRadii.y = dirShadowSplitSpheres[1].w; |
|||
dirShadowSplitSphereSqRadii.z = dirShadowSplitSpheres[2].w; |
|||
dirShadowSplitSphereSqRadii.w = dirShadowSplitSpheres[3].w; |
|||
|
|||
float4 weights = float4( distances2 < dirShadowSplitSphereSqRadii ); |
|||
weights.yzw = saturate( weights.yzw - weights.xyz ); |
|||
|
|||
return uint( 4.0 - dot( weights, float4(4.0, 3.0, 2.0, 1.0 ) ) ); |
|||
} |
|||
|
|||
void EvalShadow_LoadSplitSpheres( ShadowContext shadowContext, int index, out float4 splitSpheres[4] ) |
|||
{ |
|||
uint offset = GetPayloadOffset( shadowContext.shadowDatas[index] ); |
|||
|
|||
splitSpheres[0] = asfloat( shadowContext.payloads[offset + 0] ); |
|||
splitSpheres[1] = asfloat( shadowContext.payloads[offset + 1] ); |
|||
splitSpheres[2] = asfloat( shadowContext.payloads[offset + 2] ); |
|||
splitSpheres[3] = asfloat( shadowContext.payloads[offset + 3] ); |
|||
} |
|||
|
|||
float EvalShadow_CascadedDepth( ShadowContext shadowContext, float3 positionWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
float4 dirShadowSplitSpheres[4]; |
|||
EvalShadow_LoadSplitSpheres( shadowContext, index, dirShadowSplitSpheres ); |
|||
uint shadowSplitIndex = EvalShadow_GetSplitSphereIndexForDirshadows( positionWS, dirShadowSplitSpheres ); |
|||
ShadowData sd = shadowContext.shadowDatas[index + shadowSplitIndex]; |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
|
|||
// sample the texture |
|||
uint texIdx, sampIdx; |
|||
float slice; |
|||
unpackShadowmapId( sd.id, texIdx, sampIdx, slice ); |
|||
|
|||
return SampleShadow_PCF_9tap_Adaptive( shadowContext, sd.texelSizeRcp, posTC, slice, texIdx, sampIdx ); |
|||
} |
|||
|
|||
float EvalShadow_CascadedDepth( ShadowContext shadowContext, Texture2DArray tex, SamplerComparisonState compSamp, float3 positionWS, int index, float3 L ) |
|||
{ |
|||
// load the right shadow data for the current face |
|||
float4 dirShadowSplitSpheres[4]; |
|||
EvalShadow_LoadSplitSpheres( shadowContext, index, dirShadowSplitSpheres ); |
|||
uint shadowSplitIndex = EvalShadow_GetSplitSphereIndexForDirshadows( positionWS, dirShadowSplitSpheres ); |
|||
ShadowData sd = shadowContext.shadowDatas[index + shadowSplitIndex]; |
|||
// get shadowmap texcoords |
|||
float3 posTC = EvalShadow_GetTexcoords( sd, positionWS ); |
|||
// sample the texture |
|||
float slice; |
|||
unpackShadowmapId(sd.id, slice); |
|||
|
|||
return SampleShadow_PCF_9tap_Adaptive( shadowContext, sd.texelSizeRcp, posTC, slice, tex, compSamp ); |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9900a5b8191991b4d9e2c37413d85dc3 |
|||
timeCreated: 1485511902 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 1163a3730c1812748b5cc5a7ecfbaf0c |
|||
timeCreated: 1485511901 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 68d59da52ffb57240bdf73300a2736bf |
|||
timeCreated: 1485788693 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 0998db889743f994b8ea4257f9ab33fa |
|||
timeCreated: 1485511431 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 4091aef5166b0624db069f6dbfd0673a |
|||
timeCreated: 1485511901 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 1c09a112d6337c7468843f1d64d7795f |
|||
timeCreated: 1485511901 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 32c86a80860fd014ba44f8b7a7914a5c |
|||
timeCreated: 1487253249 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
|
|||
|
|||
// shadow lookup routines when dynamic array access is possible |
|||
#if SHADOW_SUPPORTS_DYNAMIC_INDEXING != 0 |
|||
|
|||
// Shader model >= 5.1 |
|||
# define SHADOW_DEFINE_SAMPLING_FUNCS( _Tex2DArraySlots, _TexCubeArraySlots ) \ |
|||
float4 SampleCompShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float slice ) { return SAMPLE_TEXTURE2D_ARRAY_SHADOW( ctxt.tex2DArray[texIdx], ctxt.compSamplers[sampIdx], tcs, slice ); } \ |
|||
float4 SampleShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float2 tcs, float slice, float lod = 0.0 ) { return SAMPLE_TEXTURE2D_ARRAY_LOD( ctxt.tex2DArray[texIdx], ctxt.samplers[sampIdx], tcs, slice, lod ); } \ |
|||
float4 SampleCompShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float4 tcs, float cubeIdx ) { return SAMPLE_TEXTURECUBE_ARRAY_SHADOW( ctxt.texCubeArray[texIdx], ctxt.compSamplers[sampIdx], tcs, cubeIdx );} \ |
|||
float4 SampleShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float cubeIdx, float lod = 0.0 ) { return SAMPLE_TEXTURECUBE_ARRAY_LOD( ctxt.texCubeArray[texIdx], ctxt.samplers[sampIdx], tcs, cubeIdx, lod ); } |
|||
|
|||
|
|||
#else // helper macros if dynamic indexing does not work |
|||
|
|||
|
|||
// Sampler and texture combinations are static. No shadowmap will ever be sampled with two different samplers. |
|||
// Once shadowmaps and samplers are fixed consider writing custom dispatchers directly accessing textures and samplers. |
|||
# define SHADOW_DEFINE_SAMPLING_FUNCS( _Tex2DArraySlots, _TexCubeArraySlots, _SamplerCompSlots, _SamplerSlots ) \ |
|||
\ |
|||
float4 SampleCompShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float slice ) \ |
|||
{ \ |
|||
[unroll] for( uint i = 0; i < _Tex2DArraySlots; i++ ) \ |
|||
{ \ |
|||
[unroll] for( uint j = 0; j < _SamplerCompSlots; j++ ) \ |
|||
{ \ |
|||
[branch] if( i == texIdx && j == sampIdx ) \ |
|||
{ \ |
|||
return SAMPLE_TEXTURE2D_ARRAY_SHADOW( ctxt.tex2DArray[i], ctxt.compSamplers[j], tcs, slice ); \ |
|||
} \ |
|||
} \ |
|||
} \ |
|||
return 1.0; \ |
|||
} \ |
|||
\ |
|||
float4 SampleShadow_T2DA( ShadowContext ctxt, uint texIdx, uint sampIdx, float2 tcs, float slice, float lod = 0.0 ) \ |
|||
{ \ |
|||
[unroll] for( uint i = 0; i < _Tex2DArraySlots; i++ ) \ |
|||
{ \ |
|||
[unroll] for( uint j = 0; j < _SamplerSlots; j++ ) \ |
|||
{ \ |
|||
[branch] if( i == texIdx && j == sampIdx ) \ |
|||
{ \ |
|||
return SAMPLE_TEXTURE2D_ARRAY_LOD( ctxt.tex2DArray[i], ctxt.samplers[j], tcs, slice, lod ); \ |
|||
} \ |
|||
} \ |
|||
} \ |
|||
return 1.0; \ |
|||
} \ |
|||
\ |
|||
float4 SampleCompShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float4 tcs, float cubeIdx ) \ |
|||
{ \ |
|||
[unroll] for( uint i = 0; i < _TexCubeArraySlots; i++ ) \ |
|||
{ \ |
|||
[unroll] for( uint j = 0; j < _SamplerCompSlots; j++ ) \ |
|||
{ \ |
|||
[branch] if( i == texIdx && j == sampIdx ) \ |
|||
{ \ |
|||
return SAMPLE_TEXTURECUBE_ARRAY_SHADOW( ctxt.texCubeArray[i], ctxt.compSamplers[j], tcs, cubeIdx ); \ |
|||
} \ |
|||
} \ |
|||
} \ |
|||
return 1.0; \ |
|||
} \ |
|||
\ |
|||
float4 SampleShadow_TCA( ShadowContext ctxt, uint texIdx, uint sampIdx, float3 tcs, float cubeIdx, float lod = 0.0 ) \ |
|||
{ \ |
|||
[unroll] for( uint i = 0; i < _TexCubeArraySlots; i++ ) \ |
|||
{ \ |
|||
[unroll] for( uint j = 0; j < _SamplerSlots; j++ ) \ |
|||
{ \ |
|||
[branch] if( i == texIdx && j == sampIdx ) \ |
|||
{ \ |
|||
return SAMPLE_TEXTURECUBE_ARRAY_LOD( ctxt.texCubeArray[i], ctxt.samplers[j], tcs, cubeIdx, lod ); \ |
|||
} \ |
|||
} \ |
|||
} \ |
|||
return 1.0; \ |
|||
} |
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 2ac0d1cc115e6ec42b5c47d2ee13f139 |
|||
timeCreated: 1485873843 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 99dfd76ad655ff441aef9bb0015a1f05 |
|||
timeCreated: 1485511433 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: f5c1ec8ec44960d4bbf72eafaf47d8fd |
|||
timeCreated: 1485511435 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class ShadowUtils |
|||
{ |
|||
public static Matrix4x4 ExtractSpotLightMatrix(VisibleLight vl, out Matrix4x4 view, out Matrix4x4 proj, out Vector4 lightDir, out ShadowSplitData splitData) |
|||
{ |
|||
splitData = new ShadowSplitData(); |
|||
splitData.cullingSphere.Set(0.0f, 0.0f, 0.0f, float.NegativeInfinity); |
|||
splitData.cullingPlaneCount = 0; |
|||
// get lightDir
|
|||
lightDir = vl.light.transform.forward; |
|||
// calculate view
|
|||
Matrix4x4 scaleMatrix = Matrix4x4.identity; |
|||
scaleMatrix.m22 = -1.0f; |
|||
view = scaleMatrix * vl.localToWorld.inverse; |
|||
// following code is from SharedLightData::GetNearPlaneMinBound
|
|||
float percentageBound = 0.01f * vl.light.range; |
|||
float fixedBound = 0.1f; |
|||
float nearmin = fixedBound <= percentageBound ? fixedBound : percentageBound; |
|||
// calculate projection
|
|||
float zfar = vl.range; |
|||
float znear = vl.light.shadowNearPlane >= nearmin ? vl.light.shadowNearPlane : nearmin; |
|||
float fov = vl.spotAngle; |
|||
proj = Matrix4x4.Perspective(fov, 1.0f, znear, zfar); |
|||
// and the compound
|
|||
return proj * view; |
|||
} |
|||
|
|||
public static Matrix4x4 ExtractPointLightMatrix(VisibleLight vl, uint faceIdx, float fovBias, out Matrix4x4 view, out Matrix4x4 proj, out Vector4 lightDir, out ShadowSplitData splitData, CullResults cullResults, int lightIndex) |
|||
{ |
|||
Debug.Assert(faceIdx <= (uint)CubemapFace.NegativeZ, "Tried to extract cubemap face " + faceIdx + "."); |
|||
|
|||
splitData = new ShadowSplitData(); |
|||
splitData.cullingSphere.Set(0.0f, 0.0f, 0.0f, float.NegativeInfinity); |
|||
splitData.cullingPlaneCount = 0; |
|||
// get lightDir
|
|||
lightDir = vl.light.transform.forward; |
|||
// TODO: At some point this logic should be moved to C#, then the parameters cullResults and lightIndex can be removed as well
|
|||
cullResults.ComputePointShadowMatricesAndCullingPrimitives(lightIndex, (CubemapFace)faceIdx, fovBias, out view, out proj, out splitData); |
|||
// and the compound
|
|||
return proj * view; |
|||
} |
|||
|
|||
public static Matrix4x4 ExtractDirectionalLightMatrix(VisibleLight vl, uint cascadeIdx, int cascadeCount, Vector3 splitRatio, float nearPlaneOffset, uint width, uint height, out Matrix4x4 view, out Matrix4x4 proj, out Vector4 lightDir, out ShadowSplitData splitData, CullResults cullResults, int lightIndex) |
|||
{ |
|||
Debug.Assert(width == height, "Currently the cascaded shadow mapping code requires square cascades."); |
|||
splitData = new ShadowSplitData(); |
|||
splitData.cullingSphere.Set(0.0f, 0.0f, 0.0f, float.NegativeInfinity); |
|||
splitData.cullingPlaneCount = 0; |
|||
// get lightDir
|
|||
lightDir = vl.light.transform.forward; |
|||
// TODO: At some point this logic should be moved to C#, then the parameters cullResults and lightIndex can be removed as well
|
|||
// For directional lights shadow data is extracted from the cullResults, so that needs to be somehow provided here.
|
|||
// Check ScriptableShadowsUtility.cpp ComputeDirectionalShadowMatricesAndCullingPrimitives(...) for details.
|
|||
cullResults.ComputeDirectionalShadowMatricesAndCullingPrimitives(lightIndex, (int)cascadeIdx, cascadeCount, splitRatio, (int)width, nearPlaneOffset, out view, out proj, out splitData); |
|||
// and the compound
|
|||
return proj * view; |
|||
} |
|||
|
|||
public static bool MapLightType(LightType lt, AdditionalLightData ald, out GPULightType gputype, out GPUShadowType shadowtype) |
|||
{ |
|||
shadowtype = GPUShadowType.Unknown; // Default for all non-punctual lights
|
|||
gputype = GPULightType.Spot; |
|||
|
|||
switch (ald.archetype) |
|||
{ |
|||
case LightArchetype.Punctual: return MapLightType(lt, out gputype, out shadowtype); |
|||
case LightArchetype.Area: gputype = (ald.lightWidth > 0) ? GPULightType.Rectangle : GPULightType.Line; return true; |
|||
case LightArchetype.Projector: |
|||
switch (lt) |
|||
{ |
|||
case LightType.Directional: gputype = GPULightType.ProjectorOrtho; return true; |
|||
case LightType.Spot: gputype = GPULightType.ProjectorPyramid; return true; |
|||
default: Debug.Assert(false, "Projectors can only be Spot or Directional lights."); return false; |
|||
} |
|||
default: return false; // <- probably not what you want
|
|||
} |
|||
} |
|||
|
|||
public static bool MapLightType(LightType lt, out GPULightType gputype, out GPUShadowType shadowtype) |
|||
{ |
|||
switch (lt) |
|||
{ |
|||
case LightType.Spot: gputype = GPULightType.Spot; shadowtype = GPUShadowType.Spot; return true; |
|||
case LightType.Directional: gputype = GPULightType.Directional; shadowtype = GPUShadowType.Directional; return true; |
|||
case LightType.Point: gputype = GPULightType.Point; shadowtype = GPUShadowType.Point; return true; |
|||
default: |
|||
case LightType.Area: gputype = GPULightType.Rectangle; shadowtype = GPUShadowType.Unknown; return false; // area lights by themselves can't be mapped to any GPU type
|
|||
} |
|||
} |
|||
|
|||
public static float Asfloat(uint val) { return System.BitConverter.ToSingle(System.BitConverter.GetBytes(val), 0); } |
|||
public static int Asint(float val) { return System.BitConverter.ToInt32(System.BitConverter.GetBytes(val), 0); } |
|||
public static uint Asuint(float val) { return System.BitConverter.ToUInt32(System.BitConverter.GetBytes(val), 0); } |
|||
} |
|||
} // end of namespace UnityEngine.Experimental.ScriptableRenderLoop
|
|
|||
fileFormatVersion: 2 |
|||
guid: 8944ea3d2dfa541578ffc26bbdd626ed |
|||
folderAsset: yes |
|||
timeCreated: 1467147697 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Assets/TestScenes/HDTest/GraphicTest/SSS/head.OBJ
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 2b46db496f27398459cf881becf5763a |
|||
timeCreated: 1493400806 |
|||
licenseType: Pro |
|||
ModelImporter: |
|||
serializedVersion: 20 |
|||
fileIDToRecycleName: |
|||
100000: Group12 |
|||
100002: Group14 |
|||
100004: Group19 |
|||
100006: Group2 |
|||
100008: Group24 |
|||
100010: Group26 |
|||
100012: Group28 |
|||
100014: Group33 |
|||
100016: Group35 |
|||
100018: Group39 |
|||
100020: Group4 |
|||
100022: Group5 |
|||
100024: Group7 |
|||
100026: //RootNode |
|||
400000: Group12 |
|||
400002: Group14 |
|||
400004: Group19 |
|||
400006: Group2 |
|||
400008: Group24 |
|||
400010: Group26 |
|||
400012: Group28 |
|||
400014: Group33 |
|||
400016: Group35 |
|||
400018: Group39 |
|||
400020: Group4 |
|||
400022: Group5 |
|||
400024: Group7 |
|||
400026: //RootNode |
|||
2300000: Group12 |
|||
2300002: Group14 |
|||
2300004: Group19 |
|||
2300006: Group2 |
|||
2300008: Group24 |
|||
2300010: Group26 |
|||
2300012: Group28 |
|||
2300014: Group33 |
|||
2300016: Group35 |
|||
2300018: Group39 |
|||
2300020: Group4 |
|||
2300022: Group5 |
|||
2300024: Group7 |
|||
3300000: Group12 |
|||
3300002: Group14 |
|||
3300004: Group19 |
|||
3300006: Group2 |
|||
3300008: Group24 |
|||
3300010: Group26 |
|||
3300012: Group28 |
|||
3300014: Group33 |
|||
3300016: Group35 |
|||
3300018: Group39 |
|||
3300020: Group4 |
|||
3300022: Group5 |
|||
3300024: Group7 |
|||
4300000: Group12 |
|||
4300002: Group14 |
|||
4300004: Group19 |
|||
4300006: Group2 |
|||
4300008: Group24 |
|||
4300010: Group26 |
|||
4300012: Group28 |
|||
4300014: Group33 |
|||
4300016: Group35 |
|||
4300018: Group39 |
|||
4300020: Group4 |
|||
4300022: Group5 |
|||
4300024: Group7 |
|||
materials: |
|||
importMaterials: 1 |
|||
materialName: 0 |
|||
materialSearch: 1 |
|||
animations: |
|||
legacyGenerateAnimations: 4 |
|||
bakeSimulation: 0 |
|||
resampleCurves: 1 |
|||
optimizeGameObjects: 0 |
|||
motionNodeName: |
|||
rigImportErrors: |
|||
rigImportWarnings: |
|||
animationImportErrors: |
|||
animationImportWarnings: |
|||
animationRetargetingWarnings: |
|||
animationDoRetargetingWarnings: 0 |
|||
animationCompression: 1 |
|||
animationRotationError: 0.5 |
|||
animationPositionError: 0.5 |
|||
animationScaleError: 0.5 |
|||
animationWrapMode: 0 |
|||
extraExposedTransformPaths: [] |
|||
clipAnimations: [] |
|||
isReadable: 1 |
|||
meshes: |
|||
lODScreenPercentages: [] |
|||
globalScale: 1 |
|||
meshCompression: 0 |
|||
addColliders: 0 |
|||
importVisibility: 0 |
|||
importBlendShapes: 1 |
|||
importCameras: 1 |
|||
importLights: 1 |
|||
swapUVChannels: 0 |
|||
generateSecondaryUV: 0 |
|||
useFileUnits: 1 |
|||
optimizeMeshForGPU: 1 |
|||
keepQuads: 0 |
|||
weldVertices: 1 |
|||
secondaryUVAngleDistortion: 8 |
|||
secondaryUVAreaDistortion: 15.000001 |
|||
secondaryUVHardAngle: 88 |
|||
secondaryUVPackMargin: 4 |
|||
useFileScale: 1 |
|||
tangentSpace: |
|||
normalSmoothAngle: 60 |
|||
normalImportMode: 0 |
|||
tangentImportMode: 3 |
|||
normalCalculationMode: 4 |
|||
importAnimation: 1 |
|||
copyAvatar: 0 |
|||
humanDescription: |
|||
serializedVersion: 2 |
|||
human: [] |
|||
skeleton: [] |
|||
armTwist: 0.5 |
|||
foreArmTwist: 0.5 |
|||
upperLegTwist: 0.5 |
|||
legTwist: 0.5 |
|||
armStretch: 0.05 |
|||
legStretch: 0.05 |
|||
feetSpacing: 0 |
|||
rootMotionBoneName: |
|||
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
hasTranslationDoF: 0 |
|||
hasExtraRoot: 0 |
|||
skeletonHasParents: 1 |
|||
lastHumanDescriptionAvatarSource: {instanceID: 0} |
|||
animationType: 0 |
|||
humanoidOversampling: 1 |
|||
additionalBone: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue