浏览代码

Fix issues with viewID

/main
Evgenii Golubev 7 年前
当前提交
f551dea4
共有 2 个文件被更改,包括 8 次插入6 次删除
  1. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs
  2. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs


}
// Warning: different views can use the same camera!
public int GetViewID()
public long GetViewID()
int viewID = camera.GetInstanceID();
long viewID = camera.GetInstanceID();
// Make it positive.
viewID += (-(long)int.MinValue) + 1;
Debug.Assert(viewID > 0);
return viewID;
}

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs


}
class VBuffer
{
public int viewID = -1; // -1 is invalid; positive for Game Views, 0 otherwise
public long viewID = -1; // -1 is invalid; positive for Game Views, 0 otherwise
public RenderTexture[] lightingRTEX = null;
public RenderTargetIdentifier[] lightingRTID = null;

return lightingRTID[1 + ((Time.renderedFrameCount + 1) & 1)];
}
public void Create(int viewID, int w, int h, int d)
public void Create(long viewID, int w, int h, int d)
{
Debug.Assert(viewID >= 0);
Debug.Assert(w > 0 && h > 0 && d > 0);

{
if (preset == VolumetricLightingPreset.Off) return;
int viewID = camera.GetViewID();
long viewID = camera.GetViewID();
Debug.Assert(viewID >= 0);

vBuffer.Create(viewID, w, h, d);
}
VBuffer FindVBuffer(int viewID)
VBuffer FindVBuffer(long viewID)
{
Debug.Assert(viewID >= 0);

正在加载...
取消
保存