- Home /
dynamic images for textures ar runtime
Hi, I'd like to know if in Unity3d is possible to change an image at runtime (e.g. drawing a rect on an image or merging two images) and assign it to a texture a runtime This is possible for example in java, is it possible in Unity3d too? thanks bye
Answer by syclamoth · Sep 25, 2011 at 01:47 PM
Yes, it is possible, but doing direct changes on to a texture with per-pixel edits is extremely slow. Depending on what you want to do, you probably want to use a special shader for this kind of work (fading from one texture to another is extremely easy, and fast, like this).
Answer by trumanita · Sep 25, 2011 at 03:04 PM
no, I don't want that textures changes during game, but I only want to work on images during game loading, for example if I have an image with a red background, I want to draw on it a text (depending from some condition), and then use this image as texture in a material assigned to an object. then this texture will remain the same for all the game
So, are you modifying it at run-time, or are you loading files from the disk? There's nothing in-between. Even if it's just a once-off change, as long as it happens after you open the game you will still have to deal with the run-time penalties of pixel modifications!