[Regression] DUIs not rendering on runtime textures

  1. Client (production/canary) and FXServer version
  • Canary only | Any FXServer version
  1. What you expected to happen
  • The canary build should display DUI in runtime textures normally
  1. What actually happens
  • Using canary DUI doesn’t show at all in runtime textures
  1. Category of bug (eg. client, server, weapons, peds, native)
  • Client
  1. Reproducible steps, preferably with example script(s)
    Example script: GitHub - kasuganosoras/hologramspeed: 🔢 FiveM hologram speedometer
    Start the resource, spawn a vehicle and use “/hsp” to toggle the speedometer.

Seems like Canary regressed but i don’t know when as i only noticed this today.

Production:
image

Canary:
image

Likely a side effect from tweak(nui/core): behavioral cleanup + no 'root' page for main UI · citizenfx/fivem@e5cae69 · GitHub, since I didn’t have any resource using DUI bits at hand I didn’t test with it.

Will look into this.

Culprit was the part where CreateTextureFromShareHandle was made async, this should be fixed in fix(nui/core): DUI cleanup in NUIWindow · citizenfx/fivem@026c20a · GitHub.

1 Like

Hi, I’m using DUI with DrawSprite and following the change above, the texture drawn by the sprite has changed from transparent to solid, but the content is still not visible.

The following repro works on beta but not on Canary


local txdName = "duiTxd"
local txtName = "duiTex"
local txd = CreateRuntimeTxd(txdName)
local duiObject = CreateDui("https://forum-cfx-re.akamaized.net/original/4X/f/7/b/f7bd789d9d3ad55ff91dc57979e485e99e1a5273.png", 1152, 256)
CreateRuntimeTextureFromDuiHandle(txd, txtName, GetDuiHandle(duiObject))


Citizen.CreateThread(function()
    while true do
        Wait(0)
        DrawSprite(txdName, txtName, 0.5, 0.5, 0.5, 0.5, 0.0, 255, 255, 255, 255)
    end
end)
1 Like

The resource linked in the original post worked fine, wonder what makes this one broken still. :open_mouth:

(my suspicion is that since this script doesn’t wait for IsDuiAvailable - FiveM Natives @ Cfx.re Docs, it gets a null texture handle as a result, which is something I’m not sure is fixable without some hacky trick for DUI->runtime texture conversion to be triggered only when available)

Fixed again: fix(nui): make DUI handles work for delayed textures · citizenfx/fivem@09e0031 · GitHub.

3 Likes