Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

alphanumeric texture

Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
05-12-2007 15:23
I am pretty sure this has been done before, so I am seeking knowledge from the people that have done it or know exactly how it is done.

I am thinking of making a texture, 512x512 pixels, that has alpha numeric characters across the entire image. These could be used for custom words build across prims that are placed next to one another that will be using the same texture, but have a different offset to expose a different letter on the prim surface.

So now for my question, what has been found as being the best sized image, or best sized letters to accomplish this task? Do I make each letter 30 pixels high and 20 across, if not then what? And will this work best with the available offset options that the SL editor has?

Any information would greatly be appreciated. I know that they have already done this when it comes to the billboards in the schools. This is the same idea. Just details on the most effective manner would be nice.
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
05-12-2007 16:54
You are correct that it's been done; to my knowledge, the most popular implementation by far is known as "xytext". This fancy scripted system uses specially-crafted prims that have several faces visible in front, and tweaking the texture offset to make it all work. Search the scripting forum for threads about it if you like.

I recently made a device using a modified version of the scripts dubbed "XY Text Light", which can be found here: /54/16/158923/1.html This one uses a prim tortured to have 5 visible faces (and thus 5 characters per prim).


I made my own 512x512 font texture like you're planning to do, and it was a slight pain in the neck but not too bad. The XY Light system uses a single texture (some implementations of XY Text use multiple textures) on a grid 9 wide x 11 tall, and I was able to make it work by taking a screenshot in game of the font provided by Osgeld Barmy, pasting it into photoshop, and lining up the placement of my characters by eye using that as a reference. Only took a few uploads to get it right. I generated my starting texture by typing characters into Microsoft Excel, centering everything, coloring it to eliminate the grid lines, then taking a screenshot and pasting the results into Photoshop.

As to the sizing... well, there's no way to determine the "best size" for any job. It comes down to how you plan to use them. Will this be a giant billboard? Will people tend to be zoomed in on it such that the words fill their whole screen?

I'll IM you in game and you can come take a look at my usage if you like, so you can see how it looks and scales with ~100 characters in a 512 x 512 image.
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
05-12-2007 19:35
Thank you very much for the information. I would like to see what you have done with this.

Yes, my size it going to be relatively small, the surface will most likely be about 0.010x0.010 . No billboards here. :p
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
05-12-2007 22:47
the hardest part is finding a font that is actually square most are offset to 1 side or the other by 1 pixel upto 3 pixels, which buggers up your math and makes your texture a non power of 2 or your letters off

or in the xy text light script both

course some of that was SL's fault they just fixed texture offsets and repets where its back to its 2 decmal accurcay vs the 1 decmal accuracy that i used in that script

for best results

use a monospace font

dont use antialasing (sl + open GL will take care of that for you)

again use a font that is even on all sides (where W isnt offset to one side and A is on the otherside) ie: alot of the time i end up with a A being 3 pixels from one edge and only 2 on the other

if all else fails make your own font, which can be done quickly with even ms paint (since theres no antialasing)


sizes ... doesnt really matter, ive made some dot matrix looking fonts where the whole sheet was 128x128, course the more detailed the graphics the more pixels you need
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
05-13-2007 14:53
Again, thank you for the useful information.