浏览代码

Compilation fixes

/main
Frédéric Vauchelles 6 年前
当前提交
4ddbdad5
共有 2 个文件被更改,包括 18 次插入15 次删除
  1. 27
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ScreenSpaceTracing.hlsl
  2. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl

27
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ScreenSpaceTracing.hlsl


#ifdef SSRTID
#define SSRT_SETTING(name) _SS#SSRTID#name
#define SSRT_FUNC(name) name#SSRTID
#define SSRT_SETTING(name) _SS ## SSRTID ## name
#define SSRT_FUNC(name) name ## SSRTID
CBUFFER_START(SSRT_FUNC(UnityScreenSpaceRaymarching)
CBUFFER_START(SSRT_FUNC(UnityScreenSpaceRaymarching))
int SSRT_SETTING(RayMinLevel);
int SSRT_SETTING(RayMaxLevel);
int SSRT_SETTING(RayMaxIterations);

bool SSRT_FUNC(ScreenSpaceProxyRaycast)(
ScreenSpaceEstimateRaycastInput input,
ScreenSpaceProxyRaycastInput input,
out ScreenSpaceRayHit hit
)
{

}
float3 hitPositionWS = input.rayOriginWS + input.rayDirWS * projectionDistance;
float3 hitPositionCS = ComputeClipSpacePosition(hitPositionWS, GetWorldToHClipMatrix());
float4 hitPositionCS = ComputeClipSpacePosition(hitPositionWS, GetWorldToHClipMatrix());
float2 hitPositionNDC = ComputeNormalizedDeviceCoordinates(hitPositionWS, GetWorldToHClipMatrix());
uint2 hitPositionSS = uint2(hitPositionNDC *_ScreenSize.xy);
float hitLinearDepth = hitPositionCS.w;

input.positionNDC = hitPositionNDC;
input.positionSS = hitPositionSS;
input.linearDepth = hitLinearDepth;
hit.positionNDC = hitPositionNDC;
hit.positionSS = hitPositionSS;
hit.linearDepth = hitLinearDepth;
bool hitSuccessful = linearDepth >= hitLinearDepth;

ZERO_INITIALIZE(ScreenSpaceRayHit, hit);
bool hitSuccessful = true;
uint iteration = 0u;
int minMipLevel = max(SSRT_SETTING(MinLevel), 0);
int maxMipLevel = min(SSRT_SETTING(MaxLevel), int(_DepthPyramidScale.z));
int minMipLevel = max(SSRT_SETTING(RayMinLevel), 0);
int maxMipLevel = min(SSRT_SETTING(RayMaxLevel), int(_DepthPyramidScale.z));
uint maxIterations = min(input.maxIterations, SSRT_SETTING(MaxIterations));
uint maxIterations = min(input.maxIterations, SSRT_SETTING(RayMaxIterations));
float3 startPositionSS;
float3 raySS;

hit.positionNDC = float2(positionSS.xy) / float2(bufferSize);
hit.positionSS = uint2(positionSS.xy);
if (hit.linearDepth > (1 / invHiZDepth) + SSRT_SETTING(DepthSuccessBias))
if (hit.linearDepth > (1 / invHiZDepth) + SSRT_SETTING(RayDepthSuccessBias))
hitSuccessful = false;
#ifdef DEBUG_DISPLAY

startPositionSS,
hitSuccessful,
iteration,
SSRT_SETTING(MaxIterations),
SSRT_SETTING(RayMaxIterations),
maxMipLevel,
maxUsedLevel,
intersectionKind,

}
#undef SSRT_SETTING
#undef SSRT_FUNC
#endif

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


#if HAS_REFRACTION
# include "CoreRP/ShaderLibrary/Refraction.hlsl"
# include "HDRP/Lighting/Reflection/VolumeProjection.hlsl"
# include "HDRP/Lighting/LightDefinition.cs.hlsl"
# define SSRTID Refraction
# include "HDRP/Lighting/Reflection/ScreenSpaceTracing.hlsl"
# undef SSRTID

# if defined(_REFRACTION_SSRAY_PROXY)
# define REFRACTION_SSRAY_IN ScreenSpaceProxyRaycastInput
# define REFRACTION_SSRAY_QUERY(input, hit) ScreenSpaceProxyRaycastRefraction(input, out hit)
# define REFRACTION_SSRAY_QUERY(input, hit) ScreenSpaceProxyRaycastRefraction(input, hit)
# define REFRACTION_SSRAY_QUERY(input, hit) ScreenSpaceHiZRaymarchRefraction(input, out hit)
# define REFRACTION_SSRAY_QUERY(input, hit) ScreenSpaceHiZRaymarchRefraction(input, hit)
# endif
#endif

正在加载...
取消
保存