Looking at the scene with Shaded Wireframe shows how the geometry has the extra padding. Here is an example with the padding value at zero resulting in the behavior you have reported. As such, the geometry ends up with this extra padding where in your case it is revealing pixels from adjacent glyphs in your texture.Ī quick way around this is to set the padding on the material to -1 where as seen below and provided the GlyphRect values are set correctly renders as expected. I had a chance to look into this earlier today and the behavior is due to mesh padding where a padding value of 1 is used to prevent clipping on bitmap text. What steps have I performed incorrectly in my workflow above? I've attached my package to this post so that you can see all of my settings in action. It seems like an extra line or two of pixels are getting attached to the glyph, but I don't know why. The characters also seem to be positioned slightly off the screen, rather than directly in the corner as I'd expect. By using my scaler image, I can see that the characters are around 10 pixels tall. This means my first glyph had the following settings:Īs you can see, this is mostly off the grid, but my 8x8 characters are slightly out of scale. is how far the to step forward after a character is drawn (8 in our case).should be character size (8 in our case).I don't know what does but it only works when set to Zero.is the starting position on the sprite sheet is the width and height of the box on the sprite sheet. Glyph Bounding boxes start from the bottom left corner.Go to Unicode # of Glyph (I started with 0030, "0".).Click 3 dots again, and return to "Normal".Under Atlas Width and Height, enter Sprite Sheet Width and Height (in our case, 104x24).Under "Atlas," select Font Sprite Sheet.Under "Atlas Textures," under Element Zero, change reference to Font Sprite Sheet.Click 3 dots beside lock in the Inspector, and select "Debug".Under Material's "Debug Settings," set Font Atlas to Font Sprite Sheet.Change Material type to "Bitmap Custom Atlas".Click Arrow beside Font Asset and view the Material.Under Font Asset, set all values under Face Info to Zero except:.Character Set: Custom Characters using the string in the Font Sprite Sheet (In my case, "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ").Create a Font Asset (Window -> Text Mesh Pro -> Font Asset Creator).The TMP Text Asset may need to have its position adjusted as well.Change the Canvas Settings to the following:.Create a TMP Text Asset (UI -> Text - Text Mesh Pro).Add PixelPerfectCamera to the Main Camera. Here are all of the steps I went through: I'm trying to create a usable Text Mesh Pro font asset from a Sprite Sheet bitmap image, and keep that font aligned to a "pixel grid" for display. Hello! I've been back and forth with this for quite a while now, and unfortunately have never been able to get this working properly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |