浏览代码

only invert z value when not in opengl

only invert z value when not in opengl
/main
mmikk 8 年前
当前提交
c67cdd6a
共有 2 个文件被更改,包括 20 次插入4 次删除
  1. 12
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/ShaderBase.hlsl
  2. 12
      Assets/ScriptableRenderLoop/common/ShaderBase.h

12
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/ShaderBase.hlsl


float FetchDepth(Texture2D depthTexture, uint2 pixCoord)
{
return 1.0 - LOAD_TEXTURE2D(depthTexture, pixCoord.xy).x;
float zdpth = LOAD_TEXTURE2D(depthTexture, pixCoord.xy).x;
#if !defined(SHADER_API_GLES3) && !defined(SHADER_API_GLCORE)
zdpth = 1.0 - zdpth;
#endif
return zdpth;
return 1.0 - LOAD_TEXTURE2D_MSAA(depthTexture, pixCoord.xy, sampleIdx).x;
float zdpth = LOAD_TEXTURE2D_MSAA(depthTexture, pixCoord.xy, sampleIdx).x;
#if !defined(SHADER_API_GLES3) && !defined(SHADER_API_GLCORE)
zdpth = 1.0 - zdpth;
#endif
return zdpth;
}
#endif

12
Assets/ScriptableRenderLoop/common/ShaderBase.h


float FetchDepth(Texture2D depthTexture, uint2 pixCoord)
{
return 1 - depthTexture.Load(uint3(pixCoord.xy, 0)).x;
float zdpth = depthTexture.Load(uint3(pixCoord.xy, 0)).x;
#if !defined(SHADER_API_GLES3) && !defined(SHADER_API_GLCORE)
zdpth = 1.0 - zdpth;
#endif
return zdpth;
return 1 - depthTexture.Load(uint3(pixCoord.xy, 0), sampleIdx).x;
float zdpth = depthTexture.Load(uint3(pixCoord.xy, 0), sampleIdx).x;
#if !defined(SHADER_API_GLES3) && !defined(SHADER_API_GLCORE)
zdpth = 1.0 - zdpth;
#endif
return zdpth;
}
#endif
正在加载...
取消
保存