LuaSTG-Sub icon indicating copy to clipboard operation
LuaSTG-Sub copied to clipboard

3D model with alpha have dithering

Open RyannThi opened this issue 10 months ago • 3 comments

When using a 3d glb model with alpha in it, the alpha turns into dithering in-game. (I tried with z buffer disabled and enabled, same result)

Image

Edit March 25th: Non-plane alpha seems to be okay, however objects rendered behind/inside the one with alpha are ignored

RyannThi avatar Mar 24 '25 13:03 RyannThi

Rendering transparent models is a known high difficult task.

There are multiple choices:

  • Alpha-Cut: For example, pixels with an alpha below 0.5 are discarded. (We already support this feature, which is a gltf2.0 standard)
  • OIT (Order-independent transparency): Best Choice. (Not implemented, high difficulty & high performance requirements)
  • Screen-Door Transparency: Simulating transparency through "dithering", low performance requirements, depth buffer affinity. (Implemented)

Demonese avatar Mar 26 '25 07:03 Demonese

You might want to provide a method to toggle between different transparency rendering methods?

Demonese avatar Mar 26 '25 07:03 Demonese

I honestly think that could be a good idea! Should work for the cases people would like to switch between them for aesthetic reasons (in this project I'm doing right now, that would certainly be the best outcome of this)

RyannThi avatar Mar 26 '25 11:03 RyannThi