Bug #3366

Inconsistent transparency rendering order

Added by katz . about 2 years ago. Updated 13 days ago.

Target version:
Start date:
% Done:


Operating system:


Some of the purple crystals found in caves like Punabi are flickering while you move around.
Check the video.

OpenMW 0.39 release
Windows 8.1 64bit

openmw_2016-04-22_22-22-13-94.webm (1.4 MB) katz ., 04/22/2016 10:30 PM

Related issues

Duplicated by OpenMW - Bug #4388: Model flickering when some models have the same coordinates. Rejected 04/12/2018


#1 Updated by scrawl . about 2 years ago

This usually happens when two transparent meshes are placed at the exact same origin. The renderer then can't decide which mesh to draw in front. Not sure how the vanilla engine handles this. Maybe sort based on AABB?

#2 Updated by Alexei Dobrohotov about 1 year ago

  • Subject changed from 0.39 Flickering crystals to Flickering crystals

#3 Updated by scrawl . about 1 year ago

OSG does sort based on the center of the bounding box. It would seem that this mesh requires sorting by origin to look as intended. We definitely want to keep sorting by AABB, though, since that is more accurate in most cases and allows us to apply optimizations (i.e. pre-applying transformations to the vertices). Maybe we could do a combination of the two metrics with the AABB having a higher impact...

#4 Updated by sjek - about 1 year ago

this happens also in vanilla
alpha overlaying broplems with clothes and underwater hairs etc.

all those crystals (each one having bit smaller identical trishape inside) have 237 alpha flag. the regular blending with
source: src alpha
dest: inv src alpha

i think bethesda meant flickering effect and the greyscale env map seemed to effect the base texture (artifacts or what one would call them)

point is though that this isn't in any way predictable in vanilla. other way to make it is using cg_diffuse_cube_map (less pronounced) but right on that it's mainly related to alpha blending

taken from discord the alpha blending firstly sorts everything from back to front in vanilla and then decides what to draw causing lags usually.

two cents...

on those crystals though moving and sneaking around the top and inner crystal disappear-reappear like in vanilla. when close also the crystals flipping seemingly related to cursor position, while somewhat around the middle screen, when player / camera is moving, happens like so.

#5 Updated by sjek - about 1 year ago

one difference that forgot though is that this is more pronounced in openmw than vanilla as is xD

#6 Updated by Alexei Dobrohotov 9 months ago

  • Status changed from New to Confirmed

#7 Updated by Miloslav Číž 7 months ago

Some of the crystals consist of 2 layers which cause the flickering in OpenMW but not in Vanilla. I wasn't able to see the inner layer of the crystal in vanilla. This bug also appears at ghostgate (#4183).

#8 Updated by Miloslav Číž 7 months ago

Actually I'm wrong, I can sometimes see the inner layer in vanilla. Cannot this be OSG changing the order in which it renders triangles or something? Because the flickering occurs even when the camera is still, so it has to be somehow caused by different order of triangles, right?

#9 Updated by Miloslav Číž 7 months ago

OK, this could be cause by optimizer using VERTEX_POSTTRANSFORM.

#10 Updated by scrawl . 7 months ago

The optimizer shouldn't change anything. OSG sorts by the world bounding box of the object, which remains the same whether or not the vertices have been pre-transformed.

As to the flickering when standing still, well, two objects at the exact same distance are just in undefined order so that's probably why it happens.

#11 Updated by Miloslav Číž 7 months ago

I tried disabling the optimizer and it didn't help, so I guess you're right.

#12 Updated by Alexei Dobrohotov about 1 month ago

  • Duplicated by Bug #4388: Model flickering when some models have the same coordinates. added

#13 Updated by Andrei Kortunov 18 days ago

  • Subject changed from Flickering crystals to Inconsistent rendering order
  • Target version set to openmw-1.0
  • Operating system changed from Windows to Other

Not only crystals are affected. Even with vanilla assets, lava and ice chunks have this issue too.
Original engine does not have this issue.

#14 Updated by Alexei Dobrohotov 13 days ago

  • Subject changed from Inconsistent rendering order to Inconsistent transparency rendering order

Also available in: Atom PDF