Skip to content

Add Texture Mapping - #1983

Open
Zeffuro wants to merge 1 commit into
aers:mainfrom
Zeffuro:texture-mapping
Open

Zeffuro wants to merge 1 commit into
aers:mainfrom
Zeffuro:texture-mapping

Conversation

@Zeffuro

@Zeffuro Zeffuro commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Tested with LiteShade

    private void UpdateLut(PostEffectColorFilterDarkBlend* part)
    {
        if (!IFramework.Get().IsInFrameworkUpdateThread || part != _part || _manager == null || PostEffectManager.Instance() != _manager)
        {
            _hook!.Original(part);
            return;
        }

        var index = (part->LutIndex + 1) % 3;
        var texture = part->LutTextures[(int)index].Value;
        if (part->LutIndex >= 3 || !IsCurveTexture(texture))
        {
            Error = "Curve texture unavailable";
            _hook!.Original(part);
            return;
        }

        part->LutIndex = index;
        var mapped = new Experimental.TextureMapResult();
        _map!(texture, 0, &mapped);
        if (mapped.Data == null)
        {
            Error = "Curve upload failed";
            return;
        }

        try
        {
            if (mapped.RowPitch != 256)
            {
                _failed = true;
                Error = "Curve texture unavailable";
                return;
            }

            _bytes.CopyTo(new Span<byte>(mapped.Data, 256));
        }
        finally
        {
            _unmap!(texture, 0);
        }
    }
Ffxiv.Dx11.2026-10-05.22-00-17.3.mp4

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant