The Image Loading restriction is too strict for a dynamically updated Gallery System.
It has been found that there has been a discussion about this in the feedback but it has been long shelved.
A relatively possible approach would be to generate thumbnails via Video Player, however after some experimentation it was found that the API behavior was extremely system and platform dependent.
There was no guarantee of consistent behavior, not only was the API complex and difficult to debug, but the code for the Unity related discussions was actually difficult to track down the cause of the problem, and ultimately it was found that synchronization could not be effectively controlled.
Some magical values and tricks had to be applied to make it work, but absolute reliability could not be guaranteed.
What’s worse is that Udon repackages it and lacks exposure to the original built-in functions, which makes it even harder to control.
Even if it works fine in C#, there is no guarantee that it will work effectively ported to Udon, and there are small details that the lack of API exposure will make the final operation more complicated.
Additionally, you need to convert a large number of images into a single Video each time through the software, and you have to circumvent the rate limit of five seconds for this to happen… Controlled decoding and copying of textures is accomplished in the process.
I’ve basically experimented with some of the programs I could find on Unity itself, and confirmed the uncontrollability of functions like frameReady to Graphics.CopyTexture.
CopyTexture, etc. Worse yet, Blit is even more uncontrollable than CopyTexture…
Since checking whether two textures match in pixel content is far beyond Udon’s ability, it can only be implemented that when a texture copy event occurs, the behavior of an empty loop must be performed continuously on subsequent frames until a certain level of copying is performed on the next frame.
In addition, can you specify the frame? Videoplayer related functions do not expose the frame, the controllability is extremely low…
I know there are simpler ways to do this, for example Videoplayer has an available decoder built into the system for H.264 format, up to 4096*4096 with hardware acceleration.
H.265/AV1 can have 8192*8192, but I’m sorry if the user can’t see it without installing it on the system from the Microsoft Store.
Splitting is done via a simple Shader, but there is an upper limit to the sharpness, or multiple images need to be weighed.
This means that there are reasonable combinations of 81922048 or 163841024, or a variety of other combinations, but this implies some kind of limitation.
You can solve it directly through UnWrap Mesh UV without writing a shader…