Welcome, Guest.
Username: Password: Remember me

TOPIC: Alpha channel problem on DirectX 10/11

Alpha channel problem on DirectX 10/11 7 months 3 weeks ago #1

It seems that DirectX 10/11 has a problem with writing or reading float4 SV_Target alpha channel.
Effect TiltShift.fx writes to alpha channel at first pass and at second reads from it. The effect does not work on DX10 11 games creating blocky artifacts.
It looks like if the alpha channel was lower than 8-bit and stretched along V axis.
Everything works perfect on DX9 / OpenGL.
The administrator has disabled public write access.

Alpha channel problem on DirectX 10/11 7 months 3 weeks ago #2

ReShade reuses the backbuffer created by the game. It's possible to create those with the B8G8R8X8 format, which basically means "store 32-bit per pixel, but ignore the alpha value". If the games you tested this with happen to create their swapchain with this format, then artifacts can occur when attempting to use the alpha channel anyway. This technically applies to DX9/OpenGL too. The safest option in that case is to use separate texture instead of the backbuffer.

You can find out if the games in question use a format without alpha channel by searching the log ReShade creates for "swap chain description" and then check the "Format" value from the table. Format 88 (DXGI_FORMAT_B8G8R8X8_UNORM) and 93 (DXGI_FORMAT_B8G8R8X8_UNORM_SRGB) don't have an alpha channel, anything else should be fine.

If this is not the case, then something else is broken, in which case please report back.
Cheers, crosire =)
Last Edit: 7 months 3 weeks ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: brussell, Fu-Bama

Alpha channel problem on DirectX 10/11 7 months 3 weeks ago #3

Here's the log section:
Warning: Spoiler! [ Click to expand ]

I will go with separate texture.
The administrator has disabled public write access.

Alpha channel problem on DirectX 10/11 7 months 2 weeks ago #4

So the reason it didn't work here is not because there is no alpha channel, but that the alpha channel is just two bits wide. Format 24 is DXGI_FORMAT_R10G10B10A2_UNORM. So the data you put there loses a lot of information between passes.
Cheers, crosire =)
The administrator has disabled public write access.

Alpha channel problem on DirectX 10/11 7 months 2 weeks ago #5

Can that happen on DX9 as well? For some reason, my MXAO spazzes out when using it on GTASA (DX9) lately, only on Windows 10. The alpha channel seems to be rounded to 4 distinct values, which RGB10A2 would explain, but GTASA always used RGBA8..
The administrator has disabled public write access.

Alpha channel problem on DirectX 10/11 7 months 2 weeks ago #6

Technically yes. There is D3DFMT_A2B10G10R10 (31). So if the log says that "BackBufferFormat" is 31, then the same would happen in D3D9. But I don't know of any game that used a 10-bit backbuffer in the D3D9 era.
Cheers, crosire =)
The administrator has disabled public write access.