Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

The best way to add border/gap/margin to existing spritesheet
Started by bitinn Jun 30 2016 10:42 AM

- - - - -
28 replies to this topic

Best Answer bitinn , 07 July 2016 - 06:43 AM

I have found a semi-ultimate answer to this: just create a new tileset, a new layer, move the exact same tiles onto them, and do your layer again.

 

And BAM, no more off-1px or sub-pixel rendering problem on iOS.

 

Does it imply a bug somewhere in the Corona SDK? Yes.

 

Can I find an easy reproduction test for it? No, I tried, it only happens when you have a large number of tiles and layers.

 

So guys, if you are absolutely stuck, and tried all my previous solutions: try re-do your layer and tileset.

[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

bitinn

[GLOBAL: userInfoPane.html]
bitinn
  • Enthusiast

  • 71 posts
  • Corona SDK

  Best Answer

I have found a semi-ultimate answer to this: just create a new tileset, a new layer, move the exact same tiles onto them, and do your layer again.

 

And BAM, no more off-1px or sub-pixel rendering problem on iOS.

 

Does it imply a bug somewhere in the Corona SDK? Yes.

 

Can I find an easy reproduction test for it? No, I tried, it only happens when you have a large number of tiles and layers.

 

So guys, if you are absolutely stuck, and tried all my previous solutions: try re-do your layer and tileset.



[TOPIC: post.html]
#27

rakoonic

[GLOBAL: userInfoPane.html]
rakoonic
  • Contributor

  • 112 posts
  • Corona SDK

I did find a problem in the past with very large tile source images, due (I assume) to some kind of rounding error from integer pixels to float UV coordinates - if I recall it occurred when tile set images were larger than 1024x1024 pixels (causing tiles further into an image than 1024 pixels in any axis to be slightly offset). Does this correlate at all to the images you are using? Also, this was a long time ago, so maybe it isn't an issue any more.

 

I thought I posted some other possibilities in the other thread, but apparently they never survived the dodgy internet from my phone while on the bus, so I'll try to remember what I suggested elsewhere.



[TOPIC: post.html]
#28

bitinn

[GLOBAL: userInfoPane.html]
bitinn
  • Enthusiast

  • 71 posts
  • Corona SDK

I did find a problem in the past with very large tile source images, due (I assume) to some kind of rounding error from integer pixels to float UV coordinates - if I recall it occurred when tile set images were larger than 1024x1024 pixels (causing tiles further into an image than 1024 pixels in any axis to be slightly offset). Does this correlate at all to the images you are using? Also, this was a long time ago, so maybe it isn't an issue any more.

 

I thought I posted some other possibilities in the other thread, but apparently they never survived the dodgy internet from my phone while on the bus, so I'll try to remember what I suggested elsewhere.

 

At least 2 affected tilesets are 256 x 1280 and 256 x 1728, so it's possible.

 

I would like to know why this isn't mentioned on documentation... Is it iOS only?

 

EDIT: Case 46684 is opened for this issue, if they couldn't fix it, I am hoping at least we can ask them to update a warning in the newImageSheet documentation?



[TOPIC: post.html]
#29

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

@rakoonic, slight tangent on precision (i.e. probably not relevant to bitinn's issue), but for larger images, the UV's default to mediump (https://docs.coronalabs.com/guide/graphics/customEffects.html#precision-qualifier-macros) which is device-dependent.

 

You can override them to higher precision as described here: https://docs.coronalabs.com/guide/basics/configSettings/index.html#shaderPrecision

 

In addition, if memory serves, you can also set different precision for each macro separately rather than setting them globally for all macros as currently documented.

 

This gives you more flexibility to selectively choose higher precision which generally increases the GPU cost in the shader (so only increase if you really have to):

 

application {

content {

shaderPrecision = { P_UV = "highp", P_COLOR = "highp", },

},

}




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]