Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Source Engine] Translucent sprites rendering issue #4006

Open
yurakone opened this issue May 17, 2024 · 5 comments
Open

[Source Engine] Translucent sprites rendering issue #4006

yurakone opened this issue May 17, 2024 · 5 comments

Comments

@yurakone
Copy link

yurakone commented May 17, 2024

Hard edges on translucent sprites env_sprite with World Space Glow render mode (9) in Source engine games, also affects to env_lensflare in Black Mesa

Software information

Tested on Half-Life 2 Deathmatch, Black Mesa

System information\Tested on

  • GPU: NVIDIA GeForce RTX 3060 Ti \ NVIDIA GeForce GTX 1660 Ti
  • OS: Windows 10 / 11
  • Driver: NVIDIA 552.22.0
  • DXVK version: 32bit since 1.3.9 (earlier versions have not been tested) to 2.3.1

Apitrace file(s)

hl_trace

Log files

hl2_d3d9.log

Screenshots

Black Mesa sreenshots:
IMG_8029
IMG_8030
Half-Life 2 Deathmatch sreenshots:
IMG_8031
IMG_8032

@Blisto91
Copy link
Contributor

Just checking out the apitrace it looks fine on my RX 7900xtx with both radv and amdvlk

@K0bin
Copy link
Collaborator

K0bin commented May 17, 2024

Image
I can reproduce it

@K0bin K0bin self-assigned this May 18, 2024
@K0bin
Copy link
Collaborator

K0bin commented May 18, 2024

Internal note:
It's blending a texture that gets uploaded via a simple Lock,Copy,Unlock onto the render target. The blending is a simple add and output alpha of the fragment shader is 1.0 across the board.
The only thing that might be interesting is that both the RT as well as the texture are reinterpreted as SRGB. It's a BC1 texture with a SRGB view blended (with a fixed alpha) onto a SRGB B8G8R8A8 texture with a SRGB view.

It seems indeed related to SRGB. If I disable the SRGB views and manually transform it to 2.2 Gamma after sampling and at the end of the shader, it looks fine.

@WinterSnowfall has also confirmed that it renders correctly on Intel.

So... Nvidia driver bug?

@yurakone
Copy link
Author

I looked into the problem a little. I added alpha channel to the texture, cuz it was with no alpha DXT1 and created a new material then I tried different shader parameters
--Shader used: UnlitGeneric
--Shader parameters tested: $translucent 1 $additive 1
--Texture format: DXT5 Compressed texture
20240519015728_1
20240519015828_1
So... this looks like a problem with $additive 1 only, and maybe Nvidia drivers

@Blisto91
Copy link
Contributor

Blisto91 commented May 20, 2024

This indeed is looking like a Nvidia driver bug. We've confirmed that it looks fine on AMD with the radv and amdvlk driver. On Intel it looks good with the Linux driver and on Nvidia it also looks fine on the NVK Linux driver while Nvidias own have the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants