GD3D11 icon indicating copy to clipboard operation
GD3D11 copied to clipboard

Render alpha faces properly

Open ThielHater opened this issue 5 years ago • 5 comments

I have a dream that one day these faces will be rendered properly. :)

Alpha

ThielHater avatar Dec 28 '19 13:12 ThielHater

The waterfall completely lacks transparency while the vegetation is rendered like it has 1-bit alpha although the texture has 4-bit alpha. I hope that this can be done easily in the new renderer, because I had to implement a little hack in the original one to get this done (see https://github.com/ThielHater/GRMFixes_Union/blob/master/GRMFixes/AlphaTwoPass/Plugin_Source.hpp).

GothicMod 2017-03-29 17-21-11-57

GothicMod 2017-03-29 17-19-23-79

ThielHater avatar Dec 28 '19 13:12 ThielHater

Atleast the waterfall looks like it is a Gothic-1 only issue

Gothic 2, no additional textures, waterfall near Xardas image

kirides avatar Dec 28 '19 15:12 kirides

In Gothic 2, alpha faces are handled differently than in Gothic 1.

First of all, both versions of ZenGin support only DXT1a (1bit alpha) and DXT3 (4bit alpha) textures. To render an alpha face properly, the D3D render states have to be set accordingly. There are two modes, alpha testing and alpha blending.

Gothic 1 always uses alpha testing, resulting in 1-bit alpha regardless of the texture format.

Gothic 2 supports alpha blending, which displays the texture correctly regardless of it's format.

ThielHater avatar Dec 28 '19 22:12 ThielHater

Besides that ZenGin has a limitation on how many alpha vobs and -faces are allowed in a scene (https://forum.worldofplayers.de/forum/threads/1039918-Skript-Mehr-Alpha-Vobs-und-Alpha-Polys-in-Gothic-2). This applies only to alpha blending and is because of an internal list with fixed length.

ThielHater avatar Dec 28 '19 22:12 ThielHater

After a few tests today, I don't think that there is a simple solution to this, at least not for VOBs.

ThielHater avatar Oct 01 '22 19:10 ThielHater