浏览代码

Comment cleanup + steorize last function

The hard part (buffer index gen) is coming up!
/main
Robert Srinivasiah 6 年前
当前提交
f953f444
共有 1 个文件被更改,包括 8 次插入11 次删除
  1. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild-clustered.compute

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild-clustered.compute


CBUFFER_END
// ClusteredUtils.hlsl is dependent on the constants declared in UnityLightListClustered :/
// g_fClustBase
// g_fNearPlane
// g_fFarPlane
// g_iLog2NumClusters
// g_fClustBase, g_fNearPlane, g_fFarPlane, g_iLog2NumClusters
#include "ClusteredUtils.hlsl"
// XRTODO: Reading from these textures and buffers must be stereo-ized

groupshared uint lightOffsSph;
#endif
// XRTODO: Stereo-ize access to g_mInvScrProjection, pass in eyeIndex
// XRTODO - DONE: Stereo-ize access to g_mInvScrProjection, pass in eyeIndex
float GetLinearDepth(float zDptBufSpace, uint eyeIndex) // 0 is near 1 is far
{
float4x4 g_mInvScrProjection = g_mInvScrProjectionArr[eyeIndex];

// returns 1 for intersection and 0 for none
// XRTODO: Pass in eyeIndex
float4 FetchPlane(int l, int p);
// XRTODO - DONE: Pass in eyeIndex
float4 FetchPlane(int l, int p, uint eyeIndex);
// XRTODO - DONE: Stereo-ize due to access to GetViewPosFromLinDepth
// We need eyeIndex

int p = i>>2;
int m = i&3;
// XRTODO: Pass in eyeIndex to FetchPlane, as it looks into g_data (SFiniteLightBound)
if(i<24) lightPlanes[6*m+p] = FetchPlane(min(iNrCoarseLights-1,ll+m), p);
// XRTODO - DONE: Pass in eyeIndex to FetchPlane, as it looks into g_data (SFiniteLightBound)
if(i<24) lightPlanes[6*m+p] = FetchPlane(min(iNrCoarseLights-1,ll+m), p, eyeIndex);
// The first 24 threads in the TG each generate 1 plane equation. There are
// 6 planes per light, and we process 4 lights at a time, hence, 24 threads.

}
// XRTODO: Must be stereo-ized because it fetches from g_data
// XRTODO - DONE: Must be stereo-ized because it fetches from g_data
float4 FetchPlane(int l, int p)
float4 FetchPlane(int l, int p, uint eyeIndex)
{
// XRTODO: Use eyeIndex and coarseList[l] to index into g_data
// use GenerateLightCullDataIndex

正在加载...
取消
保存