浏览代码

more progress

/faq-page
Mohsen Kamalzadeh 3 年前
当前提交
2326de22
共有 3 个文件被更改,包括 1456 次插入586 次删除
  1. 42
      com.unity.perception/Documentation~/FAQ/FAQ.md
  2. 999
      com.unity.perception/Documentation~/FAQ/images/inner_objects.png
  3. 1001
      com.unity.perception/Documentation~/FAQ/images/inner_labels.gif

42
com.unity.perception/Documentation~/FAQ/FAQ.md


</details>
<details>
<summary><strong>Q:</strong> How can I add new labels to objects at runtime?</summary>
<summary><strong>Q:</strong> How can I remove or add new labels to objects at runtime?</summary>
This can be achieved through modifying the `labels` list of the `Labeling` component. The key is to call `RefreshLabeling` on the component after making any changes to the labels. Example:

<details>
<summary><strong>Q:</strong> Is it possible to label only parts of an object or assign different labels to different parts of objects?</summary>
Labeling works on the GameObject level, so to achieve the scenarios described here, you will need to break down your main object into multiple GameObjects parented to the same root object, and assign `Labeling` components to each of the inner objects, as shown below.
Labeling works on the GameObject level, so to achieve the scenarios described here, you will need to break down your main object into multiple GameObjects parented to the same root object, and add `Labeling` components to each of the inner objects, as shown below.
<img src="images/inner_objects.png" width="500"/>
<img src="images/inner_objects.png" width="800"/>
Alternatively, in cases where parts of the surface of the object need to be labeled, you can add labeled invisible surfaces on top of these sections. To create a transparent surface
```C#
gameObject.GetComponent<Labeling>().enabled = false;
```
Alternatively, in cases where parts of the surface of the object need to be labeled (e.g. decals on objects), you can add labeled invisible surfaces on top of these sections. These invisible surfaces need to have a fully transparent material. To create an invisible material:
* Create a new material (***Assets -> Create -> Material***) and name it `TransparentMaterial`
* Set the `Surface Type` for the material to `Transparent`, and set the alpha channel of the `Base Map` color to 0.
* For HDRP: In addition to the above, disable `Preserve specular lighting`
An example labeled output for an object with separate labels on inner objects is shown below:
<p align="center">
<img src="images/inner_labels.gif" width="600"/>
</p>
<details>
<summary><strong>Q:</strong>
When visible surfaces of two objects are fully aligned, the bounding boxes seem to blink in and out of existence from one frame to another. Why is that?</summary>
This is due to a common graphics problem called *z-fighting*. This occurs when the shader can't decide which of the two surfaces to draw on top of the other, since they both have the exact same distance from the camera. To fix this, simply move one of the objects slightly so that the two problematic surfaces do not fully align.
</details>
<details>
<summary><strong>Q:</strong>
I need to randomize the rotation of my objects in such a way that they always face the camera, but rotate in other directions. How can I achieve that with a Randomizer?</summary>
</details>
## Perception Camera

999
com.unity.perception/Documentation~/FAQ/images/inner_objects.png
文件差异内容过多而无法显示
查看文件

1001
com.unity.perception/Documentation~/FAQ/images/inner_labels.gif
文件差异内容过多而无法显示
查看文件

正在加载...
取消
保存