Text on a surface

The basic need is for text rendered onto a surface of a model that is dynamically constructed based on an editor setting or via the Script API.

In SL, this is often called "text on a prim". This is not the floating text that appears above avatars' heads or sometimes above prims that always is always facing the viewer and upright. This is text appearing as physically "painted" on surfaces such that all viewers see the same thing in 3D space.

I picture this text being opaque with a transparent background so that whatever is behind it is visible. Ideally, the opacity of the text would be variable.

There are various ways to implement this. I would argue that dynamically constructing an image in memory and then slipping it into the texture cache is probably the best performer. Then any surface could use it.

One way to make use of this would be to flag a material during upload of a model as allowing dynamic text and some settings for it. The text would ideally overlay the other text and possibly obey properties like Metalness and Emissive, as though it were painted on using the same stuff.

One possibility would be that this just be a cookie cutter shader where the text creates opacity and all the texture settings get shown as opaque and the rest is pure transparent.

Marking a material as supporting (or being) dynamic text would make it available as a resource via the Script API, perhaps via a SurfaceTextResource object. Ideally, you'd give a logical name (as a setting) to the material, like "Label1" or "InstructionText". Then the resource can be fetched from ObjectPrivate or such.

The scope of formatting should be very limited. Some simplistic markup (markdown) language that's open for future use. First version could be single font, single color, no formatting, but Unicode. Later versions could introduce variable styles, fonts, colors, etc., as it makes sense to. I'd favor not trying to create an entire rich text system like HTML. Keep it simple and it'll be widely used.

1 comment

Please sign in to leave a comment.