浏览代码

- Renamed texture cache "update count" tout "slice entry hash"

- Updated real time cubemap scene baked data
/Add-support-for-light-specular-color-tint
Julien Ignace 7 年前
当前提交
1f62747c
共有 6 个文件被更改,包括 900 次插入1149 次删除
  1. 9
      SampleScenes/HDTest/GraphicTest/RealtimeCubemaps.unity
  2. 14
      SampleScenes/HDTest/GraphicTest/RealtimeCubemaps/LightingData.asset
  3. 1001
      SampleScenes/HDTest/GraphicTest/RealtimeCubemaps/ReflectionProbe-1.exr
  4. 1001
      SampleScenes/HDTest/GraphicTest/RealtimeCubemaps/ReflectionProbe-2.exr
  5. 22
      ScriptableRenderPipeline/Core/TextureCache.cs
  6. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/ReflectionProbeCache.cs

9
SampleScenes/HDTest/GraphicTest/RealtimeCubemaps.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.07875386, g: 0.07704143, b: 0.066761576, a: 1}
m_IndirectSpecularColor: {r: 0.14189717, g: 0.17226046, b: 0.23257986, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 1
m_InnerSpotPercent: 0
lightDimmer: 1
fadeDistance: 10000

m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 1
m_InnerSpotPercent: 0
lightDimmer: 1
fadeDistance: 10000

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!108 &1206227981
Light:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 1
m_InnerSpotPercent: 0
lightDimmer: 1
fadeDistance: 10000

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1300125701}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.84, y: 0.9, z: 2.58}
m_LocalPosition: {x: 1.84, y: 0.9, z: 2.608}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1047094239}

14
SampleScenes/HDTest/GraphicTest/RealtimeCubemaps/LightingData.asset
文件差异内容过多而无法显示
查看文件

1001
SampleScenes/HDTest/GraphicTest/RealtimeCubemaps/ReflectionProbe-1.exr
文件差异内容过多而无法显示
查看文件

1001
SampleScenes/HDTest/GraphicTest/RealtimeCubemaps/ReflectionProbe-2.exr
文件差异内容过多而无法显示
查看文件

22
ScriptableRenderPipeline/Core/TextureCache.cs


{
public uint texId;
public uint countLRU;
public uint updateCount;
public uint sliceEntryHash;
};
private int m_NumTextures;

private static uint g_InvalidTexID = (uint)0;
public uint GetTextureUpdateCount(Texture texture)
public uint GetTextureHash(Texture texture)
uint updateCount = texture.updateCount;
uint textureHash = texture.updateCount;
updateCount += (uint)texture.imageContentsHash.GetHashCode();
textureHash += (uint)texture.imageContentsHash.GetHashCode();
return updateCount;
return textureHash;
}
public int ReserveSlice(Texture texture, out bool needUpdate)

{
sliceIndex = foundIndex;
var updateCount = GetTextureUpdateCount(texture);
needUpdate |= (m_SliceArray[sliceIndex].updateCount != updateCount);
var textureHash = GetTextureHash(texture);
needUpdate |= (m_SliceArray[sliceIndex].sliceEntryHash != textureHash);
Debug.Assert(m_SliceArray[sliceIndex].texId == texId);
}

// In case the texture content with which we update the cache is not the input texture, we need to provide the right update count.
public void UpdateSlice(CommandBuffer cmd, int sliceIndex, Texture content, uint updateCount)
{
public void UpdateSlice(CommandBuffer cmd, int sliceIndex, Texture content, uint textureHash)
{
m_SliceArray[sliceIndex].updateCount = updateCount;
m_SliceArray[sliceIndex].sliceEntryHash = textureHash;
UpdateSlice(cmd, sliceIndex, content, GetTextureUpdateCount(content));
UpdateSlice(cmd, sliceIndex, content, GetTextureHash(content));
}
public int FetchSlice(CommandBuffer cmd, Texture texture, bool forceReinject=false)

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/ReflectionProbeCache.cs


if (result == null)
return -1;
m_TextureCache.UpdateSlice(cmd, sliceIndex, result, m_TextureCache.GetTextureUpdateCount(texture)); // Be careful to provide the update count from the input texture, not the temporary one used for convolving.
m_TextureCache.UpdateSlice(cmd, sliceIndex, result, m_TextureCache.GetTextureHash(texture)); // Be careful to provide the update count from the input texture, not the temporary one used for convolving.
m_ProbeBakingState[sliceIndex] = ProbeFilteringState.Ready;
}

正在加载...
取消
保存