sebastienlagarde
6 年前
当前提交
26c608bb
共有 24 个文件被更改,包括 188 次插入 和 144 次删除
-
6com.unity.render-pipelines.core/CoreRP/ShaderLibrary/ImageBasedLighting.hlsl
-
20com.unity.render-pipelines.high-definition/HDRP/Debug/DebugDisplay.cs
-
1com.unity.render-pipelines.high-definition/HDRP/Debug/DebugFullScreen.shader
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs
-
16com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Lit/LitUI.cs
-
24com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs
-
15com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs.hlsl
-
13com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl
-
8com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs
-
94com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceLighting.cs
-
24com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceLighting.cs.hlsl
-
9com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceLighting.cs.hlsl.meta
-
16com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceLighting.hlsl
-
9com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceLighting.hlsl.meta
-
69com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/ScreenSpaceLighting.cs
-
0/com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceRefraction.cs.meta
-
0/com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceTracing.hlsl.meta
-
0/com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceLighting.cs.meta
-
0/com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs
-
0/com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs.meta
-
0/com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceRefraction.cs
-
0/com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceTracing.hlsl
|
|||
using System; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[Serializable] |
|||
public abstract class ScreenSpaceLighting : VolumeComponent |
|||
{ |
|||
public enum RefractionModel |
|||
{ |
|||
None = 0, |
|||
Plane = 1, |
|||
Sphere = 2 |
|||
}; |
|||
|
|||
[GenerateHLSL] |
|||
public enum ProjectionModel |
|||
{ |
|||
None = 0, |
|||
Proxy = 1, |
|||
HiZ = 2, |
|||
Linear = 3, |
|||
Count |
|||
}; |
|||
|
|||
[GenerateHLSL] |
|||
public enum HiZIntersectionKind |
|||
{ |
|||
None, |
|||
Cell, |
|||
Depth |
|||
} |
|||
|
|||
int m_RayLevelID; |
|||
int m_RayMinLevelID; |
|||
int m_RayMaxLevelID; |
|||
int m_RayMaxIterationsID; |
|||
int m_DepthBufferThicknessID; |
|||
int m_InvScreenWeightDistanceID; |
|||
int m_RayMaxScreenDistanceID; |
|||
int m_RayBlendScreenDistanceID; |
|||
int m_RayMarchBehindObjectsID; |
|||
|
|||
public IntParameter rayLevel = new IntParameter(2); |
|||
public IntParameter rayMinLevel = new IntParameter(2); |
|||
public IntParameter rayMaxLevel = new IntParameter(6); |
|||
public IntParameter rayMaxIterations = new IntParameter(32); |
|||
public FloatParameter depthBufferThickness = new FloatParameter(1f); |
|||
public ClampedFloatParameter screenWeightDistance = new ClampedFloatParameter(0.1f, 0, 1); |
|||
public ClampedFloatParameter rayMaxScreenDistance = new ClampedFloatParameter(0.3f, 0, 1); |
|||
public ClampedFloatParameter rayBlendScreenDistance = new ClampedFloatParameter(0.1f, 0, 1); |
|||
public BoolParameter rayMarchBehindObjects = new BoolParameter(true); |
|||
|
|||
public virtual void PushShaderParameters(CommandBuffer cmd) |
|||
{ |
|||
cmd.SetGlobalInt(m_RayLevelID, rayLevel.value); |
|||
cmd.SetGlobalInt(m_RayMinLevelID, rayMinLevel.value); |
|||
cmd.SetGlobalInt(m_RayMaxLevelID, rayMaxLevel.value); |
|||
cmd.SetGlobalInt(m_RayMaxIterationsID, rayMaxIterations.value); |
|||
cmd.SetGlobalFloat(m_DepthBufferThicknessID, depthBufferThickness.value); |
|||
cmd.SetGlobalFloat(m_InvScreenWeightDistanceID, 1f / screenWeightDistance.value); |
|||
cmd.SetGlobalFloat(m_RayMaxScreenDistanceID, rayMaxScreenDistance.value); |
|||
cmd.SetGlobalFloat(m_RayBlendScreenDistanceID, rayBlendScreenDistance.value); |
|||
cmd.SetGlobalInt(m_RayMarchBehindObjectsID, rayMarchBehindObjects.value ? 1 : 0); |
|||
} |
|||
|
|||
protected abstract void FetchIDs( |
|||
out int rayLevelID, |
|||
out int rayMinLevelID, |
|||
out int rayMaxLevelID, |
|||
out int rayMaxIterationsID, |
|||
out int DepthBufferThicknessID, |
|||
out int invScreenWeightDistanceID, |
|||
out int rayMaxScreenDistanceID, |
|||
out int rayBlendScreenDistanceID, |
|||
out int rayMarchBehindObjectsID |
|||
); |
|||
|
|||
void Awake() |
|||
{ |
|||
FetchIDs( |
|||
out m_RayLevelID, |
|||
out m_RayMinLevelID, |
|||
out m_RayMaxLevelID, |
|||
out m_RayMaxIterationsID, |
|||
out m_DepthBufferThicknessID, |
|||
out m_InvScreenWeightDistanceID, |
|||
out m_RayMaxScreenDistanceID, |
|||
out m_RayBlendScreenDistanceID, |
|||
out m_RayMarchBehindObjectsID |
|||
); |
|||
} |
|||
} |
|||
} |
|
|||
// |
|||
// This file was automatically generated. Please don't edit by hand. |
|||
// |
|||
|
|||
#ifndef SCREENSPACELIGHTING_CS_HLSL |
|||
#define SCREENSPACELIGHTING_CS_HLSL |
|||
// |
|||
// UnityEngine.Experimental.Rendering.HDPipeline.ScreenSpaceLighting+ProjectionModel: static fields |
|||
// |
|||
#define PROJECTIONMODEL_NONE (0) |
|||
#define PROJECTIONMODEL_PROXY (1) |
|||
#define PROJECTIONMODEL_HI_Z (2) |
|||
#define PROJECTIONMODEL_LINEAR (3) |
|||
#define PROJECTIONMODEL_COUNT (4) |
|||
|
|||
// |
|||
// UnityEngine.Experimental.Rendering.HDPipeline.ScreenSpaceLighting+HiZIntersectionKind: static fields |
|||
// |
|||
#define HIZINTERSECTIONKIND_NONE (0) |
|||
#define HIZINTERSECTIONKIND_CELL (1) |
|||
#define HIZINTERSECTIONKIND_DEPTH (2) |
|||
|
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 117f0ba79109fbf49a6f34d915d965d0 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifndef UNITY_SCREENSPACELIGHTING_INCLUDED |
|||
#define UNITY_SCREENSPACELIGHTING_INCLUDED |
|||
|
|||
#include "HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceLighting.cs.hlsl" |
|||
#include "HDRP/Lighting/Reflection/VolumeProjection.hlsl" |
|||
|
|||
#define SSRTID Reflection |
|||
#include "HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceTracing.hlsl" |
|||
#undef SSRTID |
|||
|
|||
#include "CoreRP/ShaderLibrary/Refraction.hlsl" |
|||
#define SSRTID Refraction |
|||
#include "HDRP/Lighting/ScreenSpaceLighting/ScreenSpaceTracing.hlsl" |
|||
#undef SSRTID |
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 7f4f99197456f344d9545ac794d20867 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[Serializable] |
|||
public abstract class ScreenSpaceLighting : VolumeComponent |
|||
{ |
|||
int m_RayLevelID; |
|||
int m_RayMinLevelID; |
|||
int m_RayMaxLevelID; |
|||
int m_RayMaxIterationsID; |
|||
int m_DepthBufferThicknessID; |
|||
int m_InvScreenWeightDistanceID; |
|||
int m_RayMaxScreenDistanceID; |
|||
int m_RayBlendScreenDistanceID; |
|||
int m_RayMarchBehindObjectsID; |
|||
|
|||
public IntParameter rayLevel = new IntParameter(2); |
|||
public IntParameter rayMinLevel = new IntParameter(2); |
|||
public IntParameter rayMaxLevel = new IntParameter(6); |
|||
public IntParameter rayMaxIterations = new IntParameter(32); |
|||
public FloatParameter depthBufferThickness = new FloatParameter(1f); |
|||
public ClampedFloatParameter screenWeightDistance = new ClampedFloatParameter(0.1f, 0, 1); |
|||
public ClampedFloatParameter rayMaxScreenDistance = new ClampedFloatParameter(0.3f, 0, 1); |
|||
public ClampedFloatParameter rayBlendScreenDistance = new ClampedFloatParameter(0.1f, 0, 1); |
|||
public BoolParameter rayMarchBehindObjects = new BoolParameter(true); |
|||
|
|||
public virtual void PushShaderParameters(CommandBuffer cmd) |
|||
{ |
|||
cmd.SetGlobalInt(m_RayLevelID, rayLevel.value); |
|||
cmd.SetGlobalInt(m_RayMinLevelID, rayMinLevel.value); |
|||
cmd.SetGlobalInt(m_RayMaxLevelID, rayMaxLevel.value); |
|||
cmd.SetGlobalInt(m_RayMaxIterationsID, rayMaxIterations.value); |
|||
cmd.SetGlobalFloat(m_DepthBufferThicknessID, depthBufferThickness.value); |
|||
cmd.SetGlobalFloat(m_InvScreenWeightDistanceID, 1f / screenWeightDistance.value); |
|||
cmd.SetGlobalFloat(m_RayMaxScreenDistanceID, rayMaxScreenDistance.value); |
|||
cmd.SetGlobalFloat(m_RayBlendScreenDistanceID, rayBlendScreenDistance.value); |
|||
cmd.SetGlobalInt(m_RayMarchBehindObjectsID, rayMarchBehindObjects.value ? 1 : 0); |
|||
} |
|||
|
|||
protected abstract void FetchIDs( |
|||
out int rayLevelID, |
|||
out int rayMinLevelID, |
|||
out int rayMaxLevelID, |
|||
out int rayMaxIterationsID, |
|||
out int DepthBufferThicknessID, |
|||
out int invScreenWeightDistanceID, |
|||
out int rayMaxScreenDistanceID, |
|||
out int rayBlendScreenDistanceID, |
|||
out int rayMarchBehindObjectsID |
|||
); |
|||
|
|||
void Awake() |
|||
{ |
|||
FetchIDs( |
|||
out m_RayLevelID, |
|||
out m_RayMinLevelID, |
|||
out m_RayMaxLevelID, |
|||
out m_RayMaxIterationsID, |
|||
out m_DepthBufferThicknessID, |
|||
out m_InvScreenWeightDistanceID, |
|||
out m_RayMaxScreenDistanceID, |
|||
out m_RayBlendScreenDistanceID, |
|||
out m_RayMarchBehindObjectsID |
|||
); |
|||
} |
|||
} |
|||
} |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue