playMaker

Author Topic: WWWSprite causes a lag spike[SOLVED]  (Read 1780 times)

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
    • View Profile
WWWSprite causes a lag spike[SOLVED]
« on: August 07, 2017, 08:10:17 AM »
Hi there,

I'm trying to download a texture using the WWWSprite action, however it causes the app to freeze for 2-3 seconds which isn't very nice. I though it may be that it wasn't in a coroutine but after making it inside of one it still didn't help.

In the profiler most of the memory takes up the SpriteMeshGenerator.TraceShape 19% and FSM Late Update 52%
« Last Edit: August 09, 2017, 12:45:11 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4611
    • View Profile
    • jinxtergames
Re: WWWSprite causes a lag spike
« Reply #1 on: August 07, 2017, 06:35:47 PM »
Hi,
Can you try using www.object and then use the custom action convert Texture to sprite.

this does exactly the same as www sprite

Then let me know which part is slow (i can't test myself atm)

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
    • View Profile
Re: WWWSprite causes a lag spike
« Reply #2 on: August 08, 2017, 02:41:51 AM »
I have tried this, and I only get one spike again

63% from PlaymakerFSM.Update() and 34% from SpriteMeshGenerator.TraceShape

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
    • View Profile
Re: WWWSprite causes a lag spike
« Reply #3 on: August 08, 2017, 03:49:53 AM »
Okay, seems like problem is solved. The resolution of the image was too big, i was 4000 by 3400 i think. I resized the image to 800 and it's loading smoothly. It's going to be a pain though to resize +400 images, does anyone know any program that can do this all at once?

terri

  • Sr. Member
  • ****
  • Posts: 373
    • View Profile
    • terrivellmann.tumblr.com
Re: WWWSprite causes a lag spike
« Reply #4 on: August 08, 2017, 05:23:07 AM »
Okay, seems like problem is solved. The resolution of the image was too big, i was 4000 by 3400 i think. I resized the image to 800 and it's loading smoothly. It's going to be a pain though to resize +400 images, does anyone know any program that can do this all at once?

photoshop can. google "photoshop batch resize"