playMaker

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

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
WWWSprite causes a lag spike[SOLVED]
« on: August 07, 2017, 11: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, 03:45:11 AM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: WWWSprite causes a lag spike
« Reply #1 on: August 07, 2017, 09: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...
Re: WWWSprite causes a lag spike
« Reply #2 on: August 08, 2017, 05: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...
Re: WWWSprite causes a lag spike
« Reply #3 on: August 08, 2017, 06: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: 386
    • terrivellmann.tumblr.com
Re: WWWSprite causes a lag spike
« Reply #4 on: August 08, 2017, 08: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"