Jump to content

Little help with unloading custom radar textures


koragg

Recommended Posts

3 minutes ago, LoPollo said:

Nice, but do you free up the memory? I mean continuing loading the shaders without destroying them. Check performanceBrowser (if running) in the web server of you MTA server after switching on/off some times.

As far as I know it loads them just once when I click the checkbox, not non-stop (onClientRender-ish style xD). I also didn't get any lag but I'll test tomorrow with a real player other than me and will check the load if he experiences lag.

Link to comment

Loading something in render means that the load happens about 36 times (default fps cap), in one minute there will be 2.160 elements loaded. Loading them when switching means that probably the shaders will get loaded 0-4 times per GAME... but if you get crazy and spam the switch, how many objects will be loaded? While in a case like the render one it's critical, in you case is more like a "right" thing to do xD

After spamming a bit, how many elements are owned by your resource (in performanceBrowser)?

EDIT: i also noticed that you are destroying in unloadTile the vars tile.shader and tile.texture... but i can't find where they are created. Also you are not destroying the shaders in the shaders table. Is it possible that the problem was partially caused by that?

Edited by LoPollo
  • Like 1
Link to comment
5 hours ago, LoPollo said:

Loading something in render means that the load happens about 36 times (default fps cap), in one minute there will be 2.160 elements loaded. Loading them when switching means that probably the shaders will get loaded 0-4 times per GAME... but if you get crazy and spam the switch, how many objects will be loaded? While in a case like the render one it's critical, in you case is more like a "right" thing to do xD

After spamming a bit, how many elements are owned by your resource (in performanceBrowser)?

EDIT: i also noticed that you are destroying in unloadTile the vars tile.shader and tile.texture... but i can't find where they are created. Also you are not destroying the shaders in the shaders table. Is it possible that the problem was partially caused by that?

I have no idea but now it works :D I'll answer your questions in the coming days as now i just wanna play mta after a hard maths test lol 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...