# Issues when rendering transparent images in 3D

**URL:** <https://discourse.processing.org/t/issues-when-rendering-transparent-images-in-3d/42593>\
**Category:** Coding Questions\
**Created:** [August 15, 2023, 4:55am UTC](https://discourse.processing.org/t/issues-when-rendering-transparent-images-in-3d/42593 "2023-08-15T04:55:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mattyjak](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mattyjak/32/16777_2.png) [@Mattyjak](https://discourse.processing.org/u/Mattyjak)\
**Post date:** [August 15, 2023, 4:55am UTC](https://discourse.processing.org/t/issues-when-rendering-transparent-images-in-3d/42593/1 "2023-08-15T04:55:22Z")

</div>

Hello all! I’m having some issues with my program. I’m trying to render multiple 3d objects (“trees”) in this situation, but even if they’re transparent sometimes they won’t be. There’s a transparent border that displays incorrectly, almost as if it’s transparent & not transparent at the same time.

This only happens when using P3D, since I’m using multiple `PGraphics` objects to render everything.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/d/e/dee4305ca6977a767d1a22abdbcd6819ea21b21d.png)  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/6/2/628245e43c50fb327e82458d8f832fd01f1d3c3d.png)

Similar problems I’ve seen have solved them by using the built-in `hint()` method, but it has no affect for me. Along with that, if I try and change something using the `PGraphics.hint()` method, I get an issue:  
`java.lang.NullPointerException: Cannot invoke "com.jogamp.opengl.GL.glDepthMask(boolean)" because "this.gl" is null`

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/6/e/6e324a74995a0806d4709114402f0a4256377dd1.png)

I’ve tried to change the render priority (backwards, forwards, etc.) with no luck. The images are transparent and yet not.

Please help!

---

<div class="post-metadata">

**Author:** ![Mattyjak](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mattyjak/32/16777_2.png) [@Mattyjak](https://discourse.processing.org/u/Mattyjak)\
**Post date:** [August 15, 2023, 3:25pm UTC](https://discourse.processing.org/t/issues-when-rendering-transparent-images-in-3d/42593/2 "2023-08-15T15:25:45Z")

</div>

FOUND A MAKESHIFT SOLUTION.

When using `PGraphics.hint()` in Eclipse, there seems to be an issue where if you don’t call `.hint()` in the applet as well, you’ll run into some issues:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/d/eda7b0665691aaaada931c12eacb9b76fb283e9e.png)

Enabling depth sort fixes the issue, but I also plan on using the depth mask later on.  
This doesn’t work with everything, issues arise if I render something from a different chunk. I think the only solution for that is to prioritize chunk rendering, but I’ll get around to it.

Either way, thank you!
