Jump to content

When are the texture's uploaded to the GPU method flow


eguneys
 Share

Recommended Posts

I wonder when are the textures uploaded to the gpu, this is my understanding so far:

This happens in `TextureSystem`'s `bind` method, which is called in `Prepare` plugin's `uploadBaseTextures` method.
This is registered via `registerUploadHook`, which is in turn called in `prepareItems`, that is called from tick method. `tick` method is registered to be called in `upload` method.
Now I don't know when this `upload` method is called from.

Is this even correct information?

Link to comment
Share on other sites

That's right.  `bind()` makes texture actual. uploads, updates properties, e.t.c. You can even override resource `upload()` method to make your custom webgl texture uploading logic: https://pixijs.io/examples/#/textures/gradient-resource.js

Usually bind() is called when sprite with this texture is being rendered, somewhere inside "renderer.render()", but with prepare plugin you can do it before your game starts. You can also manually call bind() on all texture if you have a list.

Edited by ivan.popelyshev
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...