浏览代码

Add some comment

/main
sebastienlagarde 7 年前
当前提交
e06338d1
共有 2 个文件被更改,包括 9 次插入6 次删除
  1. 13
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl
  2. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/Unlit/Unlit.shader

13
com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl


// #define LIT_DISPLAY_REFERENCE_IBL
#endif
// In forward we can chose between reading the normal from the normalBufferTexture or computing it again
// This is tradeoff between performance and quality. As we store the normal conpressed, recomputing again is higher quality.
// Uncomment this to get speed (to measure), let it comment to get quality
// #define FORWARD_MATERIAL_READ_FROM_WRITTEN_NORMAL_BUFFER
//-----------------------------------------------------------------------------
// Ligth and material classification for the deferred rendering path
// Configure what kind of combination is supported

BSDFData bsdfData;
ZERO_INITIALIZE(BSDFData, bsdfData);
// In forward we can chose between reading the normal from the normalBufferTexture or computing it again
// Reading normal will suffer from compression, thus using following code depends on tradeoff between performance and quality.
// Test it for your project
//#define READ_FORWARD_NORMAL_FROM_TEXTURE
#ifdef READ_FORWARD_NORMAL_FROM_TEXTURE
// Check if we read value of normal and roughness from buffer. This is a tradeoff
#ifdef FORWARD_MATERIAL_READ_FROM_WRITTEN_NORMAL_BUFFER
#if (SHADERPASS == SHADERPASS_FORWARD) && !defined(_SURFACE_TYPE_TRANSPARENT)
UpdateSurfaceDataFromNormalData(positionSS, surfaceData);
#endif

2
com.unity.render-pipelines.high-definition/HDRP/Material/Unlit/Unlit.shader


ZWrite On
ColorMask 0 // We don't have WRITE_NORMAL_BUFFER for unlit, but as we bind a buffer we shouldn't write into it.
HLSLPROGRAM
#define SHADERPASS SHADERPASS_DEPTH_ONLY

正在加载...
取消
保存