Jump to content

Prepare.upload does not actually upload the texture


mariogarranz
 Share

Recommended Posts

I have a very big texture for a Spine animation that causes a ~400ms delay whenever it's rendered for the first time. I have been trying to avoid this by trying to use prepare.upload in multiple different ways, but this just does not seem to make any difference.

prepare.upload resolves within a few ms (~10ms measured using performance), then when adding the animation the big freeze happens again, and if I profile the performance I can see all that delay is spent uploading the texture to the GPU.

This is the current test code I'm using:

const sprite = PIXI.Sprite.from("/assets/bigwin/muscle_logo.webp");
const t0 = performance.now();
app.renderer.prepare.upload(sprite).then(() => console.log(performance.now() - t0));


Any idea on what could be going wrong? As far as I understand this is exactly how it should work.

Edited by mariogarranz
Link to comment
Share on other sites

  • 2 weeks later...

Hi @mariogarranz,

 

I was also facing the smae issue  To optimize the loading process, consider these steps:

 

1.Texture Compression: Try compressing the texture to reduce its size and improve loading speed.

 

2.Mipmapping: Enable mipmapping for better rendering performance.

 

3.Texture Atlas: Use a texture atlas to combine multiple textures into one, reducing draw calls.

 

4.Progressive Loading: Load essential textures first, then asynchronously load the big texture after initial rendering.

 

Hope it helps you.

CCSP Course

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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