Is there a way to render strings as a light function?
I really want to be able to randomly select from a set of predefined text strings at runtime, and then project a material including that text as a light function.
Is there any way to do this, preferably through Blueprints? If not I can just bake each one into a big texture and select the text based on UV coordinates, but being able to type whatever I want right into a parameterized field seems so much more elegant.
asked May 02 '14 at 09:53 PM in Rendering
There is a Render to Texture feature that can be used to create textures from strings. Unfortunately, it's only available via c++ at the moment.
If the strings are predefined and you are not familiar with c++ I might recommend going with the uv approach.
A material function called debugScalarValues does something similar. It can be found in the material functions folder here: MaterialFunction'/Engine/Functions/Engine_MaterialFunctions02/Utility/DebugScalarValues.DebugScalarValues'. It manipulates the meshes uvs to display the correct n digit number with only a few texture samples.
If you're going to make something a bit more straight forward and only have a few strings to display than the "debug scalar value" approach may be overkill. In that case you could create a much simpler version of the same shader to pick from a series of strings that were stored in a texture.
Here is some info regarding the c++ tools I was mentioning earlier:
UE4: Canvas Render Targets
- There is a new C++ class called CanvasRenderTarget2D.
Follow this question
Once you sign in you will be able to subscribe for any updates here