4
\$\begingroup\$

I'm looking for a way to write a typed text on a texture, and then render it on a screen: in the game it's just the screen of a computer where a scientist is typing text on.

The texture will be already generated: it will have several textures in it.

I can't find any obvious way to do a simple render to texture with unity, how could I do that ?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

You can also just texture directly with an .mov, .mpg, .avi and so on.

Details here: Movie Texture

NOTE: Texturing with a video file is only available in Unity Pro and isn't supported on iOS/Andoid

\$\endgroup\$
1
\$\begingroup\$

I don't think you can use render textures in anything but Unity Pro. But assuming you have that...

http://unity3d.com/support/documentation/ScriptReference/Camera-targetTexture.html

Basically set up a camera pointing to whatever you want your render texture to be. You can set up layers so that you camera can only see things on a certain layer instead of having to have it off in the middle of nowhere. You then just have your screen's texture point to that render texture you've created.

Then you can just point the camera to whatever you want. If you want to just swap between textures it would be pretty easy to write a script to cycle some object to go between textures. You could also do it dynamically with 3D text if you wanted to save on texture space (and assuming you already had a font texture loaded).

\$\endgroup\$
2
  • \$\begingroup\$ In fact my initial problem is more like "animated texture" than render to texture. I feel dubious about the term, but I don't think I want something that resembles a surveillance camera. \$\endgroup\$
    – jokoon
    Commented Feb 4, 2011 at 16:28
  • 2
    \$\begingroup\$ Well in that case you just want a script that updates the texture over time. void Update() { if( Time.time > timeToNextTexture ) { renderer.material.mainTexture = nextTexture; } } \$\endgroup\$
    – Tetrad
    Commented Feb 4, 2011 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .