Point sampling not working with integer letterbox?

Discussion and feedback on Construct 2

Post » Sun May 27, 2012 10:12 am

Hello,

I don't know if this has to do with Construct r91 still being beta, but when I set my games' fullscreen parameter to "letterbox integer scale" the point sampling doesn't seem to be working.

Example: http://dl.dropbox.com/u/2725629/html5tests/Astrojone_point/index.html

The Mario sprite to the left is original-sized and shouldn't look as blurry as it does.

Tested on:
Firefox (Windows) - Doesn't work
Internet Explorer (Windows) - Doesn't work
Safari (Windows) - Doesn't work
Opera (Windows) - Doesn't work
Firefox (OSX) - Works
Opera (OSX) - Doesn't work
Chrome (OSX) - Works
Safari (OSX) - Doesn't work

Any ideas?

EDIT:

I asked some other people to test it as well:

One guy tested in Chrome on Windows 7 - Worked.
Another guy tested in Firefox on Windows 7 - Worked.
Another guy tested in Chrome on Windows 7 - Worked.
Another one tested in Opera on Windows 7 - Didn't work.
One guy tested on OSX Opera with an old "11 MacBook Pro - Didn't work.
The second guy tested on Firefox on Windows 7 64-bit with a GTX 560 - Worked.
Third one was on on Chrome on Windows 7 with a GTX 560 Ti - Didn't work.
The last guy was on Windows 7 64-bit with Intel HD graphics - Didn't work in Firefox or Internet Explorer, but worked in Chromebolosaur2012-05-27 11:14:22
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sun May 27, 2012 1:44 pm

Point sampling only works when WebGL is enabled, for the time being (browsers don't currently support changing canvas 2D sampling mode, but support is coming soon). Use the 'renderer' system expression to show which renderer is being used ("webgl" or "canvas2d"). The main reason WebGL isn't used on desktop is the graphics drivers are out of date, so try updating them. Mobiles also don't use WebGL for the time being. Hopefully the situation will improve with time, I know it's important for many games but we just don't have much control over it right now.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun May 27, 2012 2:11 pm

Thanks for the info.

I updated the example file to see whether the problem is with the renderer, and it appears that you are correct.

Example: http://dl.dropbox.com/u/2725629/html5tests/Astrojone_point/index.html

However, if outdated drivers was the issue, how come it still works in some browsers?

I'm getting canvas2d with:
Firefox in Win7
Opera in Win7
Safari in Win7
IE in Win7
Opera in OSX
Safari in OSX

I'm getting webgl with:
Chrome in Win7
Firefox in OSX
Chrome in OSX

As for iOS devices, you are also correct:
iPad 2 showed canvas2d
iPhone 3GS showed canvas2d
iPhone 4S showed canvas2d

So do you have any idea why some browsers are showing canvas2d while others aren't?

EDIT:

As I mentioned in the other thread about tearing, I've tried the HTML5 game Browser Quest on all browsers on both Windows and OSX, and I haven't experienced any blurring or anti-aliasing issues whatsoever. How come I'm only getting this with Construct 2 games?bolosaur2012-05-27 14:31:13
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sun May 27, 2012 10:14 pm

Is good to notice that some browsers dont support webgl.
I know firefox and chrome do.
Webgl in opera is comming in version 12 IIRC
And IE and safari I don't remember
B
18
S
1
Posts: 19
Reputation: 1,473

Post » Sun May 27, 2012 10:25 pm

Different browsers have different rules for which drivers they support. So you will get patchy support across different browsers if you have old drivers. Again, I highly recommend updating your drivers and this will likely enable WebGL for all browsers that support it. Unfortunately IE doesn't support WebGL, and Safari has it disabled by default.

Browser Quest probably drew all their artwork at double/triple/quad size with the point sampling baked-in to the images. You can do the same for your projects to get around the fact different browsers resize images differently.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Tue May 29, 2012 10:26 am

I understand, but are you sure it's not just Construct 2-specific? Because looking at Browser Quest, it actually seems that they're scaling up their graphics from a sprite sheet.

http://browserquest.mozilla.org/
http://cdn.mozilla.net/browserquest/img/1/spritesheet.png
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Tue May 29, 2012 1:21 pm

@bolosaur - they might use custom Javascript to resize the images in the engine. I suppose we could take a similar approach but for large games it can affect the startup time. It's hard for us to take a general approach that works for all games - custom-coded games like BrowserQuest can use specific hacks to make things work as they need and it doesn't matter if it wouldn't work well for different types of game.

Have you tried r92 by the way? Should improve the point sampling on WebKit browsers.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Fri Jun 01, 2012 10:53 pm

@Ashley

Ah, that makes sense, yeah.

As for the r92 update, I think it's really cool that WebKit browsers have been fixed, but since Firefox is still a pretty big market share I suppose the only solution is to wait until HTML5 rendering technologies have become implemented properly in all browsers, like you said in another thread.

Thanks for the info.bolosaur2012-06-01 22:56:02
B
22
S
5
Posts: 107
Reputation: 2,354


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 15 guests