# Different shade of color when using opacity

**URL:** https://discourse.processing.org/t/different-shade-of-color-when-using-opacity/8476
**Category:** Coding Questions
**Created:** [February 17, 2019, 12:03pm UTC](https://discourse.processing.org/t/different-shade-of-color-when-using-opacity/8476 "2019-02-17T12:03:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gytis585](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@gytis585](https://discourse.processing.org/u/gytis585)
#### Post date: [February 17, 2019, 12:03pm UTC](https://discourse.processing.org/t/different-shade-of-color-when-using-opacity/8476/1 "2019-02-17T12:03:32Z")

</div>

Hello,

I am experiencing a weird error regarding opacity.

I am rendering a 3D shape made out of two circles. Each of the circle is made out of several pieces. Every second is flipped. The ones that are fliped get a darker shade of color. I have tried to use hint(ENABLE\_DEPTH\_SORT) which solves the issue. However, the performance drops drastically. Is there another solution to this problem?

Here are some pictures of what I am talking about: [https://imgur.com/a/oC1qO9B](https://imgur.com/a/oC1qO9B). The last picture is with hint(ENABLE\_DEPTH\_SORT).

Thanks in advance!

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [February 20, 2019, 7:53pm UTC](https://discourse.processing.org/t/different-shade-of-color-when-using-opacity/8476/2 "2019-02-20T19:53:57Z")

</div>

@gytis585 – Much is unclear – especially “a 3D shape made out of two circles.” Are they transparent or opaque? Must they have the same depth, or can there be a gap between them? Are then, in fact, circles (rendered with ellipse) or are they PImage or PGraphics?

It seems like you want a high-performance solution, but what kinds of optimizations you can do also depend a lot on many details of your project. For example, must this two-circle shape be free-rotated in real-time? Are the two circles ever intersecting at an angle, or are they always back-to-back?

You might get more feedback and suggestions if you could provide a minimal sketch that demonstrates this problem.
