# How to change transparency in ROOT's GL viewer

**URL:** <https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323>\
**Category:** Newbie\
**Tags:** root\
**Created:** [November 27, 2024, 7:39am UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323 "2024-11-27T07:39:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [November 27, 2024, 7:39am UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323/1 "2024-11-27T07:39:20Z")

</div>

Dear experts

How can I change the transparency automatically for all volumes in the TGeoManager since they have different materials and densities, both using command line and GUI clicking?  
I didn’t find such a Botton on ROOT’s GL viewer. I’m using

```auto
TGeoManager* geo = (TGeoManager*)gDirectory->Get("someGeo");
geo->GetTopVolume()->Draw("ogl");

```

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [November 27, 2024, 4:13pm UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323/2 "2024-11-27T16:13:19Z")

</div>

Hi,

Let me add in the loop @linev @couet @agheata

Cheers,  
D

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [November 27, 2024, 4:26pm UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323/3 "2024-11-27T16:26:45Z")

</div>

Hi,

If you are using latest ROOT versions,  
then by default you will get web-based geometry viewer.  
And in settings widget in “Appearance” tab you can find “Transparency” slider. See screenshot:

 ![Screenshot_20241127_172340](https://root-forum.cern.ch/uploads/default/original/3X/1/0/10f85cfcfd0343b855c5733defe089c8ed41acba.png)

In plain GL viewer I am not sure if such feature exists.

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [November 27, 2024, 4:29pm UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323/4 "2024-11-27T16:29:47Z")

</div>

By default you mean `geo->GetTopVolume()->Draw()`?

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [November 27, 2024, 4:32pm UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323/5 "2024-11-27T16:32:05Z")

</div>

Yes, with `GetTopVolume()->Draw()` starts web-based viewer now.

For some previous ROOT versions like 6.30 and 6.28 you could explicitly enable such geometry viewer with:

```auto
root --web=chrome tutorials/geom/rootgeom.C

```

when starting ROOT.

---

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [November 27, 2024, 4:51pm UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323/6 "2024-11-27T16:51:27Z")

</div>

I’m using the latest stable version v6.32.08, but when I draw it, it just give me a default `TCanvas` instead of viewer…

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [November 27, 2024, 4:52pm UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323/7 "2024-11-27T16:52:08Z")

</div>

Try to provide `--web=chrome` argument

---

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [November 27, 2024, 4:55pm UTC](https://root-forum.cern.ch/t/how-to-change-transparency-in-roots-gl-viewer/62323/8 "2024-11-27T16:55:09Z")

</div>

Yes, that works, but not without that argument…
