Partially transparent surface over opaque surface causes strange artifacts (OpenGL)

by Ben Wiley   Last Updated December 13, 2017 01:13 AM

OpenGL 3.3:

I have a world with many unit square tiles, each made up of a 3d terrain chunk and a 2d water chunk (a square). Each chunk stretches from [0, 0] to [1, 1] (inclusive) in its tile space. This means each pair of adjacent chunks shares an edge of vertices (although for sharing the visual I've curbed in the edges of the water chunks to make it obvious where the tile edges are).

I'm having a weird issue when I make water somewhat transparent (85% in my case). It looks like "walls" form between the water surface and the terrain surface below, along the edges of the tile. The walls reflect the water color, but with 100% opacity instead of 85%.

This side has a problem:

This side looks fine:

The weirdest part to me is that I can only see these walls from one side, as shown in the screenshots. I suspected maybe this had something to do with backface culling, so I turned it off, but that didn't change anything.

I did notice that the walls disappear if I stop rendering the terrain, and maintain the same level of water transparency.

No walls from front:

enter image description here

And no walls from back:

enter image description here

(The light blue in the second set of images is the sky color.)

Does anyone recognize this issue, know a name for it, or have an idea what I could change to fix it? Thanks!

Related Questions

Hardware Fragment Sorting?

Updated January 21, 2018 00:13 AM

Why isn't my window transparent?

Updated December 30, 2018 15:13 PM