Atelier Esha & Logy | Atelier Shallie broken Shadows on Nvidia GPUs

Hey guys,

sadly this issue has been going arround for a while and has never been fixed by the devs… Some user on the Steam discussions has provided and explanation as to why this apparently happens.

Shadow mapping is bugged in this game because they are not only using the wrong output resource from the shadow mapping pass, but also because they are relying on undefined behaviour (that only works on the AMD graphics driver) because of a bug in their pixel shader.

After some fun efforts in reversing the HLSL, this is the source code of their shader:

Texture2D<float4> meow : register(t0);
SamplerState samp : register(s0);
void main(
    float4	position  : SV_Position,
    float2	uv        : TEXCOORD0,
    float4	oColor    : COLOR0,
    uniform float4 sbias
)
{
    float tex = meow.Sample(samp, uv).w;
    tex -= sbias.w;
    if (tex < 0)
        discard;
    return;
}

This code has no return type (as it is a void type), and on AMD hardware, causes the render target to be set to float4(0, 0, 0, 0), corresponding to shadow. On Intel and NV hardware, the render target is not touched, and remains set to float4(1, 1, 1, 1), corresponding to no shadow.

The proper HLSL for this shader is:

> Texture2D<float4> meow : register(t0);
SamplerState samp : register(s0);
float4 main(
    float4	position  : SV_Position,
    float2	uv        : TEXCOORD0,
    float4	oColor    : COLOR0,
    uniform float4 sbias
) : SV_Target
{
    float tex = meow.Sample(samp, uv).w;
    tex -= sbias.w;
    if (tex < 0)
        discard;
    return 0;
}

They claimed to try to fix it themselves which sadly never happened… Question being is it possible to fix this somehow ? You’ve got experience with the Tales of Series so hopefully something similar is possible here. It’s a horrible experience to not have any kind of shadows in a game like this due to some lines of ■■■■■■■ I’m also willing to pay for a proper fix to this issue and i gladly provide the .exe’s for this : )

Putting out a 100$ bounty for fixing this. If someone needs info or .exe let me know

3DMigoto is better suited to this.

I can re-compile and replace shaders, but it’s not a normal feature of SK. I’ve done it for various overlays in the past to make them HDR compliant, but that’s as far as the feature goes because generally shaders do what they were originally designed to do :slight_smile:

I’m not entirely sure why the output even matters in this shader? It is clearly only designed to write to the depth buffer, and discard is used to reject / accept incoming pixels. Seems like more than just a bad shader is at play here.