Evgenii Golubev
8 年前
当前提交
f38f5e1a
共有 284 个文件被更改,包括 2004 次插入 和 699 次删除
-
102Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs
-
4Assets/Editor/Tests/RenderloopTests/CullResultsTest.cs
-
40Assets/Editor/Tests/RenderloopTests/RenderloopTestFixture.cs
-
2Assets/Editor/Tests/ShaderGeneratorTests/ShaderGeneratorTests.cs
-
10Assets/ScriptableRenderLoop/AdditionalLightData.cs
-
5Assets/ScriptableRenderLoop/Editor/MaterialUpgrader.cs
-
2Assets/ScriptableRenderLoop/RenderPasses/ShadowRenderPass.cs
-
35Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl
-
11Assets/ScriptableRenderLoop/ShaderLibrary/Packing.hlsl
-
2Assets/ScriptableRenderLoop/common/TextureSettings.cs
-
75Assets/ScriptableRenderLoop/core/RenderPipeline.cs
-
84Assets/ScriptableRenderLoop/fptl/FptlLighting.cs
-
2Assets/ScriptableRenderLoop/fptl/LightDefinitions.cs
-
5Assets/ShaderGenerator/Editor/CSharpToHLSL.cs
-
4Assets/ShaderGenerator/Editor/ShaderGeneratorMenu.cs
-
4Assets/ShaderGenerator/Editor/ShaderTypeGeneration.cs
-
2Assets/ShaderGenerator/ShaderGeneratorAttributes.cs
-
5Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs
-
896Assets/TestScenes/HDTest/LayeredLitTest.unity
-
25Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_BlendColor.mat
-
28Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_BlendMask.mat
-
14Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_Planar.mat
-
14Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_Triplanar.mat
-
28Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV0.mat
-
25Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV1.mat
-
14Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV2.mat
-
14Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer0_UV3.mat
-
14Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_Planar.mat
-
14Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_Triplanar.mat
-
27Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV0.mat
-
27Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV1.mat
-
14Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV2.mat
-
14Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer1_UV3.mat
-
16Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_Planar.mat
-
16Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_Triplanar.mat
-
28Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV0.mat
-
28Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV1.mat
-
16Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV2.mat
-
16Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer2_UV3.mat
-
22Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_Planar.mat
-
18Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_Triplanar.mat
-
30Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV0.mat
-
30Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV1.mat
-
18Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV2.mat
-
18Assets/TestScenes/HDTest/LayeredLitTest/Material/Layered_Layer3_UV3.mat
-
9Assets/TestScenes/HDTest/LayeredLitTest/Material/Lit_UVChart_Layer2_Detail.mat
-
12Assets/TestScenes/HDTest/LayeredLitTest/Material/Lit_White_Detail.mat
-
10ProjectSettings/GraphicsSettings.asset
-
4Assets/ScriptableRenderLoop/HDRenderPipeline/Shadow/FixedSizePCF/FixedSizePCF.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting.meta
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Material.meta
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl
-
4Assets/ScriptableRenderLoop/HDRenderPipeline/PostProcess/Resources/FinalPass.shader
-
8Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/Resources/DebugViewTiles.shader
-
10Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/Resources/DebugViewMaterialGBuffer.shader
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs.hlsl
-
6Assets/ScriptableRenderLoop/HDRenderPipeline/Debug/DebugViewMaterial.cs
-
24Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
-
48Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
-
16Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/UpgradeStandardShaderMaterials.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky.meta
-
60Assets/ScriptableRenderLoop/HDRenderPipeline/Utilities.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/SceneSettings/Editor/CommonSettingsEditor.cs
-
28Assets/ScriptableRenderLoop/HDRenderPipeline/SceneSettings/CommonSettings.cs
-
285Assets/ScriptableRenderLoop/HDRenderPipeline/HDRenderPipeline.cs
-
15Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs.hlsl
-
26Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
120Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/Resources/shadeopaque.compute
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass.meta
-
8Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Resources/Deferred.shader
-
12Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Lighting.hlsl
-
8Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightLoop.cs
-
12Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightDefinition.cs.hlsl
-
6Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/LightDefinition.cs
-
4Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPass.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPass.cs.hlsl
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl
-
4Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyRenderer.cs
-
20Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyParameters.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs.hlsl
-
46Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/Resources/GGXConvolve.shader
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader
-
8Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyParameters.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/Editor/ProceduralSkyEditor.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader
-
8Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/HDRISkyParameters.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Material/LayeredLit.meta
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit.meta
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Attributes.hlsl
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Builtin/BuiltinData.cs.hlsl
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Builtin/BuiltinData.cs
-
10Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.shader
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.cs.hlsl
-
4Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Unlit/Unlit.cs
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEngine.Experimental.Rendering; |
|||
namespace UnityEngine.ScriptableRenderPipeline |
|||
namespace UnityEngine.Experimental.Rendering |
|||
public abstract class RenderPipeline : BaseRenderPipeline |
|||
{ |
|||
private readonly HashSet<IScriptableRenderDataStore> m_AssociatedDataStores = new HashSet<IScriptableRenderDataStore>(); |
|||
private ICameraProvider m_CameraProvider; |
|||
|
|||
public override ICameraProvider cameraProvider |
|||
{ |
|||
get |
|||
{ |
|||
if (m_CameraProvider == null) |
|||
m_CameraProvider = ConstructCameraProvider(); |
|||
|
|||
return m_CameraProvider; |
|||
} |
|||
set { m_CameraProvider = value; } |
|||
} |
|||
|
|||
public override void Render(ScriptableRenderContext renderContext, IScriptableRenderDataStore dataStore) |
|||
{ |
|||
if (dataStore == null) |
|||
throw new ArgumentException(string.Format("Null DataStore has been passed into pipe {0}", this)); |
|||
|
|||
if (dataStore.owner == null) |
|||
throw new ArgumentException(string.Format("DataStore owner is null. It needs o be owned by loop {0}", this)); |
|||
|
|||
if (dataStore.owner != null && !ReferenceEquals(dataStore.owner, this)) |
|||
throw new ArgumentException(string.Format("DataStore {0} has been passed into pipe {1}, but is owned by {2}", dataStore, this, dataStore.owner)); |
|||
|
|||
m_AssociatedDataStores.Add(dataStore); |
|||
dataStore.Build(); |
|||
} |
|||
|
|||
public override void ClearCachedData() |
|||
{ |
|||
foreach (var store in m_AssociatedDataStores) |
|||
store.Cleanup(); |
|||
|
|||
m_AssociatedDataStores.Clear(); |
|||
} |
|||
|
|||
public override ICameraProvider ConstructCameraProvider() |
|||
{ |
|||
return new DefaultCameraProvider(); |
|||
} |
|||
|
|||
public override IScriptableRenderDataStore ConstructDataStore() |
|||
{ |
|||
return new RenderingDataStore(this); |
|||
} |
|||
|
|||
public static void CleanCameras(IEnumerable<Camera> cameras) |
|||
{ |
|||
foreach (var camera in cameras) |
|||
camera.ClearIntermediateRenderers(); |
|||
} |
|||
} |
|||
public abstract class RenderPipeline : IRenderPipeline |
|||
{ |
|||
public virtual void Render(ScriptableRenderContext renderContext, Camera[] cameras) |
|||
{ |
|||
if (disposed) |
|||
throw new ObjectDisposedException(string.Format("{0} has been disposed. Do not call Render on disposed RenderLoops.", this)); |
|||
} |
|||
|
|||
public bool disposed { get; private set; } |
|||
|
|||
public virtual void Dispose() |
|||
{ |
|||
disposed = true; |
|||
} |
|||
} |
|||
} |
896
Assets/TestScenes/HDTest/LayeredLitTest.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
#pragma kernel ShadeOpaque_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Fptl USE_FPTL_LIGHTLIST=1 |
|||
#pragma kernel ShadeOpaque_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Clustered USE_CLUSTERED_LIGHTLIST=1 |
|||
|
|||
|
|||
#define LIGHTLOOP_TILE_PASS 1 |
|||
#define LIGHTLOOP_TILE_DIRECT 1 |
|||
#define LIGHTLOOP_TILE_INDIRECT 1 |
|||
#define LIGHTLOOP_TILE_ALL 1 |
|||
#define USE_FPTL_LIGHTLIST 1 |
|||
|
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Include |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#include "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), |
|||
// the deferred shader will require to use multicompile. |
|||
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderConfig.cs.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/ShaderVariables.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/Lighting.hlsl" // This include Material.hlsl |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// variable declaration |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
DECLARE_GBUFFER_TEXTURE(_GBufferTexture); |
|||
|
|||
TEXTURE2D(_CameraDepthTexture); |
|||
SAMPLER2D(sampler_CameraDepthTexture); |
|||
|
|||
RWTexture2D<float4> uavOutput; |
|||
|
|||
[numthreads(TILE_SIZE, TILE_SIZE, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID) |
|||
{ |
|||
// input.positionCS is SV_Position |
|||
uint2 pixelCoord = dispatchThreadId; |
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw); |
|||
float depth = LOAD_TEXTURE2D(_CameraDepthTexture, 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, bsdfData, bakeDiffuseLighting); |
|||
|
|||
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); |
|||
|
|||
float3 diffuseLighting; |
|||
float3 specularLighting; |
|||
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, diffuseLighting, specularLighting); |
|||
|
|||
uavOutput[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0); |
|||
} |
|||
|
|||
#pragma kernel ShadeOpaque_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Fptl USE_FPTL_LIGHTLIST=1 |
|||
#pragma kernel ShadeOpaque_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Clustered USE_CLUSTERED_LIGHTLIST=1 |
|||
|
|||
|
|||
#define LIGHTLOOP_TILE_PASS 1 |
|||
#define LIGHTLOOP_TILE_DIRECT 1 |
|||
#define LIGHTLOOP_TILE_INDIRECT 1 |
|||
#define LIGHTLOOP_TILE_ALL 1 |
|||
#define USE_FPTL_LIGHTLIST 1 |
|||
|
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Include |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#include "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), |
|||
// the deferred shader will require to use multicompile. |
|||
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl |
|||
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderConfig.cs.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/ShaderVariables.hlsl" |
|||
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/Lighting.hlsl" // This include Material.hlsl |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// variable declaration |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
DECLARE_GBUFFER_TEXTURE(_GBufferTexture); |
|||
|
|||
TEXTURE2D(_CameraDepthTexture); |
|||
SAMPLER2D(sampler_CameraDepthTexture); |
|||
|
|||
RWTexture2D<float4> uavOutput; |
|||
|
|||
[numthreads(TILE_SIZE, TILE_SIZE, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID) |
|||
{ |
|||
// input.positionCS is SV_Position |
|||
uint2 pixelCoord = dispatchThreadId; |
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw); |
|||
float depth = LOAD_TEXTURE2D(_CameraDepthTexture, 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, bsdfData, bakeDiffuseLighting); |
|||
|
|||
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); |
|||
|
|||
float3 diffuseLighting; |
|||
float3 specularLighting; |
|||
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, diffuseLighting, specularLighting); |
|||
|
|||
uavOutput[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0); |
|||
} |
|||
|
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue