浏览代码

Define REVERSE_ZBUF for Switch platform (Revisited)

/main
Sebastien Lagarde 7 年前
当前提交
ab065fbb
共有 1 个文件被更改,包括 2 次插入7 次删除
  1. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/ShaderBase.hlsl

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/ShaderBase.hlsl


#ifndef __SHADERBASE_H__
#define __SHADERBASE_H__
// can't use UNITY_REVERSED_Z since it's not enabled in compute shaders
#if !defined(SHADER_API_GLES3) && !defined(SHADER_API_GLCORE)
#define REVERSE_ZBUF
#endif
#ifdef SHADER_API_PSSL
#ifndef Texture2DMS

float FetchDepth(Texture2D depthTexture, uint2 pixCoord)
{
float zdpth = LOAD_TEXTURE2D(depthTexture, pixCoord.xy).x;
#ifdef REVERSE_ZBUF
#if UNITY_REVERSED_Z
zdpth = 1.0 - zdpth;
#endif
return zdpth;

{
float zdpth = LOAD_TEXTURE2D_MSAA(depthTexture, pixCoord.xy, sampleIdx).x;
#ifdef REVERSE_ZBUF
#if UNITY_REVERSED_Z
zdpth = 1.0 - zdpth;
#endif
return zdpth;

正在加载...
取消
保存