浏览代码

Capitalized unpack function name.

/main
uygar 7 年前
当前提交
4d0a2ea9
共有 2 个文件被更改,包括 12 次插入12 次删除
  1. 8
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/Shadow.hlsl
  2. 16
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowAlgorithms.hlsl

8
Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/Shadow.hlsl


#include "ShadowContext.hlsl"
// helper function to extract shadowmap data from the ShadowData struct
void unpackShadowmapId( uint shadowmapId, out uint texIdx, out uint sampIdx, out float slice )
void UnpackShadowmapId( uint shadowmapId, out uint texIdx, out uint sampIdx, out float slice )
void unpackShadowmapId( uint shadowmapId, out uint texIdx, out uint sampIdx )
void UnpackShadowmapId( uint shadowmapId, out uint texIdx, out uint sampIdx )
void unpackShadowmapId( uint shadowmapId, out float slice )
void UnpackShadowmapId( uint shadowmapId, out float slice )
{
slice = (float)(shadowmapId & 0xffff);
}

// wedge in the actual shadow sampling algorithms
#include "ShadowSampling.hlsl" // sampling patterns
#include "ShadowSampling.hlsl" // sampling patterns (don't modify)
#include "ShadowAlgorithms.hlsl" // engine default algorithms (don't modify)
#include "ShadowAlgorithmsCustom.hlsl" // project specific custom algorithms (project can modify this)

16
Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/ShadowAlgorithms.hlsl


// sample the texture
uint texIdx, sampIdx;
float slice;
unpackShadowmapId( sd.id, texIdx, sampIdx, slice );
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice );
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, texIdx, sampIdx );
}

float3 posTC = EvalShadow_GetTexcoords( sd, positionWS );
// sample the texture
float slice;
unpackShadowmapId( sd.id, slice );
UnpackShadowmapId( sd.id, slice );
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, tex, compSamp );
}

// sample the texture
uint texIdx, sampIdx;
float slice;
unpackShadowmapId( sd.id, texIdx, sampIdx, slice );
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice );
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, texIdx, sampIdx );
}

float3 posTC = EvalShadow_GetTexcoords( sd, positionWS );
// sample the texture
float slice;
unpackShadowmapId( sd.id, slice );
UnpackShadowmapId( sd.id, slice );
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, tex, compSamp );
}

// sample the texture
uint texIdx, sampIdx;
float slice;
unpackShadowmapId( sd.id, texIdx, sampIdx, slice );
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice );
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, texIdx, sampIdx );
}

float3 posTC = EvalShadow_GetTexcoords( sd, positionWS );
// sample the texture
float slice;
unpackShadowmapId( sd.id, slice );
UnpackShadowmapId( sd.id, slice );
return SampleShadow_PCF_1tap( shadowContext, posTC, slice, tex, compSamp );
}

// sample the texture
uint texIdx, sampIdx;
float slice;
unpackShadowmapId( sd.id, texIdx, sampIdx, slice );
UnpackShadowmapId( sd.id, texIdx, sampIdx, slice );
return SampleShadow_PCF_9tap_Adaptive( shadowContext, sd.texelSizeRcp, posTC, slice, texIdx, sampIdx );
}

float3 posTC = EvalShadow_GetTexcoords( sd, positionWS );
// sample the texture
float slice;
unpackShadowmapId(sd.id, slice);
UnpackShadowmapId(sd.id, slice);
return SampleShadow_PCF_9tap_Adaptive( shadowContext, sd.texelSizeRcp, posTC, slice, tex, compSamp );
}
正在加载...
取消
保存