Peter Bay Bastian
7 年前
当前提交
85e38a3c
共有 66 个文件被更改,包括 2570 次插入 和 2609 次删除
-
999ImageTemplates/LightweightPipeline/Scenes/023_Lighting_Mixed.unity.png
-
999ImageTemplates/LightweightPipeline/Scenes/027_PostProcessing.unity.png
-
999ImageTemplates/LightweightPipeline/Scenes/036_Lighting_Scene_DirectionalBakedDirectional.unity.png
-
20ScriptableRenderPipeline/Core/CoreUtils.cs
-
3ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl
-
3ScriptableRenderPipeline/Core/ShaderLibrary/API/Metal.hlsl
-
3ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl
-
5ScriptableRenderPipeline/Core/ShaderLibrary/API/Vulkan.hlsl
-
152ScriptableRenderPipeline/Core/ShaderLibrary/Common.hlsl
-
2ScriptableRenderPipeline/Core/ShaderLibrary/CommonLighting.hlsl
-
2ScriptableRenderPipeline/Core/ShaderLibrary/VolumeRendering.hlsl
-
14ScriptableRenderPipeline/Core/TextureCache.cs
-
9ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
-
6ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader
-
1ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader
-
12ScriptableRenderPipeline/HDRenderPipeline/Debug/LightingDebugPanel.cs
-
5ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.Styles.cs
-
22ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
-
28ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
7ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader
-
13ScriptableRenderPipeline/HDRenderPipeline/Lighting/Forward.hlsl
-
156ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Deferred.compute
-
299ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
3ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
-
23ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl
-
4ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/materialflags.compute
-
8ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
-
6ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
-
59ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
-
6ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
-
2ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
-
6ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
-
9ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute
-
9ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.shader
-
83ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl
-
2ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassGBuffer.hlsl
-
6ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
-
14ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightAssetEditor.cs
-
42ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightCameraEditor.cs
-
7ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightLightEditor.cs
-
1ScriptableRenderPipeline/LightweightPipeline/LightweightConstantBuffer.cs
-
256ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs
-
4ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.asset
-
7ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs
-
8ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineUtils.cs
-
286ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightLighting.cginc
-
46ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.cginc
-
46ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightShadows.cginc
-
1ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandard.shader
-
2ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardParticles.shader
-
3ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardSimpleLighting.shader
-
1ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardTerrain.shader
-
2Tests/GraphicsTests/Framework/Editor/TestFramework.cs
-
2Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_01_BaseWhite.mat
-
2Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_02_BaseColor.mat
-
2Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_03_Specular.mat
-
2Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_04_Normal.mat
-
2Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_05_Emission.mat
-
4Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/007_LitShaderMaps/007_LitShaderMaps_06_All.mat
-
6Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/009_LightweightShading.unity
-
248Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/011_UnlitSprites.unity
-
18Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/028_PostProcessing_Custom.unity
-
2Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/036_Lighting_Scene_DirectionalBakedDirectional.unity
-
90ScriptableRenderPipeline/Core/ShaderLibrary/Macros.hlsl
-
81ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightInput.cginc
-
9ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightInput.cginc.meta
999
ImageTemplates/LightweightPipeline/Scenes/023_Lighting_Mixed.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/LightweightPipeline/Scenes/027_PostProcessing.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/LightweightPipeline/Scenes/036_Lighting_Scene_DirectionalBakedDirectional.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
248
Tests/GraphicsTests/RenderPipeline/LightweightPipeline/Scenes/011_UnlitSprites.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
#ifndef UNITY_MACROS_INCLUDED |
|||
#define UNITY_MACROS_INCLUDED |
|||
|
|||
// Some shader compiler don't support to do multiple ## for concatenation inside the same macro, it require an indirection. |
|||
// This is the purpose of this macro |
|||
#define MERGE_NAME(X, Y) X##Y |
|||
|
|||
// These define are use to abstract the way we sample into a cubemap array. |
|||
// 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 TEXTURECUBE_ARRAY_ARGS_ABSTRACT TEXTURE2D_ARRAY_ARGS |
|||
#define TEXTURECUBE_ARRAY_PARAM_ABSTRACT TEXTURE2D_ARRAY_PARAM |
|||
#define SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(textureName, samplerName, coord3, index, lod) SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, DirectionToLatLongCoordinate(coord3), index, lod) |
|||
#else |
|||
#define TEXTURECUBE_ARRAY_ABSTRACT TEXTURECUBE_ARRAY |
|||
#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) |
|||
#endif |
|||
|
|||
#define TEMPLATE_1_FLT(FunctionName, Parameter1, FunctionBody) \ |
|||
float FunctionName(float Parameter1) { FunctionBody; } \ |
|||
float2 FunctionName(float2 Parameter1) { FunctionBody; } \ |
|||
float3 FunctionName(float3 Parameter1) { FunctionBody; } \ |
|||
float4 FunctionName(float4 Parameter1) { FunctionBody; } |
|||
|
|||
#define TEMPLATE_1_INT(FunctionName, Parameter1, FunctionBody) \ |
|||
int FunctionName(int Parameter1) { FunctionBody; } \ |
|||
int2 FunctionName(int2 Parameter1) { FunctionBody; } \ |
|||
int3 FunctionName(int3 Parameter1) { FunctionBody; } \ |
|||
int4 FunctionName(int4 Parameter1) { FunctionBody; } \ |
|||
uint FunctionName(uint Parameter1) { FunctionBody; } \ |
|||
uint2 FunctionName(uint2 Parameter1) { FunctionBody; } \ |
|||
uint3 FunctionName(uint3 Parameter1) { FunctionBody; } \ |
|||
uint4 FunctionName(uint4 Parameter1) { FunctionBody; } |
|||
|
|||
#define TEMPLATE_2_FLT(FunctionName, Parameter1, Parameter2, FunctionBody) \ |
|||
float FunctionName(float Parameter1, float Parameter2) { FunctionBody; } \ |
|||
float2 FunctionName(float2 Parameter1, float2 Parameter2) { FunctionBody; } \ |
|||
float3 FunctionName(float3 Parameter1, float3 Parameter2) { FunctionBody; } \ |
|||
float4 FunctionName(float4 Parameter1, float4 Parameter2) { FunctionBody; } |
|||
|
|||
#define TEMPLATE_2_INT(FunctionName, Parameter1, Parameter2, FunctionBody) \ |
|||
int FunctionName(int Parameter1, int Parameter2) { FunctionBody; } \ |
|||
int2 FunctionName(int2 Parameter1, int2 Parameter2) { FunctionBody; } \ |
|||
int3 FunctionName(int3 Parameter1, int3 Parameter2) { FunctionBody; } \ |
|||
int4 FunctionName(int4 Parameter1, int4 Parameter2) { FunctionBody; } \ |
|||
uint FunctionName(uint Parameter1, uint Parameter2) { FunctionBody; } \ |
|||
uint2 FunctionName(uint2 Parameter1, uint2 Parameter2) { FunctionBody; } \ |
|||
uint3 FunctionName(uint3 Parameter1, uint3 Parameter2) { FunctionBody; } \ |
|||
uint4 FunctionName(uint4 Parameter1, uint4 Parameter2) { FunctionBody; } |
|||
|
|||
#define TEMPLATE_3_FLT(FunctionName, Parameter1, Parameter2, Parameter3, FunctionBody) \ |
|||
float FunctionName(float Parameter1, float Parameter2, float Parameter3) { FunctionBody; } \ |
|||
float2 FunctionName(float2 Parameter1, float2 Parameter2, float2 Parameter3) { FunctionBody; } \ |
|||
float3 FunctionName(float3 Parameter1, float3 Parameter2, float3 Parameter3) { FunctionBody; } \ |
|||
float4 FunctionName(float4 Parameter1, float4 Parameter2, float4 Parameter3) { FunctionBody; } |
|||
|
|||
#define TEMPLATE_3_INT(FunctionName, Parameter1, Parameter2, Parameter3, FunctionBody) \ |
|||
int FunctionName(int Parameter1, int Parameter2, int Parameter3) { FunctionBody; } \ |
|||
int2 FunctionName(int2 Parameter1, int2 Parameter2, int2 Parameter3) { FunctionBody; } \ |
|||
int3 FunctionName(int3 Parameter1, int3 Parameter2, int3 Parameter3) { FunctionBody; } \ |
|||
int4 FunctionName(int4 Parameter1, int4 Parameter2, int4 Parameter3) { FunctionBody; } \ |
|||
uint FunctionName(uint Parameter1, uint Parameter2, uint Parameter3) { FunctionBody; } \ |
|||
uint2 FunctionName(uint2 Parameter1, uint2 Parameter2, uint2 Parameter3) { FunctionBody; } \ |
|||
uint3 FunctionName(uint3 Parameter1, uint3 Parameter2, uint3 Parameter3) { FunctionBody; } \ |
|||
uint4 FunctionName(uint4 Parameter1, uint4 Parameter2, uint4 Parameter3) { FunctionBody; } |
|||
|
|||
#define TEMPLATE_SWAP(FunctionName) \ |
|||
void FunctionName(inout float a, inout float b) { float t = a; a = b; b = t; } \ |
|||
void FunctionName(inout float2 a, inout float2 b) { float2 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout float3 a, inout float3 b) { float3 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout float4 a, inout float4 b) { float4 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout int a, inout int b) { int t = a; a = b; b = t; } \ |
|||
void FunctionName(inout int2 a, inout int2 b) { int2 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout int3 a, inout int3 b) { int3 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout int4 a, inout int4 b) { int4 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout uint a, inout uint b) { uint t = a; a = b; b = t; } \ |
|||
void FunctionName(inout uint2 a, inout uint2 b) { uint2 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout uint3 a, inout uint3 b) { uint3 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout uint4 a, inout uint4 b) { uint4 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout bool a, inout bool b) { bool t = a; a = b; b = t; } \ |
|||
void FunctionName(inout bool2 a, inout bool2 b) { bool2 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout bool3 a, inout bool3 b) { bool3 t = a; a = b; b = t; } \ |
|||
void FunctionName(inout bool4 a, inout bool4 b) { bool4 t = a; a = b; b = t; } |
|||
|
|||
#endif // UNITY_MACROS_INCLUDED |
|
|||
#ifndef LIGHTWEIGHT_INPUT_INCLUDED |
|||
#define LIGHTWEIGHT_INPUT_INCLUDED |
|||
|
|||
#define MAX_VISIBLE_LIGHTS 16 |
|||
|
|||
// Must match Lightweigth ShaderGraph master node |
|||
struct SurfaceData |
|||
{ |
|||
half3 albedo; |
|||
half3 specular; |
|||
half metallic; |
|||
half smoothness; |
|||
half3 normal; |
|||
half3 emission; |
|||
half occlusion; |
|||
half alpha; |
|||
}; |
|||
|
|||
struct LightInput |
|||
{ |
|||
float4 pos; |
|||
half4 color; |
|||
half4 distanceAttenuation; |
|||
half4 spotDirection; |
|||
half4 spotAttenuation; |
|||
}; |
|||
|
|||
// Main light initialized without indexing |
|||
#define INITIALIZE_MAIN_LIGHT(light) \ |
|||
light.pos = _MainLightPosition; \ |
|||
light.color = _MainLightColor; \ |
|||
light.distanceAttenuation = _MainLightDistanceAttenuation; \ |
|||
light.spotDirection = _MainLightSpotDir; \ |
|||
light.spotAttenuation = _MainLightSpotAttenuation |
|||
|
|||
// Indexing might have a performance hit for old mobile hardware |
|||
#define INITIALIZE_LIGHT(light, i) \ |
|||
half4 indices = (i < 4) ? unity_4LightIndices0 : unity_4LightIndices1; \ |
|||
int index = (i < 4) ? i : i - 4; \ |
|||
int lightIndex = indices[index]; \ |
|||
light.pos = _AdditionalLightPosition[lightIndex]; \ |
|||
light.color = _AdditionalLightColor[lightIndex]; \ |
|||
light.distanceAttenuation = _AdditionalLightDistanceAttenuation[lightIndex]; \ |
|||
light.spotDirection = _AdditionalLightSpotDir[lightIndex]; \ |
|||
light.spotAttenuation = _AdditionalLightSpotAttenuation[lightIndex] |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
// Constant Buffers // |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
|
|||
CBUFFER_START(_PerFrame) |
|||
half4 _GlossyEnvironmentColor; |
|||
half4 _SubtractiveShadowColor; |
|||
CBUFFER_END |
|||
|
|||
CBUFFER_START(_PerCamera) |
|||
sampler2D _MainLightCookie; |
|||
float4 _MainLightPosition; |
|||
half4 _MainLightColor; |
|||
half4 _MainLightDistanceAttenuation; |
|||
half4 _MainLightSpotDir; |
|||
half4 _MainLightSpotAttenuation; |
|||
float4x4 _WorldToLight; |
|||
|
|||
half4 _AdditionalLightCount; |
|||
float4 _AdditionalLightPosition[MAX_VISIBLE_LIGHTS]; |
|||
half4 _AdditionalLightColor[MAX_VISIBLE_LIGHTS]; |
|||
half4 _AdditionalLightDistanceAttenuation[MAX_VISIBLE_LIGHTS]; |
|||
half4 _AdditionalLightSpotDir[MAX_VISIBLE_LIGHTS]; |
|||
half4 _AdditionalLightSpotAttenuation[MAX_VISIBLE_LIGHTS]; |
|||
CBUFFER_END |
|||
|
|||
// These are set internally by the engine upon request by RendererConfiguration. |
|||
// Check GetRendererSettings in LightweightPipeline.cs |
|||
CBUFFER_START(_PerObject) |
|||
half4 unity_LightIndicesOffsetAndCount; |
|||
half4 unity_4LightIndices0; |
|||
half4 unity_4LightIndices1; |
|||
CBUFFER_END |
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: b2555155ead696140913bef1ec93adf0 |
|||
timeCreated: 1488965025 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue