FWGS / xash3d-fwgs

Xash3D FWGS engine
1.58k stars 239 forks source link

Incorrect texture display #1841

Open usergithub64 opened 1 month ago

usergithub64 commented 1 month ago

I installed the Trusty Pack Half-Life mod: https://www.moddb.com/addons/trusty-pack-half-life-1-v2

Map c1a0. In the original Half-Life, the textures from the mod are displayed normally: hl_2024_10_13_11_42_15_887 hl_2024_10_13_11_59_51_784

In Xash3D FWGS, the textures are displayed incorrectly: xash3d_2024_10_13_11_52_10_605 xash3d_2024_10_13_11_56_55_196

Is it possible to adapt Xash3D FWGS for this mod? Or is there some command in the console that is needed to display the textures correctly?

Vladislav4KZ commented 1 month ago

You need to open each problematic detailed texture, and remove the alpha channel in it. Then it will be displayed correctly in Xash3D FWGS.

Vladislav4KZ commented 1 month ago

Before removing the alpha channel

Снимок экрана 2024-10-19 194322.png c1a0_0000.png

After removing the alpha channel

Снимок экрана 2024-10-19 194339.png

c1a0_0001.png

mittorn commented 1 month ago

It's detailtextures based mod or just some texture replacement? If it's detailtextures, maybe need change alpha channel processing for it. Something like pglTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE ); pglTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB );

(this is for multitexture VBO detail rendering)

Separate detailtextures render is using GL_DECAL now both for VBO and legacy: https://github.com/FWGS/xash3d-fwgs/blob/master/ref/gl/gl_rsurf.c#L2482 https://github.com/FWGS/xash3d-fwgs/blob/master/ref/gl/gl_rsurf.c#L1099 Maybe try with GL_MODULATE?

mittorn commented 1 month ago

It is using GL_DECAL + modulating GL_BLEND (GL_SRC_COLORGL_DST_COLOR), this means prev(1-alpha) + src*alpha, prev is missing (white) here. To ignore alpha, it needs just GL_REPLACE in texenv to get source on output and modulate on blend

Vladislav4KZ commented 1 month ago

It's detailtextures based mod or just some texture replacement?

This mod uses detailed textures that are displayed on top of the white textures from the .wad files.

mittorn commented 1 month ago

So, GL_REPLACE instead of GL_DECAL would help