Mojo bug - Maybe DrawSubImageRect

Monkey Forums/Monkey Bug Reports/Mojo bug - Maybe DrawSubImageRect

Rushino(Posted 2013) [#1]
Hi Mark,

I have been struggling with this. I am having a strange display problem with font generated with FontMachine when i make use of virtual resolution, Ziggy think
its a mojo DrawSubImageRect bug. Would be really glad if you could check this up. I could use Ignition but to be honest i need sharp font and ignition doesn't seem to make any sharp font out of the box so i can't use this.

Image of the problem:

http://sdrv.ms/YHe0KR or you can also load the sample.

What i know about this bug:

- Tried it on Windows 8 and XNA. Do the same thing so it seem to be generalized.
- Seem related to the Autofit module but probably more anything that set virtual resolution in some way.
- If i set image filtering to false it fix the issue but the font look rather like crap after.. which is not an option.

Here a sample:

http://sdrv.ms/15xErql

- You need Autofit (located in Bananas)

To replicate:

If you test in XNA, set the program resolution to 1920x1080 and lets the virtual resolution to 1024x576. You should see some top line over some chars.


ziggy(Posted 2013) [#2]
Rushino, before deciding it's any kind of issue related to Monkey, feel free to send me the source code and offending fonts to my email, so I can take a deep look to it and ensure it's a DrawSubImageRect bug.

EDIT: I've just seen the download. I'll take a look


Rushino(Posted 2013) [#3]
You can get the sample code here: http://sdrv.ms/15xErql font are included.

I didn't want to put the fault on Monkey sorry if anyone though so. But i really wish i could fix this issue cause its rather bothering right now. Since it seem to happen with Autofit.. i though it could be some mojo function.


Rushino(Posted 2013) [#4]
I suggest you remove anything related to ignition in it or it won't run. (you only have 3 line of code to remove)

I would really be glad if you could check what wrong.. you would make my day.

Thanks a lots!


Rushino(Posted 2013) [#5]
@Ziggy Any updates on this ?


Rushino(Posted 2013) [#6]
bump!


marksibly(Posted 2013) [#7]
Do you have padding pixels around the cells/chars in the image atlas (assuming you're using one).

If not, and the image is being transformed in some way (eg: via scaling for virtual resolution) then stray texels from neighboring cell edges may be accidentally picked up when rendering.


Rushino(Posted 2013) [#8]
Is there an easy way to fix this ? or maybe i could just change the font.. but i believe i will see the same problem with tile maps (which ive heard of).


marksibly(Posted 2013) [#9]
Alas, there is no 'easy' fix for this - image atlases really need to created with padding in mind.

There are image flags (Image.XYPadding etc) that you can use to let mojo know you''re using a padded image atlas, but it's up to you to provide pre-padded images - see mojo/data/mojo_font.png for an example.


Rushino(Posted 2013) [#10]
Alright! Thanks for the tips i will look at this.


Rushino(Posted 2013) [#11]
It seem ignition doesn't have this problem because it enable use to create padding around chars cell which FontMachine doesn't have. Ziggy do you think you could add such a support in FontMachine ?