1
\$\begingroup\$

Unity has an Asynchronous Upload Pipeline which can upload qualifying textures and meshes to the GPU asynchronously over several frames, rather than uploading in one frame and stalling the main thread.

I'm confused about how this would work at runtime. For example, let's say that on frame 100, I instantiate a prefab which has a mesh and 1 texture, both of which haven't previously been displayed (and therefore need to be uploaded to the GPU). Let's assume that streaming mipmaps are disabled, the mesh and textures are eligible for asynchronous uploading, that the mesh will take 1 frames to upload, and that texture takes 2 frames to upload.

What happens while the assets are uploaded to the GPU? Does the GPU stop rendering frames but Unity keeps processing frames on the CPU side? Or does the GPU keep rendering frames while waiting for the upload? If the latter:

  • At frame 100, we've just instantiated the prefab, but the mesh and textures have not loaded. What happens? Is the new GameObject just invisible?
  • At frame 101, the mesh has loaded but the texture hasn't. What is the state of the GameObject's MeshRenderer? Invisible? Visible but with a placeholder texture?
  • At frame 102, the texture loads. Presumably now the MeshRenderer renders as normal.

A tangentially related question; is it correct that there is no API to upload a mesh or texture to the GPU before it is visible to a camera?

\$\endgroup\$

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.