x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
Tags:
more ▼

asked May 02 '14 at 09:53 PM in Rendering

avatar image

SFtheWolf
399 35 39 48

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.
- You can use it to create render targets that are updated every frame by some C++ code that draws to it using the Canvas interface.
- You can then apply the render target texture to 3D models in your scene.
- This gives you a way achieve in “in-world” UI without using TextRenderComponents.
- However, it does not work with Blueprints yet.

more ▼

answered May 07 '14 at 05:08 PM

avatar image

TechArt STAFF
66 2 2 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question