浏览代码

Merge pull request #672 from EvgeniiG/master

Reduce the number of samplers used by the HDRP
/feature-ReflectionProbeFit
GitHub 7 年前
当前提交
f080e1c3
共有 25 个文件被更改,包括 87 次插入104 次删除
  1. 2
      ScriptableRenderPipeline/Core/Resources/BlitCubeTextureFace.shader
  2. 11
      ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl
  3. 11
      ScriptableRenderPipeline/Core/ShaderLibrary/API/Metal.hlsl
  4. 11
      ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl
  5. 11
      ScriptableRenderPipeline/Core/ShaderLibrary/API/Vulkan.hlsl
  6. 11
      ScriptableRenderPipeline/Core/ShaderLibrary/API/XBoxOne.hlsl
  7. 3
      ScriptableRenderPipeline/Core/ShaderLibrary/Macros.hlsl
  8. 4
      ScriptableRenderPipeline/Core/ShaderLibrary/Wind.hlsl
  9. 2
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader
  10. 2
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader
  11. 11
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl
  12. 8
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/ShadowContext.hlsl
  13. 1
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/builddispatchindirect.compute
  14. 1
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/materialflags.compute
  15. 4
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/DecalProperties.hlsl
  16. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/GGXConvolution/BuildProbabilityTables.compute
  17. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/GGXConvolution/GGXConvolve.shader
  18. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  19. 46
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitProperties.hlsl
  20. 4
      ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl
  21. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/UnlitProperties.hlsl
  22. 15
      ScriptableRenderPipeline/HDRenderPipeline/ShaderVariables.hlsl
  23. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader
  24. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader
  25. 5
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyVariables.hlsl

2
ScriptableRenderPipeline/Core/Resources/BlitCubeTextureFace.shader


#pragma target 3.0
TEXTURECUBE(_InputTex);
SAMPLERCUBE(sampler_InputTex);
SAMPLER(sampler_InputTex);
float _FaceIndex;
float _LoD;

11
ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl


#define TEXTURE3D(textureName) Texture3D textureName
#define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName
#define SAMPLER2D(samplerName) SamplerState samplerName
#define SAMPLERCUBE(samplerName) SamplerState samplerName
#define SAMPLER3D(samplerName) SamplerState samplerName
#define SAMPLER2D_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLERCUBE_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLER(samplerName) SamplerState samplerName
#define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName
#define TEXTURE2D_ARGS(textureName, samplerName) Texture2D textureName, SamplerState samplerName
#define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) Texture2DArray textureName, SamplerState samplerName

#define TEXTURE2D_FLOAT TEXTURE2D
#define TEXTURE3D_HALF TEXTURE3D
#define TEXTURE3D_FLOAT TEXTURE3D
#define SAMPLER2D_HALF SAMPLER2D
#define SAMPLER2D_FLOAT SAMPLER2D
#define SAMPLER_HALF SAMPLER
#define SAMPLER_FLOAT SAMPLER
#define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0))
#define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod))

11
ScriptableRenderPipeline/Core/ShaderLibrary/API/Metal.hlsl


#define TEXTURE3D(textureName) Texture3D textureName
#define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName
#define SAMPLER2D(samplerName) SamplerState samplerName
#define SAMPLERCUBE(samplerName) SamplerState samplerName
#define SAMPLER3D(samplerName) SamplerState samplerName
#define SAMPLER2D_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLERCUBE_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLER(samplerName) SamplerState samplerName
#define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName
#define TEXTURE2D_ARGS(textureName, samplerName) Texture2D textureName, SamplerState samplerName
#define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) Texture2DArray textureName, SamplerState samplerName

#define TEXTURE2D_FLOAT TEXTURE2D
#define TEXTURE3D_HALF TEXTURE3D
#define TEXTURE3D_FLOAT TEXTURE3D
#define SAMPLER2D_HALF SAMPLER2D
#define SAMPLER2D_FLOAT SAMPLER2D
#define SAMPLER_HALF SAMPLER
#define SAMPLER_FLOAT SAMPLER
#define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0))
#define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod))

11
ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl


#define TEXTURE3D(textureName) Texture3D textureName
#define RW_TEXTURE2D(type, textureName) RW_Texture2D<type> textureName
#define SAMPLER2D(samplerName) SamplerState samplerName
#define SAMPLERCUBE(samplerName) SamplerState samplerName
#define SAMPLER3D(samplerName) SamplerState samplerName
#define SAMPLER2D_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLERCUBE_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLER(samplerName) SamplerState samplerName
#define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName
#define TEXTURE2D_ARGS(textureName, samplerName) Texture2D textureName, SamplerState samplerName
#define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) Texture2DArray textureName, SamplerState samplerName

#define TEXTURE2D_FLOAT TEXTURE2D
#define TEXTURE3D_HALF TEXTURE3D
#define TEXTURE3D_FLOAT TEXTURE3D
#define SAMPLER2D_HALF SAMPLER2D
#define SAMPLER2D_FLOAT SAMPLER2D
#define SAMPLER_HALF SAMPLER
#define SAMPLER_FLOAT SAMPLER
#define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0))
#define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod))

11
ScriptableRenderPipeline/Core/ShaderLibrary/API/Vulkan.hlsl


#define TEXTURE3D(textureName) Texture3D textureName
#define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName
#define SAMPLER2D(samplerName) SamplerState samplerName
#define SAMPLERCUBE(samplerName) SamplerState samplerName
#define SAMPLER3D(samplerName) SamplerState samplerName
#define SAMPLER2D_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLERCUBE_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLER(samplerName) SamplerState samplerName
#define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName
#define TEXTURE2D_ARGS(textureName, samplerName) Texture2D textureName, SamplerState samplerName
#define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) Texture2DArray textureName, SamplerState samplerName

#define TEXTURE2D_FLOAT TEXTURE2D
#define TEXTURE3D_HALF TEXTURE3D
#define TEXTURE3D_FLOAT TEXTURE3D
#define SAMPLER2D_HALF SAMPLER2D
#define SAMPLER2D_FLOAT SAMPLER2D
#define SAMPLER_HALF SAMPLER
#define SAMPLER_FLOAT SAMPLER
#define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0))
#define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod))

11
ScriptableRenderPipeline/Core/ShaderLibrary/API/XBoxOne.hlsl


#define TEXTURE3D(textureName) Texture3D textureName
#define RW_TEXTURE2D(type, textureName) RWTexture2D<type> textureName
#define SAMPLER2D(samplerName) SamplerState samplerName
#define SAMPLERCUBE(samplerName) SamplerState samplerName
#define SAMPLER3D(samplerName) SamplerState samplerName
#define SAMPLER2D_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLERCUBE_SHADOW(samplerName) SamplerComparisonState samplerName
#define SAMPLER(samplerName) SamplerState samplerName
#define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName
#define TEXTURE2D_ARGS(textureName, samplerName) Texture2D textureName, SamplerState samplerName
#define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) Texture2DArray textureName, SamplerState samplerName

#define TEXTURE2D_FLOAT TEXTURE2D
#define TEXTURE3D_HALF TEXTURE3D
#define TEXTURE3D_FLOAT TEXTURE3D
#define SAMPLER2D_HALF SAMPLER2D
#define SAMPLER2D_FLOAT SAMPLER2D
#define SAMPLER_HALF SAMPLER
#define SAMPLER_FLOAT SAMPLER
#define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0))
#define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod))

3
ScriptableRenderPipeline/Core/ShaderLibrary/Macros.hlsl


// Some platform don't support cubemap array so we fallback on 2D latlong
#ifdef UNITY_NO_CUBEMAP_ARRAY
#define TEXTURECUBE_ARRAY_ABSTRACT TEXTURE2D_ARRAY
#define SAMPLERCUBE_ABSTRACT SAMPLER2D
#define SAMPLERCUBE_ABSTRACT SAMPLERCUBE
#define TEXTURECUBE_ARRAY_ARGS_ABSTRACT TEXTURECUBE_ARRAY_ARGS
#define TEXTURECUBE_ARRAY_PARAM_ABSTRACT TEXTURECUBE_ARRAY_PARAM
#define SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(textureName, samplerName, coord3, index, lod) SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod)

#define FLT_EPS 5.960464478e-8 // 2^-24, machine epsilon: 1 + EPS = 1 (half of the ULP for 1)
#define FLT_MIN 1.175494351e-38 // Minimum representable positive floating-point number
#define FLT_MAX 3.402823466e+38 // Maximum representable floating-point number
#define FLT_NAN asfloat(0xFFFFFFFF)
#define HALF_MIN 6.103515625e-5 // 2^-14, the same value for 10, 11 and 16-bit: https://www.khronos.org/opengl/wiki/Small_Float_Formats
#define HALF_MAX 65504.0
#define UINT_MAX 0xFFFFFFFFu

4
ScriptableRenderPipeline/Core/ShaderLibrary/Wind.hlsl


// Globals
TEXTURE2D(WIND_SETTINGS_TexNoise);
SAMPLER2D(sampler_WIND_SETTINGS_TexNoise);
SAMPLER(sampler_WIND_SETTINGS_TexNoise);
SAMPLER2D(sampler_WIND_SETTINGS_TexGust);
SAMPLER(sampler_WIND_SETTINGS_TexGust);
float4 WIND_SETTINGS_WorldDirectionAndSpeed;
float WIND_SETTINGS_FlexNoiseScale;

2
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader


#include "ShaderLibrary/ImageBasedLighting.hlsl"
TEXTURECUBE(_InputCubemap);
SAMPLERCUBE(sampler_InputCubemap);
SAMPLER(sampler_InputCubemap);
float _Mipmap;
struct Attributes

2
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader


#include "../ShaderVariables.hlsl"
TEXTURE2D(_DebugFullScreenTexture);
SAMPLER2D(sampler_DebugFullScreenTexture);
SAMPLER(sampler_DebugFullScreenTexture);
float _FullScreenDebugMode;
struct Attributes

11
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoopDef.hlsl


// Used by directional and spot lights
TEXTURE2D_ARRAY(_CookieTextures);
SAMPLER2D(sampler_CookieTextures);
SAMPLERCUBE_ABSTRACT(sampler_CookieCubeTextures);
SAMPLERCUBE_ABSTRACT(sampler_EnvTextures);
TEXTURE2D(_DeferredShadowTexture);

// Used by directional and spot lights.
float3 SampleCookie2D(LightLoopContext lightLoopContext, float2 coord, int index)
{
return SAMPLE_TEXTURE2D_ARRAY_LOD(_CookieTextures, sampler_CookieTextures, coord, index, 0).rgb;
// TODO: add MIP maps to combat aliasing?
return SAMPLE_TEXTURE2D_ARRAY_LOD(_CookieTextures, s_linear_clamp_sampler, coord, index, 0).rgb;
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_CookieCubeTextures, sampler_CookieCubeTextures, coord, index, 0).rgb;
// TODO: add MIP maps to combat aliasing?
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_CookieCubeTextures, s_linear_clamp_sampler, coord, index, 0).rgb;
}
//-----------------------------------------------------------------------------

// This code will be inlined as lightLoopContext is hardcoded in the light loop
if (lightLoopContext.sampleReflection == SINGLE_PASS_CONTEXT_SAMPLE_REFLECTION_PROBES)
{
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvTextures, sampler_EnvTextures, texCoord, index, lod);
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvTextures, s_trilinear_clamp_sampler, texCoord, index, lod);
}
else // SINGLE_PASS_SAMPLE_SKY
{

8
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/ShadowContext.hlsl


#include "ShaderLibrary/Shadow/Shadow.hlsl"
TEXTURE2D_ARRAY(_ShadowmapExp_VSM_0);
SAMPLER2D(sampler_ShadowmapExp_VSM_0);
SAMPLER(sampler_ShadowmapExp_VSM_0);
SAMPLER2D(sampler_ShadowmapExp_VSM_1);
SAMPLER(sampler_ShadowmapExp_VSM_1);
SAMPLER2D(sampler_ShadowmapExp_VSM_2);
SAMPLER(sampler_ShadowmapExp_VSM_2);
SAMPLER2D_SHADOW(sampler_ShadowmapExp_PCF);
SAMPLER_CMP(sampler_ShadowmapExp_PCF);
StructuredBuffer<ShadowData> _ShadowDatasExp;
StructuredBuffer<int4> _ShadowPayloads;

1
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/builddispatchindirect.compute


#include "ShaderLibrary/Common.hlsl"
#include "LightLoop.cs.hlsl"
#include "../../ShaderVariables.hlsl"
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "../../Material/Material.hlsl" // This includes Material.hlsl

1
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/materialflags.compute


#include "ShaderBase.hlsl"
#include "LightLoop.cs.hlsl"
#include "../../ShaderVariables.hlsl"
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "../../Material/Material.hlsl" // This includes Material.hlsl
#include "../../Lighting/LightDefinition.cs.hlsl"

4
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/DecalProperties.hlsl


TEXTURE2D(_BaseColorMap);
SAMPLER2D(sampler_BaseColorMap);
SAMPLER(sampler_BaseColorMap);
SAMPLER2D(sampler_NormalMap);
SAMPLER(sampler_NormalMap);
float _DecalBlend;

6
ScriptableRenderPipeline/HDRenderPipeline/Material/GGXConvolution/BuildProbabilityTables.compute


#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../ShaderVariables.hlsl"
/* --- Input --- */

TEXTURECUBE(envMap); // Input cubemap
SAMPLERCUBE(sampler_envMap);
/* --- Output --- */

float3 L1 = ConvertEquiarealToCubemap(u1, v);
float3 L2 = ConvertEquiarealToCubemap(u2, v);
float3 c1 = SAMPLE_TEXTURECUBE_LOD(envMap, sampler_envMap, L1, 0).rgb;
float3 c2 = SAMPLE_TEXTURECUBE_LOD(envMap, sampler_envMap, L2, 0).rgb;
float3 c1 = SAMPLE_TEXTURECUBE_LOD(envMap, s_linear_clamp_sampler, L1, 0).rgb;
float3 c2 = SAMPLE_TEXTURECUBE_LOD(envMap, s_linear_clamp_sampler, L2, 0).rgb;
// Compute the integral of the step function (row values).
// TODO: process 4 texels per thread, and manually unroll.

6
ScriptableRenderPipeline/HDRenderPipeline/Material/GGXConvolution/GGXConvolve.shader


#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
#include "GGXConvolution.cs.hlsl"
#include "../../ShaderVariables.hlsl"
SAMPLERCUBE(sampler_MainTex);
TEXTURE2D_FLOAT(_GgxIblSamples);

uint sampleCount = GetIBLRuntimeFilterSampleCount(_Level);
#ifdef USE_MIS
float4 val = IntegrateLD_MIS(TEXTURECUBE_PARAM(_MainTex, sampler_MainTex),
float4 val = IntegrateLD_MIS(TEXTURECUBE_PARAM(_MainTex, s_trilinear_clamp_sampler),
_MarginalRowDensities, _ConditionalDensities,
V, N,
roughness,

1024,
false);
#else
float4 val = IntegrateLD(TEXTURECUBE_PARAM(_MainTex, sampler_MainTex),
float4 val = IntegrateLD(TEXTURECUBE_PARAM(_MainTex, s_trilinear_clamp_sampler),
_GgxIblSamples,
V, N,
roughness,

6
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


// #define LIT_DIFFUSE_LAMBERT_BRDF
#define LIT_USE_GGX_ENERGY_COMPENSATION
// Sampler use by area light, gaussian pyramid, ambient occlusion etc...
SamplerState s_linear_clamp_sampler;
SamplerState s_trilinear_clamp_sampler;
// Rough refraction texture
// Color pyramid (width, height, lodcount, Unused)
TEXTURE2D(_GaussianPyramidColorTexture);

#ifndef _SURFACE_TYPE_TRANSPARENT
#define USE_DEFERRED_DIRECTIONAL_SHADOWS // Deferred shadows are always enabled for opaque objects
#endif
#include "../../Lighting/LightEvaluation.hlsl"
//-----------------------------------------------------------------------------
// Lighting structure for light accumulation

46
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitProperties.hlsl


// ===========================================================================
TEXTURE2D(_DistortionVectorMap);
SAMPLER2D(sampler_DistortionVectorMap);
SAMPLER(sampler_DistortionVectorMap);
SAMPLER2D(sampler_EmissiveColorMap);
SAMPLER(sampler_EmissiveColorMap);
SAMPLER2D(sampler_DiffuseLightingMap);
SAMPLER(sampler_DiffuseLightingMap);
SAMPLER2D(sampler_BaseColorMap);
SAMPLER(sampler_BaseColorMap);
SAMPLER2D(sampler_MaskMap);
SAMPLER(sampler_MaskMap);
SAMPLER2D(sampler_BentNormalMap);
SAMPLER(sampler_BentNormalMap);
SAMPLER2D(sampler_NormalMap);
SAMPLER(sampler_NormalMap);
SAMPLER2D(sampler_NormalMapOS);
SAMPLER(sampler_NormalMapOS);
SAMPLER2D(sampler_DetailMap);
SAMPLER(sampler_DetailMap);
SAMPLER2D(sampler_HeightMap);
SAMPLER(sampler_HeightMap);
SAMPLER2D(sampler_TangentMap);
SAMPLER(sampler_TangentMap);
SAMPLER2D(sampler_TangentMapOS);
SAMPLER(sampler_TangentMapOS);
SAMPLER2D(sampler_AnisotropyMap);
SAMPLER(sampler_AnisotropyMap);
SAMPLER2D(sampler_SubsurfaceRadiusMap);
SAMPLER(sampler_SubsurfaceRadiusMap);
SAMPLER2D(sampler_ThicknessMap);
SAMPLER(sampler_ThicknessMap);
SAMPLER2D(sampler_SpecularColorMap);
SAMPLER(sampler_SpecularColorMap);
SAMPLER2D(sampler_TransmittanceColorMap);
SAMPLER(sampler_TransmittanceColorMap);
#else

// mean we must declare all sampler
#define PROP_DECL_TEX2D(name)\
TEXTURE2D(MERGE_NAME(name, 0)); \
SAMPLER2D(MERGE_NAME(MERGE_NAME(sampler, name), 0)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 0)); \
SAMPLER2D(MERGE_NAME(MERGE_NAME(sampler, name), 1)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 1)); \
SAMPLER2D(MERGE_NAME(MERGE_NAME(sampler, name), 2)); \
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 2)); \
SAMPLER2D(MERGE_NAME(MERGE_NAME(sampler, name), 3))
SAMPLER(MERGE_NAME(MERGE_NAME(sampler, name), 3))
PROP_DECL_TEX2D(_BaseColorMap);

PROP_DECL_TEX2D(_ThicknessMap);
TEXTURE2D(_LayerMaskMap);
SAMPLER2D(sampler_LayerMaskMap);
SAMPLER(sampler_LayerMaskMap);
SAMPLER2D(sampler_LayerInfluenceMaskMap);
SAMPLER(sampler_LayerInfluenceMaskMap);
#endif

4
ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl


#include "Builtin/BuiltinData.hlsl"
#if defined(LIGHTLOOP_SINGLE_PASS) || defined(LIGHTLOOP_TILE_PASS)
#include "../Lighting/LightEvaluation.hlsl" // Depends on LightLoopDef and BuiltinData, shared by different materials and light loops
#endif
//-----------------------------------------------------------------------------
// Material definition
//-----------------------------------------------------------------------------

6
ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/UnlitProperties.hlsl


float4 _UnlitColor;
TEXTURE2D(_UnlitColorMap);
SAMPLER2D(sampler_UnlitColorMap);
SAMPLER(sampler_UnlitColorMap);
SAMPLER2D(sampler_DistortionVectorMap);
SAMPLER(sampler_DistortionVectorMap);
SAMPLER2D(sampler_EmissiveColorMap);
SAMPLER(sampler_EmissiveColorMap);
float4 _EmissiveColorMap_ST;
float _EmissiveIntensity;

15
ScriptableRenderPipeline/HDRenderPipeline/ShaderVariables.hlsl


// ----------------------------------------------------------------------------
// These are the samplers available in the HDRenderPipeline.
// Avoid declaring extra samplers as they are 4x SGPR each on GCN.
SAMPLER(s_linear_clamp_sampler);
SAMPLER(s_trilinear_clamp_sampler);
// ----------------------------------------------------------------------------
SAMPLER2D(sampler_MainDepthTexture);
SAMPLER(sampler_MainDepthTexture);
SAMPLER2D(samplerunity_Lightmap);
SAMPLER(samplerunity_Lightmap);
SAMPLER2D(samplerunity_DynamicLightmap);
SAMPLER(samplerunity_DynamicLightmap);
TEXTURE2D(unity_DynamicDirectionality);

// TODO: Change code here so probe volume use only one transform instead of all this parameters!
TEXTURE3D_FLOAT(unity_ProbeVolumeSH);
SAMPLER3D(samplerunity_ProbeVolumeSH);
SAMPLER(samplerunity_ProbeVolumeSH);
CBUFFER_START(UnityVelocityPass)
float4x4 unity_MatrixNonJitteredVP;

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader


#include "ShaderLibrary/Common.hlsl"
TEXTURECUBE(_MainTex);
SAMPLERCUBE(sampler_MainTex);
SAMPLER(sampler_MainTex);
float _faceIndex;
struct appdata_t {

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader


#include "ShaderLibrary/CommonLighting.hlsl"
TEXTURECUBE(_Cubemap);
SAMPLERCUBE(sampler_Cubemap);
SAMPLER(sampler_Cubemap);
float4 _SkyParam; // x exposure, y multiplier, z rotation
float4x4 _PixelCoordToViewDirWS; // Actually just 3x3, but Unity can only set 4x4

5
ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyVariables.hlsl


#define UNITY_SKY_VARIABLES_INCLUDED
TEXTURECUBE(_SkyTexture);
SAMPLERCUBE(sampler_SkyTexture); // NOTE: Sampler could be share here with _EnvTextures. Don't know if the shader compiler will complain...
CBUFFER_START(SkyParameters)
float _SkyTextureMipCount;

{
return SAMPLE_TEXTURECUBE(_SkyTexture, sampler_SkyTexture, texCoord);
return SAMPLE_TEXTURECUBE(_SkyTexture, s_trilinear_clamp_sampler, texCoord);
return SAMPLE_TEXTURECUBE_LOD(_SkyTexture, sampler_SkyTexture, texCoord, lod);
return SAMPLE_TEXTURECUBE_LOD(_SkyTexture, s_trilinear_clamp_sampler, texCoord, lod);
}
#endif
正在加载...
取消
保存