浏览代码

Supporting SkinnedMeshRenderer for labeling.

/main
Jon Hogins 4 年前
当前提交
50edc569
共有 6 个文件被更改,包括 14 次插入11 次删除
  1. 2
      com.unity.perception/Runtime/GroundTruth/GroundTruthCrossPipelinePass.cs
  2. 13
      com.unity.perception/Runtime/GroundTruth/GroundTruthLabelSetupSystem.cs
  3. 4
      com.unity.perception/Runtime/GroundTruth/IGroundTruthGenerator.cs
  4. 2
      com.unity.perception/Runtime/GroundTruth/InstanceSegmentationCrossPipelinePass.cs
  5. 2
      com.unity.perception/Runtime/GroundTruth/RenderedObjectInfoGenerator.cs
  6. 2
      com.unity.perception/Runtime/GroundTruth/SemanticSegmentationCrossPipelinePass.cs

2
com.unity.perception/Runtime/GroundTruth/GroundTruthCrossPipelinePass.cs


}
}
public abstract void SetupMaterialProperties(MaterialPropertyBlock mpb, MeshRenderer meshRenderer, Labeling labeling, uint instanceId);
public abstract void SetupMaterialProperties(MaterialPropertyBlock mpb, Renderer meshRenderer, Labeling labeling, uint instanceId);
}
}

13
com.unity.perception/Runtime/GroundTruth/GroundTruthLabelSetupSystem.cs


void InitGameObjectRecursive(GameObject gameObject, MaterialPropertyBlock mpb, Labeling labeling, uint instanceId)
{
var meshRenderer = gameObject.GetComponent<MeshRenderer>();
if (meshRenderer != null)
var renderer = (Renderer)gameObject.GetComponent<MeshRenderer>();
if (renderer == null)
renderer = gameObject.GetComponent<SkinnedMeshRenderer>();
if (renderer != null)
meshRenderer.GetPropertyBlock(mpb);
renderer.GetPropertyBlock(mpb);
pass.SetupMaterialProperties(mpb, meshRenderer, labeling, instanceId);
pass.SetupMaterialProperties(mpb, renderer, labeling, instanceId);
meshRenderer.SetPropertyBlock(mpb);
renderer.SetPropertyBlock(mpb);
}
for (var i = 0; i < gameObject.transform.childCount; i++)

4
com.unity.perception/Runtime/GroundTruth/IGroundTruthGenerator.cs


/// Called by <see cref="GroundTruthLabelSetupSystem"/> when first registered or when a Labeling is created at runtime.
/// </summary>
/// <param name="mpb">The MaterialPropertyBlock for the given meshRenderer. Can be used to set properties for custom rendering.</param>
/// <param name="meshRenderer">The MeshRenderer which exists under the given Labeling.</param>
/// <param name="renderer">The Renderer under the given Labeling.</param>
void SetupMaterialProperties(MaterialPropertyBlock mpb, MeshRenderer meshRenderer, Labeling labeling, uint instanceId);
void SetupMaterialProperties(MaterialPropertyBlock mpb, Renderer renderer, Labeling labeling, uint instanceId);
}
}

2
com.unity.perception/Runtime/GroundTruth/InstanceSegmentationCrossPipelinePass.cs


}
}
public override void SetupMaterialProperties(MaterialPropertyBlock mpb, MeshRenderer meshRenderer, Labeling labeling, uint instanceId)
public override void SetupMaterialProperties(MaterialPropertyBlock mpb, Renderer renderer, Labeling labeling, uint instanceId)
{
mpb.SetInt(k_SegmentationIdProperty, (int)instanceId);
#if PERCEPTION_DEBUG

2
com.unity.perception/Runtime/GroundTruth/RenderedObjectInfoGenerator.cs


}
/// <inheritdoc/>
public void SetupMaterialProperties(MaterialPropertyBlock mpb, MeshRenderer meshRenderer, Labeling labeling, uint instanceId)
public void SetupMaterialProperties(MaterialPropertyBlock mpb, Renderer renderer, Labeling labeling, uint instanceId)
{
if (m_LabelingConfiguration.TryGetMatchingConfigurationEntry(labeling, out _, out var index))
{

2
com.unity.perception/Runtime/GroundTruth/SemanticSegmentationCrossPipelinePass.cs


DrawRendererList(renderContext, cmd, RendererList.Create(renderList));
}
public override void SetupMaterialProperties(MaterialPropertyBlock mpb, MeshRenderer meshRenderer, Labeling labeling, uint instanceId)
public override void SetupMaterialProperties(MaterialPropertyBlock mpb, Renderer renderer, Labeling labeling, uint instanceId)
{
var entry = new LabelEntry();
foreach (var l in m_LabelingConfiguration.LabelEntries)

正在加载...
取消
保存