You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
I was just looking into why runtime texture export fails and found that basically there is none implemented! ShaderExporterBase has an #ifdef UNITY_EDITOR around the relevant parts and then just throws an exception if someone tries that at runtime with a comment on it that says "too many things can go wrong (can't encode compressed textures, etc)".
Note that this is incorrect, as numerous exporters (FBX, GLTF etc) show - you can always blit a compressed texture into an uncompressed one, and get that out as proper file. Even texture arrays can be unpacked if need be.
Also, there's a bug - the code there only works for textures on disk, not textures that only live in memory. It fails with exceptions when trying to export textures that aren't actual files on disk (e.g. texture assets that are subassets, textures created in memory, ...).
Note that this will also fail if the texture on disk is in a format Unity understands fine but USD doesn't (like, PSD).
Would be great if USD-Unity-SDK would support all textures and ideally give a choice of which ones to export - from disk or from memory.
The text was updated successfully, but these errors were encountered:
USD allows for tif embedding, so these could be read from disk directly, while USDZ only allows PNG and JPG. Thus, ShaderExporterBase would need to know whether we're currently exporting USD or USDZ to choose the right path.
reading back normals needs some extra handling, namely converting back from G16A16 to R8G8B8 so we can store the texture in tangent space / object space
exported texture filenames need to be unique
we should keep a dict of which textures have already been converted for which purpose and re-use the results to not duplicate data
mfe
changed the title
Textures can only be exported from disk, not from memory and not at runtime in a build
Textures can only be exported from disk, not from memory and not at runtime in a build (FTV-281)
Aug 22, 2019
etienne-unity
changed the title
Textures can only be exported from disk, not from memory and not at runtime in a build (FTV-281)
Textures can only be exported from disk, not from memory and not at runtime in a build (FTV-281) (USDU-233)
Aug 17, 2022
Hello! We've moved this feature request to our Roadmap for better internal tracking. If you head over to the Roadmap you can add more detail about your use case (on the 'USD Import ticket') for this feature to help us prioritize as we hope to be able to work on this in the future :)
I was just looking into why runtime texture export fails and found that basically there is none implemented! ShaderExporterBase has an #ifdef UNITY_EDITOR around the relevant parts and then just throws an exception if someone tries that at runtime with a comment on it that says "too many things can go wrong (can't encode compressed textures, etc)".
Note that this is incorrect, as numerous exporters (FBX, GLTF etc) show - you can always blit a compressed texture into an uncompressed one, and get that out as proper file. Even texture arrays can be unpacked if need be.
Also, there's a bug - the code there only works for textures on disk, not textures that only live in memory. It fails with exceptions when trying to export textures that aren't actual files on disk (e.g. texture assets that are subassets, textures created in memory, ...).
Note that this will also fail if the texture on disk is in a format Unity understands fine but USD doesn't (like, PSD).
Would be great if USD-Unity-SDK would support all textures and ideally give a choice of which ones to export - from disk or from memory.
The text was updated successfully, but these errors were encountered: