I need to periodically create dynamic textures with text drawn into them.
I also like to create virtually everything from script.
The textures only need to be generated once each time any of the text is changed, so I was wondering what the control mechanism is for rendering to textures.
Performance is not a big issue as this is a rarity and happens only when loading data.
Following what I’ve grasped of the usual Unity way it would be to:
- Identify when text has changed.
- Create a camera
- Create a render texture
- Associate the camera with the render texture
- Create the text I need rendered to texture (some fashion of GUI text or maybe text meshes or something)
- Setup camera position/lighting (if needed)
… - Once the texture has been rendered, convert to a Texture2D, dump render texture, dump render to texture camera
I’m curious though, for step 7, do I attach a script to the new camera and simply wait until update is called to know when the texture has been rendered, or is there some direct way to say “Camera::Render” (I doubt.)
Alternatively, am I going about this all wrong given my requirements:
Arbitrary number of textures
Periodic rendering to texture (probably along the lines of once every 5 minutes or so.)
BTW, also looking for advice on drawing Arabic (Chinese/Korean/Vietnamese/Turkish/Greek all seem to be fine on iOS, but Arabic in default font is lacking.)
Thanks!
Hans