浏览代码

Add SHADERPASS_SHADOWS

/RenderPassXR_Sandbox
Evgenii Golubev 7 年前
当前提交
df0f7a32
共有 8 个文件被更改,包括 10 次插入8 次删除
  1. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  2. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  3. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  4. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
  5. 3
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPass.cs
  6. 1
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPass.cs.hlsl
  7. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassDepthOnly.hlsl
  8. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderVariablesFunctions.hlsl

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


HLSLPROGRAM
#define SHADERPASS SHADERPASS_DEPTH_ONLY
#define SHADERPASS SHADERPASS_SHADOWS
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "../../ShaderVariables.hlsl"
#include "../../Material/Material.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


#pragma hull Hull
#pragma domain Domain
#define SHADERPASS SHADERPASS_DEPTH_ONLY
#define SHADERPASS SHADERPASS_SHADOWS
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "../../ShaderVariables.hlsl"
#include "../../Material/Material.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


HLSLPROGRAM
#define SHADERPASS SHADERPASS_DEPTH_ONLY
#define SHADERPASS SHADERPASS_SHADOWS
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "../../ShaderVariables.hlsl"
#include "../../Material/Material.hlsl"

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


#pragma hull Hull
#pragma domain Domain
#define SHADERPASS SHADERPASS_DEPTH_ONLY
#define SHADERPASS SHADERPASS_SHADOWS
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "../../ShaderVariables.hlsl"
#include "../../Material/Material.hlsl"

3
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPass.cs


DepthOnly,
Velocity,
Distortion,
LightTransport
LightTransport,
Shadows
}
}

1
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPass.cs.hlsl


#define SHADERPASS_VELOCITY (4)
#define SHADERPASS_DISTORTION (5)
#define SHADERPASS_LIGHT_TRANSPORT (6)
#define SHADERPASS_SHADOWS (7)
#endif

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassDepthOnly.hlsl


#if SHADERPASS != SHADERPASS_DEPTH_ONLY
#if (SHADERPASS != SHADERPASS_DEPTH_ONLY && SHADERPASS != SHADERPASS_SHADOWS)
#error SHADERPASS_is_not_correctly_define
#endif

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderVariablesFunctions.hlsl


float3 GetCurrentCameraPosition()
{
#if defined(SHADERPASS) && (SHADERPASS != SHADERPASS_DEPTH_ONLY)
#if defined(SHADERPASS) && (SHADERPASS != SHADERPASS_SHADOWS)
return _WorldSpaceCameraPos;
#else
// TEMP: this is rather expensive. Then again, we need '_WorldSpaceCameraPos'

// Returns 'true' if the current camera performs a perspective projection.
bool IsPerspectiveCamera()
{
#if defined(SHADERPASS) && (SHADERPASS != SHADERPASS_DEPTH_ONLY)
#if defined(SHADERPASS) && (SHADERPASS != SHADERPASS_SHADOWS)
return (unity_OrthoParams.w == 0);
#else
// TODO: set 'unity_OrthoParams' during the shadow pass.

正在加载...
取消
保存