0 Favourites

Tiled Backgrounds are deformed

  • Hi!

    I'm using Tiled Backgrounds on my upcoming game.

    They look good when WebGL is turned off -- but completely deformed when it's on.

    It only happens with the tiled backgrounds (sprites look good no matter if WebGL is turned on or off).

    WebGL off (NW.js):

    WebGL on (NW.js):

    When I test the game on Google Chrome it looks good even with WebGL turned on. However I need to make it run properly on NW.js (it will be an .EXE desktop app).

    Is there anything I can do to make the tiled backgrounds look good when using WebGL + NW.js??

    I want to turn WebGL on to make it run faster/better. Thanks in advance!

  • Hi could you post a capx with the error on and I'll check it out for you.

  • Also try setting 'Point' sampling in Project Properties

  • Hi could you post a capx with the error on and I'll check it out for you.

    Wow, thank you so much for offering your help!

    I'm attaching a smaller CAPX where the same error happens: https://www.dropbox.com/s/a53df6cn0rnlj ... .capx?dl=0

    Apparently it happens because I'm applying a 2x zoom to the layer - and somehow tiledbackgrounds gets deformed when zoom is active.

    I'll appreciate if someone finds a way to fix this *without turning zoom off* -- because I want to make the main game running in a low-res layer while messages and a few other things would run into a hi-res layer.

    Thanks again and sorry for my bad English!

    EDIT:

    I've tested my game on my father's PC... And it's running perfectly with WebGL on.

    My video card is an Nvidia (GTX 450) and his is an AMD (Radeon HD 6450).

    I still don't understand what's going on.

    WebGL on (AMD):

  • Macbee There doesn't seem to be any problem when I preview it, I'm using a surface pro 2, have you tried updating your video card drivers. Maybe send a screenshot of the error you're getting with the capx you've provided so I can see your problem

  • Macbee also these are the settings I have in all my games, could you try these and see if this helps

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • The problem is WebGL 1 cannot tile non-power-of-two textures, so C2 stretches them to a power-of-two size (e.g. 32x32, 64x64, 128x128 etc) before making a tiling texture. This is lossy and causes a slightly distorted texture sometimes. However WebGL 2 can tile any size texture, so it doesn't happen if the system supports WebGL 2. NW.js should support WebGL 2, providing you're up-to-date and not sticking to an old version.

    Probably the best workaround is to make sure all your tiled backgrounds are a power-of-two size.

  • Thank you so much Ashley! It's perfect now!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)