浏览代码

HDRenderPipeline: update

/main
sebastienlagarde 7 年前
当前提交
fc1dcdf1
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 16
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl

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


// If you're not using the feature classification system, pass UINT_MAX.
// Also, see comment in TileVariantToFeatureFlags. When we are the worse case (i.e last variant), we read the featureflags
// from the structured buffer use to generate the indirect draw call. It allow to not go through all branch and the branch is scalar (not VGPR)
uint DecodeFromGBuffer(uint2 positionSS, uint inTileFeatureFlags, out BSDFData bsdfData, out float3 bakeDiffuseLighting)
uint DecodeFromGBuffer(uint2 positionSS, uint tileFeatureFlags, out BSDFData bsdfData, out float3 bakeDiffuseLighting)
// Isolate material features.
uint tileFeatureFlags = inTileFeatureFlags & MATERIAL_FEATURE_MASK_FLAGS;
bsdfData.materialFeatures = tileFeatureFlags; // Only tile-uniform feature evaluation
GBufferType0 inGBuffer0 = LOAD_TEXTURE2D(_GBufferTexture0, positionSS);
GBufferType1 inGBuffer1 = LOAD_TEXTURE2D(_GBufferTexture1, positionSS);

// If tileFeatureFlags == UINT_MAX it mean we are call from deferred.shader (or a debug mode) that have no classification
// in this case for the sake of performance saving we should rely on pixelFeatureFlags
// TODO: validate that this doesn't hurst performance somewhere with classification
if (inTileFeatureFlags == UINT_MAX)
if (tileFeatureFlags == UINT_MAX)
{
tileFeatureFlags = pixelFeatureFlags;
}
else
{
bsdfData.materialFeatures = tileFeatureFlags;
}
// Decompress feature-agnostic data from the G-Buffer.
float3 baseColor = inGBuffer0.rgb;

正在加载...
取消
保存