User-defined graphics imported in-game?

I have a bit of a strange one here. I am trying to create a rotating photo cube. Using planes applied to the surfaces of a parent cube, how would I prompt the user to import their own pictures into the planes of the cube during the game and, once done, how do I allow them to display that image?

You can use this http://docs.unity3d.com/ScriptReference/Texture2D.LoadImage.html to load any data from anywhere as JPG/PNG and then assign the new texture to a material.

Thanks TomasJ! How would I go about constructing the cube? Would it be better to make the cube and pack the images into a texture atlas for UV unwrapping or to make 6 child planes aligned to each side of the parent cube and load the images one at a time?

@DrownedBat : Using 6 child planes is the easy approach, and probably better than trying to construct a cube out of your images. I suggest making a material for each cube side, and assigning the user’s photos to each material. To actually load/store the textures, there are two options:

  1. Texture Atlas: pack all the photos side-by-side into an atlas, and use UV offset/scaling in the cube plane materials to sample the right ones. Less RAM overall
  2. Separate texture files (Easier!): simply assign each imported image to a cube face material. More RAM overall.

Either way, this will get what you want. :slight_smile: If you are operating in tight memory constraints or want faster loading time, go for texture atlas. If you’re lazy like me though and want something that get’s the job done “quick-n-dirty” then just assign each image to the corresponding child plane of your cube. :wink: