What's the best way to render dynamic text on a material?

I’ve got a paper material which is blank and I want to render text onto the paper (as if someone wrote it by hand).

Currently, my technique is to just create a new texture in photoshop and bake the text into the texture. Obviously this isn’t a good technique because any time I want to create additional instances of text, I would have to create a new texture and if there are a ton of textures, it will eat up video ram.

What’s the best way to render dynamic text onto a blank piece of paper which can move around?

Here are two screenshots of my current implementation:

Paper on table with text

Paper being read:
189fc1858c91b23493b30d2e71b22371554137e9.jpeg

Note: The paper is slightly curved, so I’d like to avoid a text render component if possible since that causes clipping. Also, I don’t really know how to change the fonts in the text render component (I tried to create a new one and nothing showed up).
Note 2: What if I also wanted to include pictures and diagrams?

Simple:

  • Create a widget with your text and the page background. Place it somewhere in the world, unreachable.
  • Put a SceneCapture2D in front of it and render it to a texture.
  • Put that texture on the material for your piece of paper / book / whatever writing you need.
1 Like

Sorry, while that would work, I don’t think that’s the right approach. SceneCapture components are too computationally expensive. The other issue is that if there are more than one viewable document, you’d have to create separate scene capture components for each one.

There’s gotta be a better way… I’m looking for something like this:

00bc19c6f23e3319cd76bd47c573ee125e73535f.jpeg

Nah, you’d need only two for all of those. And you don’t capture it every frame, you trigger the capture only when the text changes. With a two-capture setup in the scenario you just posted, the first capture would be holding the two pages that are currently being turned (each page taking up half the UV space). The second capture would be the two pages being turned to. Once the player flips the page, the currently “hidden” capture updates to the pages required. Again, you don’t capture every frame, only when updated.

This is what do you want.

You need only change the string variable text and build again the texture on runtime

4 Likes

This is perfect! Exactly what I was looking for, thank you so much!