Helco / zzio

Zanzarah - WIP modding tools and engine remake
MIT License
14 stars 3 forks source link

EnvMap materials do not use ZBias #276

Open github-actions[bot] opened 8 months ago

github-actions[bot] commented 8 months ago

EnvMap materials do not use ZBias

https://github.com/Helco/zzio/blob/b5f2c34fb38f28024b98e01ddbc486b64ad70463/zzre/game/resources/ClumpMaterial.cs#L48


            if (info.RenderType is FOModelRenderType.LateAdditive)
                material.DepthWrite = false;
        }
        else if (info.RenderType is >= FOModelRenderType.EnvMap32 and <= FOModelRenderType.EnvMap255)
        {
            // TODO: EnvMap materials do not use ZBias
            material.Blend = ModelMaterial.BlendMode.Alpha;
            material.HasEnvMap = true;
            material.DepthWrite = false;
        }
        else
            throw new NotSupportedException($"Unsupported render type for material {info.RenderType}");

929913422e0cf9a90ac177122c8319bd14271b29

Helco commented 8 months ago

Veldrid currently does not support this, although there is a PR that should work for us (not merged because it did not support Metal). Alternatively we could implement this for the few materials in the shader ourselves.

We can test this in the London groundfloor scene (sc_2800), the cupboard window in the spawnpoint originally stick out of the wood around it, which is a bug but most likely due to this zbias and it is an original bug

github-actions[bot] commented 7 months ago

Closed in 4e46e9c5a33aa7eb670b2db0e2e0535027e733e6

Helco commented 7 months ago

This was not fixed, just the TODO comment was accidently deleted