浏览代码

Update #includes of ShaderLibrary to new path

/sample_game
Peter Bay Bastian 7 年前
当前提交
a1133cd9
共有 42 个文件被更改,包括 116 次插入116 次删除
  1. 2
      Assets/ScriptableRenderPipeline/Core/ShaderLibrary/SampleUVMapping.hlsl
  2. 12
      Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Resources/ShadowBlurMoments.compute
  3. 2
      Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl
  4. 6
      Assets/ScriptableRenderPipeline/Core/Shadow/Resources/DebugDisplayShadowMap.shader
  5. 16
      Assets/ScriptableRenderPipeline/Fptl/LightingTemplate.hlsl
  6. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader
  7. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader
  8. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader
  9. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader
  10. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/ScreenSpaceAmbientOcclusion.shader
  11. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader
  12. 12
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
  13. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Deferred.compute
  14. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute
  15. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute
  16. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute
  17. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/materialflags.compute
  18. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute
  19. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  20. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  21. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  22. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
  23. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
  24. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineLighting.shader
  25. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CopyStencilBuffer.shader
  26. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/PreIntegratedFGD.shader
  27. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute
  28. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.shader
  29. 16
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl
  30. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader
  31. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/CameraMotionVectors.shader
  32. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawSssProfile.shader
  33. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader
  34. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl
  35. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader
  36. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute
  37. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute
  38. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader
  39. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader
  40. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader
  41. 32
      Assets/ScriptableRenderPipeline/OnTileDeferredPipeline/Shaders/LightingTemplate.hlsl
  42. 22
      Assets/ScriptableRenderPipeline/OnTileDeferredPipeline/Shaders/UnityStandardForwardMobile.cginc

2
Assets/ScriptableRenderPipeline/Core/ShaderLibrary/SampleUVMapping.hlsl


// This structure abstract uv mapping inside one struct.
// It represent a mapping of any uv (with its associated tangent space for derivative if SurfaceGradient mode) - UVSet0 to 4, planar, triplanar
#include "ShaderLibrary/NormalSurfaceGradient.hlsl"
#include "Core/ShaderLibrary/NormalSurfaceGradient.hlsl"
#define UV_MAPPING_UVSET 0
#define UV_MAPPING_PLANAR 1

12
Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Resources/ShadowBlurMoments.compute


#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"
#include "Core/ShaderLibrary/common.hlsl"
#include "Core/ShaderLibrary/Shadow/ShadowMoments.hlsl"
#define BLUR_BORDER (BLUR_SIZE / 2)
#define LDS_SIZE (THREADS + BLUR_BORDER + BLUR_BORDER)

}
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.

avgMoments = DepthToMoments( reverse_z ? (1.0-depth) : depth );
#endif
moments[ldsIdx.y][ldsIdx.x] = avgMoments;
ldsIdx.x += threadsCnt.x;
srcIdx.x += threadsCnt.x;
}

if( ldsIdx.y < ldsSize.y )
moments[ldsIdx.y][ldsIdx.x] = hblurredMoment2;
GroupMemoryBarrierWithGroupSync();
// second pass blurs vertically
ldsIdx = groupThreadId.xy + blurBorder.xx;

dispatchId.xy += dstRect.xy;
outputTex[dispatchId] = vblurredMoment;
}
}
}

2
Assets/ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl


#define SHADOW_SUPPORTS_DYNAMIC_INDEXING 0 // only on >= sm 5.1
#include "../../Core/Shadow/ShadowBase.cs.hlsl" // ShadowData definition, auto generated (don't modify)
#include "../../../Core/Shadow/ShadowBase.cs.hlsl" // ShadowData definition, auto generated (don't modify)
#include "ShadowTexFetch.hlsl" // Resource sampling definitions (don't modify)
// Declares a shadow context struct with members and sampling code based on whether _...Slots > 0

6
Assets/ScriptableRenderPipeline/Core/Shadow/Resources/DebugDisplayShadowMap.shader


#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: unitl we go futher in dev
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../Core/ShaderLibrary/Common.hlsl"
float4 _TextureScaleBias;
float _TextureSlice;

#pragma vertex Vert
#pragma fragment FragRegular
float4 FragRegular(Varyings input) : SV_Target
{
return saturate( (SAMPLE_TEXTURE2D_ARRAY(_AtlasTexture, ltc_linear_clamp_sampler, input.texcoord, _TextureSlice).x - _ValidRange.x) * _ValidRange.y ).xxxx;

#pragma vertex Vert
#pragma fragment FragVariance
float4 FragVariance(Varyings input) : SV_Target
{
return saturate((SAMPLE_TEXTURE2D_ARRAY(_AtlasTexture, ltc_linear_clamp_sampler, input.texcoord, _TextureSlice).x - _ValidRange.x) * _ValidRange.y).xxxx;

16
Assets/ScriptableRenderPipeline/Fptl/LightingTemplate.hlsl


#define SHADOW_FPTL
# if defined(SHADER_API_D3D11)
# include "../ShaderLibrary/API/D3D11.hlsl"
# include "../Core/ShaderLibrary/API/D3D11.hlsl"
# include "../ShaderLibrary/API/PSSL.hlsl"
# include "../Core/ShaderLibrary/API/PSSL.hlsl"
# include "../ShaderLibrary/API/D3D11.hlsl"
# include "../ShaderLibrary/API/D3D11_1.hlsl"
# include "../Core/ShaderLibrary/API/D3D11.hlsl"
# include "../Core/ShaderLibrary/API/D3D11_1.hlsl"
# include "../ShaderLibrary/API/Metal.hlsl"
# include "../Core/ShaderLibrary/API/Metal.hlsl"
# include "../ShaderLibrary/API/Validate.hlsl"
# include "../ShaderLibrary/Shadow/Shadow.hlsl"
# include "../Core/ShaderLibrary/API/Validate.hlsl"
# include "../Core/ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_FPTL
CBUFFER_START(ShadowLightData)

float shadow = GetDirectionalShadowAttenuation(shadowContext, vPw, 0.0.xxx, shadowIdx, normalize(light.dir.xyz));
atten *= shadow;
}
light.color.xyz = lightData.color.xyz * atten;
ints += EvalMaterial(light, ind);

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
TEXTURECUBE(_InputCubemap);
SAMPLERCUBE(sampler_InputCubemap);

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../Debug/DebugDisplay.cs.hlsl"
#include "../ShaderVariables.hlsl"

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/Color.hlsl"
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/Color.hlsl"
// CAUTION: In case deferred lighting need to support various lighting model statically, we will require to do multicompile with different define like UNITY_MATERIAL_LIT
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/Common.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),

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/ScreenSpaceAmbientOcclusion.shader


{
HLSLINCLUDE
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../Core/ShaderLibrary/Common.hlsl"
#include "../../ShaderVariables.hlsl"
#define UNITY_MATERIAL_LIT // Needs to be defined before including Material.hlsl

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../ShaderLibrary/Common.hlsl"
#include "../../Core/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

12
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl


#ifndef UNITY_LIGHTING_INCLUDED
#define UNITY_LIGHTING_INCLUDED
#include "../../ShaderLibrary/CommonLighting.hlsl"
#include "../../ShaderLibrary/CommonShadow.hlsl"
#include "../../ShaderLibrary/Sampling.hlsl"
#include "../../ShaderLibrary/AreaLighting.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../Core/ShaderLibrary/CommonLighting.hlsl"
#include "../../Core/ShaderLibrary/CommonShadow.hlsl"
#include "../../Core/ShaderLibrary/Sampling.hlsl"
#include "../../Core/ShaderLibrary/AreaLighting.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
// The light loop (or lighting architecture) is in charge to:
// - Define light list

#include "../Lighting/LightUtilities.hlsl"
#define SHADOW_TILEPASS
#include "../../ShaderLibrary/Shadow/Shadow.hlsl"
#include "../../Core/ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_TILEPASS
#if defined(LIGHTLOOP_SINGLE_PASS) || defined(LIGHTLOOP_TILE_PASS)

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Deferred.compute


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../Core/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

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute


#pragma kernel BigTileLightListGen
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "TilePass.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"
#include "SortingComputeUtils.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute


#pragma kernel TileLightListGen_DepthRT_MSAA_SrcBigTile LIGHTLISTGEN=TileLightListGen_DepthRT_MSAA_SrcBigTile ENABLE_DEPTH_TEXTURE_BACKPLANE MSAA_ENABLED USE_TWO_PASS_TILED_LIGHTING
#pragma kernel ClearAtomic
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute


//#pragma #pragma enable_d3d11_debug_symbols
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/materialflags.compute


// #pragma enable_d3d11_debug_symbols
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute


#pragma kernel ScreenBoundsAABB
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "TilePass.cs.hlsl"
uniform int g_isOrthographic;

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


_LayerMaskMap("LayerMaskMap", 2D) = "white" {}
_LayerInfluenceMaskMap("LayerInfluenceMaskMap", 2D) = "white" {}
[ToggleOff] _UseHeightBasedBlend("UseHeightBasedBlend", Float) = 0.0
_HeightOffset0("Height Offset0", Float) = 0
_HeightOffset1("Height Offset1", Float) = 0
_HeightOffset2("Height Offset2", Float) = 0

// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../ShaderLibrary/Wind.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../ShaderLibrary/Wind.hlsl"
#include "../../../ShaderLibrary/tessellation.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "../../../Core/ShaderLibrary/tessellation.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../ShaderLibrary/Wind.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


//-------------------------------------------------------------------------------------
// Fill SurfaceData/Builtin data function
//-------------------------------------------------------------------------------------
#include "ShaderLibrary/SampleUVMapping.hlsl"
#include "Core/ShaderLibrary/SampleUVMapping.hlsl"
#include "../MaterialUtilities.hlsl"

return SAMPLE_TEXTURE2D_LOD(_HeightMap, sampler_HeightMap, param.uv + texOffsetCurrent, lod).r;
}
#include "ShaderLibrary/PerPixelDisplacement.hlsl"
#include "Core/ShaderLibrary/PerPixelDisplacement.hlsl"
float ApplyPerPixelDisplacement(FragInputs input, float3 V, inout LayerTexCoord layerTexCoord)
{

#endif
}
#include "ShaderLibrary/PerPixelDisplacement.hlsl"
#include "Core/ShaderLibrary/PerPixelDisplacement.hlsl"
// PPD is affecting only one mapping at the same time, mean we need to execute it for each mapping (UV0, UV1, 3 times for triplanar etc..)
// We chose to not support all this case that are extremely hard to manage (for example mixing different mapping, mean it also require different tangent space that is not supported in Unity)

#endif
blendMasks = ApplyHeightBlend(heights, blendMasks);
#endif
#endif
// If no heightmap is set on any layer, we don't need to try and blend them based on height...
#endif

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../ShaderLibrary/Wind.hlsl"
#include "../../../ShaderLibrary/tessellation.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "../../../Core/ShaderLibrary/tessellation.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineLighting.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../../../ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
TEXTURE2D(_IrradianceSource);

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CopyStencilBuffer.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../../../ShaderLibrary/Packing.hlsl"
#include "../../../../Core/ShaderLibrary/Packing.hlsl"
#include "../../../ShaderVariables.hlsl"
#include "../../../Lighting/LightDefinition.cs.hlsl"

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/PreIntegratedFGD.shader


#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go further in dev
#include "../../../../ShaderLibrary/Common.hlsl"
#include "../../../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../../ShaderVariables.hlsl"
struct Attributes

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute


// Included headers
//--------------------------------------------------------------------------------------------------
#include "../../../../ShaderLibrary/Packing.hlsl"
#include "../../../../ShaderLibrary/SpaceFillingCurves.hlsl"
#include "../../../../Core/ShaderLibrary/Packing.hlsl"
#include "../../../../Core/ShaderLibrary/SpaceFillingCurves.hlsl"
#include "../../../ShaderVariables.hlsl"
#define UNITY_MATERIAL_LIT
#include "../../../Material/Material.hlsl"

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../../ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../ShaderVariables.hlsl"
#define UNITY_MATERIAL_LIT // Needs to be defined before including Material.hlsl
#include "../../../Material/Material.hlsl"

return float4(bsdfData.diffuseColor * sampleIrradiance, 1);
#endif
}
#if SSS_DEBUG_LOD
return float4(0.5, 0.5, 0, 1);
#endif

16
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl


#ifndef UNITY_MATERIAL_INCLUDED
#define UNITY_MATERIAL_INCLUDED
#include "../../ShaderLibrary/Color.hlsl"
#include "../../ShaderLibrary/Packing.hlsl"
#include "../../ShaderLibrary/BSDF.hlsl"
#include "../../ShaderLibrary/Debug.hlsl"
#include "../../ShaderLibrary/GeometricTools.hlsl"
#include "../../ShaderLibrary/CommonMaterial.hlsl"
#include "../../ShaderLibrary/EntityLighting.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../Core/ShaderLibrary/Color.hlsl"
#include "../../Core/ShaderLibrary/Packing.hlsl"
#include "../../Core/ShaderLibrary/BSDF.hlsl"
#include "../../Core/ShaderLibrary/Debug.hlsl"
#include "../../Core/ShaderLibrary/GeometricTools.hlsl"
#include "../../Core/ShaderLibrary/CommonMaterial.hlsl"
#include "../../Core/ShaderLibrary/EntityLighting.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
//-----------------------------------------------------------------------------
// BuiltinData

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "../../ShaderVariables.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/CameraMotionVectors.shader


#pragma target 4.5
#include "../../ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../ShaderVariables.hlsl"
#include "../ShaderPass/FragInputs.hlsl"
#include "../ShaderPass/VaryingMesh.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawSssProfile.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../Core/ShaderLibrary/Common.hlsl"
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "../../ShaderVariables.hlsl"
#ifdef SSS_MODEL_BASIC

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../ShaderLibrary/CommonMaterial.hlsl"
#include "../../../ShaderLibrary/Common.hlsl"
#include "../../../Core/ShaderLibrary/CommonMaterial.hlsl"
#include "../../../Core/ShaderLibrary/Common.hlsl"
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "../../ShaderVariables.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl


#error SHADERPASS_is_not_correctly_define
#endif
#include "ShaderLibrary/Color.hlsl"
#include "Core/ShaderLibrary/Color.hlsl"
CBUFFER_START(UnityMetaPass)
// x = use uv1 as raster position

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader


#pragma fragment frag
#pragma target 4.5
#include "../../ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/Common.hlsl"
TEXTURECUBE(_MainTex);
SAMPLERCUBE(sampler_MainTex);

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute


// Ref: PBRT v3, 13.6.7 "Piecewise-Constant 2D Distributions".
// Note that we use the equiareal sphere-to-square mapping instead of the latitude-longitude one.
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
/* --- Input --- */

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute


// Precomputes data for IntegrateLD(). See that function for a detailed description.
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#ifdef SHADER_API_MOBILE
#define MAX_IBL_SAMPLE_CNT 34

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../ShaderLibrary/Common.hlsl"
#include "../../ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "SkyManager.cs.hlsl"
struct Attributes

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader


#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go further in dev
#include "../../../../ShaderLibrary/Color.hlsl"
#include "../../../../ShaderLibrary/Common.hlsl"
#include "../../../../ShaderLibrary/CommonLighting.hlsl"
#include "../../../../Core/ShaderLibrary/Color.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/CommonLighting.hlsl"
TEXTURECUBE(_Cubemap);
SAMPLERCUBE(sampler_Cubemap);

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader


#pragma multi_compile _ ATMOSPHERICS_DEBUG
#pragma multi_compile _ PERFORM_SKY_OCCLUSION_TEST
#include "../../../../ShaderLibrary/Color.hlsl"
#include "../../../../ShaderLibrary/Common.hlsl"
#include "../../../../ShaderLibrary/CommonLighting.hlsl"
#include "../../../../Core/ShaderLibrary/Color.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/CommonLighting.hlsl"
TEXTURECUBE(_Cubemap);
SAMPLERCUBE(sampler_Cubemap);

32
Assets/ScriptableRenderPipeline/OnTileDeferredPipeline/Shaders/LightingTemplate.hlsl


#define SHADOW_FPTL
# if defined(SHADER_API_D3D11)
# include "../../ShaderLibrary/API/D3D11.hlsl"
# include "../../Core/ShaderLibrary/API/D3D11.hlsl"
# include "../../ShaderLibrary/API/PSSL.hlsl"
# include "../../Core/ShaderLibrary/API/PSSL.hlsl"
# include "../../ShaderLibrary/API/D3D11.hlsl"
# include "../../ShaderLibrary/API/D3D11_1.hlsl"
# include "../../Core/ShaderLibrary/API/D3D11.hlsl"
# include "../../Core/ShaderLibrary/API/D3D11_1.hlsl"
# include "../../ShaderLibrary/API/Metal.hlsl"
# include "../../Core/ShaderLibrary/API/Metal.hlsl"
# include "../../ShaderLibrary/API/Validate.hlsl"
# include "../../ShaderLibrary/Shadow/Shadow.hlsl"
# include "../../Core/ShaderLibrary/API/Validate.hlsl"
# include "../../Core/ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_FPTL
UNITY_DECLARE_DEPTH_TEXTURE(_CameraGBufferZ);

{
float4 vpos;
float3 wpos;
float2 uv;
float2 uv;
OnChipDeferredFragSetup(i, uv, vpos, wpos, depth);
OnChipDeferredFragSetup(i, uv, vpos, wpos, depth);
#if defined (SPOT)
#if defined (SPOT)
float3 tolight = _LightPos.xyz - wpos;
half3 lightDir = normalize (tolight);
float dist = length(tolight);

if (_LightIndexForShadowMatrixArray >= 0)
atten *= GetPunctualShadowAttenuation(shadowContext, wpos, 0.0.xxx, _LightIndexForShadowMatrixArray, float4(lightDir, dist));
// directional light case
// directional light case
#elif defined (DIRECTIONAL) || defined (DIRECTIONAL_COOKIE)
half3 lightDir = -_LightDir.xyz;
float atten = 1.0;

atten *= colorCookie.w;
#endif //DIRECTIONAL_COOKIE
// point light case
// point light case
float att = dot(tolight, tolight) * _LightPos.w;
float atten = tex2D (_LightTextureB0, att.rr).UNITY_ATTEN_CHANNEL;

colorCookie.xyz = 1;
}
atten *= colorCookie.w;
#endif //POINT_COOKIE
#endif //POINT_COOKIE
#else
half3 lightDir = 0;
float atten = 0;

ind.diffuse = 0;
ind.specular = 0;
// UNITY_BRDF_PBS1 writes out alpha 1 to our emission alpha.
// UNITY_BRDF_PBS1 writes out alpha 1 to our emission alpha.
half4 res = UNITY_BRDF_PBS (data.diffuseColor, data.specularColor, oneMinusReflectivity, data.smoothness, data.normalWorld, -eyeVec, light, ind);
return res;

22
Assets/ScriptableRenderPipeline/OnTileDeferredPipeline/Shaders/UnityStandardForwardMobile.cginc


#define SHADOW_FPTL
# if defined(SHADER_API_D3D11)
# include "../../ShaderLibrary/API/D3D11.hlsl"
# include "../../Core/ShaderLibrary/API/D3D11.hlsl"
# include "../../ShaderLibrary/API/PSSL.hlsl"
# include "../../Core/ShaderLibrary/API/PSSL.hlsl"
# include "../../ShaderLibrary/API/D3D11.hlsl"
# include "../../ShaderLibrary/API/D3D11_1.hlsl"
# include "../../Core/ShaderLibrary/API/D3D11.hlsl"
# include "../../Core/ShaderLibrary/API/D3D11_1.hlsl"
# include "../../ShaderLibrary/API/Metal.hlsl"
# include "../../Core/ShaderLibrary/API/Metal.hlsl"
# include "../../ShaderLibrary/API/Validate.hlsl"
# include "../../ShaderLibrary/Shadow/Shadow.hlsl"
# include "../../Core/ShaderLibrary/API/Validate.hlsl"
# include "../../Core/ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_FPTL
struct VertexOutputForwardNew

ints = EvalIndirectSpecular(light, ind);
}
// root ibl end
for (int uIndex=0; uIndex<gLightData.y; uIndex++)
{
SFiniteLightData lgtDat = g_vProbeData[uIndex];

for (int lightIndex = 0; lightIndex < gLightData.x; ++lightIndex)
{
if (gPerLightData[lightIndex].x == DIRECTIONAL_LIGHT)
if (gPerLightData[lightIndex].x == DIRECTIONAL_LIGHT)
{
float atten = 1;

}
// fragment shader main
half4 singlePassForward(VertexOutputForwardNew i)
half4 singlePassForward(VertexOutputForwardNew i)
{
// matching script side where camera space is right handed.
float3 vP = i.posView;

// diffuse GI
res += UNITY_BRDF_PBS (gdata.diffColor, gdata.specColor, gdata.oneMinusReflectivity, gdata.smoothness, gdata.normalWorld, -gdata.eyeVec, gi.light, gi.indirect).xyz;
res += UNITY_BRDF_GI (gdata.diffColor, gdata.specColor, gdata.oneMinusReflectivity, gdata.smoothness, gdata.normalWorld, -gdata.eyeVec, occlusion, gi);
return OutputForward (float4(res,1.0), gdata.alpha);
}
正在加载...
取消
保存