Jump to content

A simple Text Shader


Juanxer
 Share

Recommended Posts

A very simple text shader, with Font Selection, Font Size, Left-Right-Center justification and Text Colour. Able to accept carriage returns plus some way to keep the text origin fixed if one retypes centered text without changing the number of lines.

One could add Photoshop-like features, such as kerning and leading, but those basics could cover for the 90% of cases, really.

My guess is the differences between OS X and Windows' font rendering techniques could be a problem for multiplatform setups, if the shader relies on them. But this is one of those things that could save us a lot of thankless Photoshop work.

Link to comment
Share on other sites

Hola Juanxer

Everything is quite understandable, but please explain us WHY do you persistenly call this feature as "simple"? :-) The actual Mr.Font is a solid piece of code (yes, not near perfect). There is a big difference in "PS draws" (pixes) and "draw 3D" (model in hand). What extra functionality is required?

Link to comment
Share on other sites

Hi Igors,

I don't thing Juanxer meant simple as "easy to do" but simple as "with a simple interface" or "simply doing text". MrFont is doing 3D text and I understood Juanxer suggested a tool to enter text to be printed on a group as a map without going to Photoshop to create it. Juanxer, correct me if I'm wrong. Igors, very few people here knows what it represent to code something like that but I doubt any of it is simple.

post-17-13269393547064_thumb.png

Link to comment
Share on other sites

Yes, sorry if I wasn't clear: What I meant is a shader able to produce text as a texture map.

Let's say one has to populate a scene with several duplicates of an object, nearly everything in them being the same except text in their texture maps (say, numbered doors, labels in folders or books, announcement displays in an airport, etc.). It would be great to be able to create and edit that text directly in EIAS instead of via Photoshop, specially if it is subject to change.

By simple I mean rather basic text formatting features, sort of like some very basic titler in videoediting software. Richard's UI mockup shows exactly what I had in mind.

Link to comment
Share on other sites

Hi again

We've confused all, thx for explanations. Ok, after some thinking: technically it's very complex. The details are:

- shaders API does not support fonts enumaretation. Although a portion of native code is possible, it would increase shader's chances to be incompatible with next OS vers and/or EI vers;

- with network render there is no any guarantee the exactly same font is installed on all slaves;

- a procedural cannot be previewed in Texture Dialog, cannot be mapped as a sphere, cylinder etc. Although a shader can provide all these kinds of mapping itself it could not help with interactive feedback;

- a procedural should provide sampling and anti-alias itself, so in this case it should do all that Camera does for texture image (and have corresponded options);

- memory problems are possible. On render side images are stored in cachePageFile and loaded by parts when necessary. But a procedural can only keep a whole image (drawn text) in RAM.

Sorry for a lot of "cons". It's just "this concrete case", we don't want to be "killers of ideas" ;-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...