[GRAPHICS] DrawSphere renders only one sphere per frame

Hi,

Ran into a weird issue where DrawSphere renders only one sphere per frame (whichever is the latest function call), tested similar function DrawBox and it rendered all boxes correctly.

As you can see, it first renders a red sphere and then seems like erases it and renders green sphere which is the one that can be seen in final frame.

Checked LCPDFR (uses RAGE hook) and they can render multiple spheres at once no problem. Seems like fivem exclusive issue.

Regards

1 Like

Checked LCPDFR (uses RAGE hook) and they can render multiple spheres at once no problem. Seems like fivem exclusive issue.

This is how the native is designed by R*.

I presume RPH’s Debug class (which emulates many of the nop’d Debug natives) simply enqueues a draw command. Probably similar to how Disquse implemented the DRAW_* natives for RedM.

May want to consider moving this to Feature Requests.

2 Likes

If it just a case of incomplete implementation, please consider adding it.

I think it would benifit performance for use cases where a simple static 3d sphere is needed, instead of using markers/checkpoints/sphere meshes.

1 Like

It’s more likely the case that _DRAW_SPHERE is improperly named.

The name of the native is comes after DRAW_MARKER and before DRAW_POLY, has its draw command queued in the same subroutine as _HIGHLIGHT_PLACEMENT_COORDS, and relates to the SC_VSP = "Land Vehicle Spawn Points" and FMMC_RSD_PSEC = "Pit Stop Entry Marker" text labels.

RPH apparently seems to implement this via DRAW_MARKER, no special tricks there.

I suspect it’s the case of wrong naming. As mentioned on github doc page, if _DRAW_SPHERE comes from the “GTA:O Panned In Event” event which spaces out few sphere across the map with significant gaps, then I suspect It would of made sense to have just one (closest) sphere rendered.

Maybe it should be renambed to something like _DRAW_EVENT_SPHERE. I’ll look around, maybe there is another unamed native for generating a normal sphere.

1 Like

Naming order would make sense to be DRAW_PENNED_IN_.. though. Sadly this is not on last-gen versions so we can’t get a confirmed name.

Also regarding naming,

likely RENDER_* and seems related to race spikes only

1 Like

Oh, I already had the native documented … 0x3430676B11CDF21D = RENDER_FAKE_PICKUP_GLOW.

3 Likes

Bump, is there any solution to this?

Going to be solved soon hopefully :stuck_out_tongue:

1 Like