# How do I set up Segmented Dimming with a 3D model?

**URL:** <https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184>\
**Category:** Unity Development\
**Tags:** development, unity\
**Created:** [November 3, 2022, 3:55pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184 "2022-11-03T15:55:30Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [November 3, 2022, 3:55pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/1 "2022-11-03T15:55:31Z")

</div>

Hello,  
Please tell me how to set Segmented Dimming by 3D model.  
I would like to create something like the demo video below.

> <https://twitter.com/tokufxug/status/1586220710179278849>

I have set up the following document on Cube to check the operation, and Segmented Dimming seems to work. (In ML2, I saw blurry black stuff. I took a video and it showed a black Cube).  
[https://developer-docs.magicleap.cloud/docs/guides/unity/display/unity-segmented-dimming](https://developer-docs.magicleap.cloud/docs/guides/unity/display/unity-segmented-dimming)

I looked at \Assets\MagicLeap\Examples\Scenes\SegmentedDimmer.scene but it doesn't help.

As mentioned above, please tell me how to suppress the transparency of the 3D model using Segmented Dimming.

**Unity Editor version** : 2022.2.0b4.2768  
**ML2 OS version** : **B3E.220818.12-R.046-R.417**  
**MLSDK version** :1.0.0  
**Host OS** : (Windows/MacOS):Windows 10

Thanks.  
[Sadao Tokuyama](https://www.linkedin.com/in/sadao-tokuyama/)

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [November 3, 2022, 7:49pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/2 "2022-11-03T19:49:45Z")

</div>

Hi @tokufxug, Let me look into this and I'll get back to you. Thanks for your post.

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [November 4, 2022, 1:41am UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/3 "2022-11-04T01:41:31Z")

</div>

@kdowney  
Thank you for your response. The demo app I posted at the beginning is the app shared by Magic Leap in the following thread. I would be quite happy if you could share the Unity project of this demo app if possible.

> [@Where can I find Kali Enterprise Demo & Kali Gimbal apps?](https://forum.magicleap.cloud/t/where-can-i-find-kali-enterprise-demo-kali-gimbal-apps/1009/6):
>
> I sent you a link to an e-share with some of our demos

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [November 4, 2022, 2:20pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/4 "2022-11-04T14:20:08Z")

</div>

Hi @tokufxug, getting you an answer on the demo app.

Forgive me if you've already done this, but we often use this as a first troubleshooting step because it can be overlooked: was the Segmented Dimmer enabled inside the headset using [these steps](https://developer.magicleap.cloud/learn/docs/guides/features/dimming/global-segmented-dimming-feature)?

---

<div class="post-metadata">

**Author:** ![bsch](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bsch](https://forum.magicleap.cloud/u/bsch)\
**Post date:** [November 4, 2022, 2:20pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/5 "2022-11-04T14:20:43Z")

</div>

Same here. We would be happy to receive access to the demos as well.

We want showcase the capabilities of the device shareholders. Providing some demos would be beneficial for the company overall.

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [November 4, 2022, 3:41pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/6 "2022-11-04T15:41:45Z")

</div>

Hi @kdowney, I have created a demo with Segmented Dimmer Material set on the Cube and verified that it works. I believe that this is a normal activation of Segmented Dimming.

However, I believe that this is not how Segmented Dimming is supposed to be used, but to reduce the transparency of a 3D model with a textured material by setting up Segmented Dimming. I would like to know how to do that.

Do you know how to do it as shown in the video?  
Do you understand what I am asking?

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [November 10, 2022, 7:38pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/7 "2022-11-10T19:38:46Z")

</div>

@tokufxug The demo application uses the same steps as in the Segmented Dimming Guide. We created a decimated version of each model made it a child of each of the objects. This mesh was put on the Segmented Dimmer layer and had the Segmented Dimmer material applied to it.

---

<div class="post-metadata">

**Author:** ![nmatsushita](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@nmatsushita](https://forum.magicleap.cloud/u/nmatsushita)\
**Post date:** [November 11, 2022, 9:15am UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/8 "2022-11-11T09:15:22Z")

</div>

質問があまりUS側に正しく伝わっていないようなので、一度日本語で確認させてください。  
Segmented Dimmer を ML2 を通して実際に見ることには成功したけど、録画してみると、Twitter の動画のようにはならないということでよいでしょうか？  
動画のように透明度が Dimmer の強度によって変わって見えてほしいってことですかね？

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [November 11, 2022, 10:05am UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/9 "2022-11-11T10:05:44Z")

</div>

違います。ドキュメントにある通り、Segmented DimmerをCubeに設定して実行するとCubeが黒のもやみたいなボヤけた状態で表示され、動画撮影すると黒色のCubeが表示されました。このCubeに対してSegmented Dimmerは効いていると思います。

次にTwitterの動画のような3Dモデルに対して、Segmented Dimmerを設定する方法を知りたい言う質問です。

ドキュメントがチュートリアルのような内容になっていないので、わかりづらいです。

---

<div class="post-metadata">

**Author:** ![nmatsushita](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@nmatsushita](https://forum.magicleap.cloud/u/nmatsushita)\
**Post date:** [November 11, 2022, 10:33am UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/10 "2022-11-11T10:33:03Z")

</div>

承知しました。  
@kbabilinski が回答した通り、また[ドキュメント](https://developer-docs.magicleap.cloud/docs/guides/unity/display/unity-segmented-dimming)にも書いてある通りの手順となります。  
少しわかりにくい点として、 **SegmentedDimmer** Layer を適用するのは、見たいゲームオブジェクトそのものではなく、そのゲームオブジェクトの複製に対してです。この複製が、Dimmer のマスクとして機能する形です。そのため複製は本来のゲームオブジェクトの子オブジェクトとして配置するのが一番良いと思います（連動して動くため）。Dimmer のためのゲームオブジェクトのサイズは、本来のものよりも大きくしたり小さくしたりして、適宜見えを調整するとよいとも書かれています。  
@kbabilinski の場合は、本来のものより小さく設定しているとのことです。

> **For 3D elements** : Place the Segmented Dimmer mesh objects in the same exact location as the object you want to surround with the Segmented Dimmer and scale it up to your desired size. You may need to test out different sizes of the mesh in order to get the desired Segmented Dimmer border width around the object.

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [November 11, 2022, 2:16pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/11 "2022-11-11T14:16:22Z")

</div>

何となくですが、それっぽい感じになりました。

> <https://twitter.com/tokufxug/status/1591071411074117632>

---

<div class="post-metadata">

**Author:** ![nmatsushita](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@nmatsushita](https://forum.magicleap.cloud/u/nmatsushita)\
**Post date:** [November 13, 2022, 3:37pm UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/12 "2022-11-13T15:37:14Z")

</div>

よかったです！  
もし解決した場合は、 Solution であると感じた投稿にマークをお願いします。

---

<div class="post-metadata">

**Author:** ![nmatsushita](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@nmatsushita](https://forum.magicleap.cloud/u/nmatsushita)\
**Post date:** [November 17, 2022, 10:06am UTC](https://forum.magicleap.cloud/t/how-do-i-set-up-segmented-dimming-with-a-3d-model/1184/13 "2022-11-17T10:06:44Z")

</div>


