Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

Different behavior for sprite2D textures across browsers

$
0
0

Hi, 

 

I was wondering if someone had experienced slight differences in "offsets" using sprite2D texture and wether it might be related to caching.

As an example I have a fairly small texture of 16*16 here in svg, but i tried also using png, same problem.

58ebbb6b1e519_ScreenShot2017-04-10at19_05_10.thumb.png.606a3f245a36a6ed5a978f8188902de4.png

That's the begining of the sprite texture zoomed in 4800%

When using it in chrome with a code like this:

 

  const crossSheet = taskObject.cloneAssetIntoScene(R.get.crossSheet, scene) 
  crossSheet.hasAlpha = false

  const cross = new BABYLON.Sprite2D(crossSheet, {
    parent: canvas,
    id: 'cross',
    marginAlignment: 'v: center, h: center',
    spriteSize: new BABYLON.Size(16, 16),
    spriteLocation: new BABYLON.Vector2(0, 0),
  })
 
  cross.spriteFrame = R.get.cross_predict

The texture is at the center of the screen here, in chrome the top misses 0.5px

58ebbb69ef37b_ScreenShot2017-04-10at18_09_36.png.5b57028944524d93d903759eb336d66b.png

 

In Safari there is a difference in colors and width of strokes:

58ebbb69c7402_ScreenShot2017-04-10at18_09_28.png.d66cbdcb944f3889fe72778d9e93b07b.png

If now I am using a 16,17 sprite size i get a correct sprite in chrome:

58ebbb6a3b37f_ScreenShot2017-04-10at18_10_02.png.8b6c7187dd38ae095dabb4a34bda6398.png

58ebbc481e23f_ScreenShot2017-04-10at18_10_23.png.fa86925498fe0398bae31119c7a5b23b.png

But somehow it is seems worst in safari:

58ebbb6a8aefb_ScreenShot2017-04-10at18_11_08.png.fc803e0c9a7187c2de0107c4bc2a3f89.png

 

Any clue ? Do you think it is related to the caching strategy ? @Nockawa

 

Here is the link to the texture:

https://drive.google.com/open?id=0BxggOFF8_iXkb3JRRjg0YkJtRzQ 

Here is a playground, on the playground it is the BOTTOM 0.5px that get cutoff..

http://babylonjs-playground.com/#20MSFF#64

58ebc037a708c_ScreenShot2017-04-10at19_25_59.png.8de4dd67ac4ac9834442bfe26930d3ad.png

 


Viewing all articles
Browse latest Browse all 760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>