浏览代码

Merge pull request #1139 from Unity-Technologies/feature/PyramidBuffer

Restored sky lighting override mask
/main
GitHub 6 年前
当前提交
a022b93b
共有 5 个文件被更改,包括 170 次插入1 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.asset
  2. 20
      ScriptableRenderPipeline/Core/CoreRP/RectInt.cs
  3. 11
      ScriptableRenderPipeline/Core/CoreRP/RectInt.cs.meta
  4. 127
      ScriptableRenderPipeline/Core/CoreRP/TileLayoutUtils.cs
  5. 11
      ScriptableRenderPipeline/Core/CoreRP/TileLayoutUtils.cs.meta

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.asset


skyReflectionSize: 256
skyLightingOverrideLayerMask:
serializedVersion: 2
m_Bits: 0
m_Bits: 256
shadowInitParams:
shadowAtlasWidth: 4096
shadowAtlasHeight: 4096

20
ScriptableRenderPipeline/Core/CoreRP/RectInt.cs


namespace UnityEngine.Experimental.Rendering
{
public struct RectInt
{
public static readonly RectInt zero = new RectInt(0, 0, 0, 0);
public int x;
public int y;
public int width;
public int height;
public RectInt(int x, int y, int width, int height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/RectInt.cs.meta


fileFormatVersion: 2
guid: c8e81b226dbe13441ab23fbc3719f78c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

127
ScriptableRenderPipeline/Core/CoreRP/TileLayoutUtils.cs


namespace UnityEngine.Experimental.Rendering
{
public static class TileLayoutUtils
{
public static bool TryLayoutByTiles(
RectInt src,
uint tileSize,
out RectInt main,
out RectInt topRow,
out RectInt rightCol,
out RectInt topRight)
{
if (src.width < tileSize || src.height < tileSize)
{
main = RectInt.zero;
topRow = RectInt.zero;
rightCol = RectInt.zero;
topRight = RectInt.zero;
return false;
}
int mainRows = src.height / (int)tileSize;
int mainCols = src.width / (int)tileSize;
int mainWidth = mainCols * (int)tileSize;
int mainHeight = mainRows * (int)tileSize;
main = new RectInt
{
x = src.x,
y = src.y,
width = mainWidth,
height = mainHeight,
};
topRow = new RectInt
{
x = src.x,
y = src.y + mainHeight,
width = mainWidth,
height = src.height - mainHeight
};
rightCol = new RectInt
{
x = src.x + mainWidth,
y = src.y,
width = src.width - mainWidth,
height = mainHeight
};
topRight = new RectInt
{
x = src.x + mainWidth,
y = src.y + mainHeight,
width = src.width - mainWidth,
height = src.height - mainHeight
};
return true;
}
public static bool TryLayoutByRow(
RectInt src,
uint tileSize,
out RectInt main,
out RectInt other)
{
if (src.height < tileSize)
{
main = RectInt.zero;
other = RectInt.zero;
return false;
}
int mainRows = src.height / (int)tileSize;
int mainHeight = mainRows * (int)tileSize;
main = new RectInt
{
x = src.x,
y = src.y,
width = src.width,
height = mainHeight,
};
other = new RectInt
{
x = src.x,
y = src.y + mainHeight,
width = src.width,
height = src.height - mainHeight
};
return true;
}
public static bool TryLayoutByCol(
RectInt src,
uint tileSize,
out RectInt main,
out RectInt other)
{
if (src.width < tileSize)
{
main = RectInt.zero;
other = RectInt.zero;
return false;
}
int mainCols = src.width / (int)tileSize;
int mainWidth = mainCols * (int)tileSize;
main = new RectInt
{
x = src.x,
y = src.y,
width = mainWidth,
height = src.height,
};
other = new RectInt
{
x = src.x + mainWidth,
y = src.y,
width = src.width - mainWidth,
height = src.height
};
return true;
}
}
}

11
ScriptableRenderPipeline/Core/CoreRP/TileLayoutUtils.cs.meta


fileFormatVersion: 2
guid: 39aaac96b648c194298b5441a11fd53a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存