point interpolation sampling for the window object

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • it would make true 2x pixel resolution windowed games possible. right now if one tries to rescale a 320x240 window to 640x480, even with point sampling enabled in app properties, the window object won't simply double each pixel. one can notice 1x pixels being shown on the rescaled product.

    is this easy to implement? it would make some ppl around here happy.

    (David told me on chat that it uses linear sampling to stretch the back-buffer, which is why it isn't truly doubled).

    If it's not possible with the window object, can it be made an application property?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you stretch the window, DirectX does an automatic stretch with linear filtering. That cannot be changed, DirectX doesn't support it (don't ask me why it's like that). The best thing to do is to make your window the true size in application properties, then zoom the display to 200%. With point sampling on, you should get everything double-sized, and nice and pixelly.

  • zooming only zooms straight into the center of the window on a 640x480 layout. a 320x240 rectangle would have to be right in the center for it to zoom properly at 200%. simply creating a 320x240 layout and zooming 200% on a 640x480 window size results in a strange black edged box.

    I think im missing something, is it possible to correctly zoom 200% on a 320x240 layout, filling the 640x480 window correctly?

  • Yes, make a 640x480 window, zoom to 200%, and enable 'unbounded scrolling' in the layout properties. The layout boundaries affect zoom at the edges of the layout. You'll need to come up with your own way of doing scrolling boundaries, perhaps just impassable obstacles around the edges.

  • If you want Bounded scrolling up to the edge of your level along with 2x zoom, you can do that by creating an empty buffer space around the edge of your layout. So if your window size is 640x480 you'd need an allowance of 320 pixels wide at both the left and right edges of your layout, and 240 pixels tall at the top and bottom edges. It's kind of a pain to set up that way though, so Unbounded scrolling might be the way to go.

    Or you could fake boundedness with Unbounded turned by following the player with events (instead of the Center View checkbox), and if the player is outside of the area you wish him to be followed, stop following him. That would probably be the easier solution.

  • Ash, so are you saying my layout must be 640 and i must live with a centred zoom?

    -deadeye, unbounded scrolling still doesnt eliminate the black bars at the left and top of the layout. im geussing buffer space with stoppers is the way to go.

  • [quote:1yrtrg90]If you stretch the window, DirectX does an automatic stretch with linear filtering. That cannot be changed, DirectX doesn't support it (don't ask me why it's like that). The best thing to do is to make your window the true size in application properties, then zoom the display to 200%. With point sampling on, you should get everything double-sized, and nice and pixelly.

    I'm thinking you could override OnSize and do a resolution switch to the nearest available res? Perhaps a runtime setting.

  • rich this would ultimately simplify things.

  • Ash, so are you saying my layout must be 640 and i must live with a centred zoom?

    No. Try it. Unbounded scrolling stops the centred zoom.

    I'm thinking you could override OnSize and do a resolution switch to the nearest available res? Perhaps a runtime setting.

    That would keep the window at 100% zoom. If you deliberately want the display stretched, and the runtime is drawing a screen one size and the window is another size, DirectX always linear-filter stretches the drawn screen to the window size. This could be worked around by always drawing at the same size the window is, but then doing some manual stretching somewhere in the rendering process.

  • That would keep the window at 100% zoom. If you deliberately want the display stretched, and the runtime is drawing a screen one size and the window is another size, DirectX always linear-filter stretches the drawn screen to the window size. This could be worked around by always drawing at the same size the window is, but then doing some manual stretching somewhere in the rendering process.

    so ash are you saying a simple 2x doubling is implmentable? as an app property lets say?

  • Maybe, but it's a reasonable amount of coding when it works fine with unbounded scrolling enabled and the display zoomed to 200%.

  • even with all this im still catching abit of scewing.

  • me and deadeye were experimenting with this and the solution with unbounded scrolling does'nt work. the black bars at the top and left cannot be eliminated when zooming a 320x240 to 640x480 even with unbounded scroling enabled. also, we were experiencing sprites randomly disappearing for no apparent reason. ill post the cap as soon as i get back onto my other pc.

    Maybe, but it's a reasonable amount of coding when it works fine with unbounded scrolling enabled and the display zoomed to 200%.

    it doesnt work fine i feel this kind of feature is important, construct should support as many resolutions as possible. zooming is a workaround, but a real res change would be needed. creating a large game with said workaround is difficult and ineffecient. zooming is great for short effects, but a full game should not be dependant on it.

  • I just made an example, but realised there's a small change in the file format in 0.98.4, and it won't load in 0.98.3 if I upload it... beh. Still, unbounded scrolling with Start of Layout - set Zoom to 200, 200 was working just fine. I'll wait until you upload a .cap.

    What's inefficient and difficult about creating a large game with the workaround I suggested? You only need one setting and one action, and you never need to touch it ever again, for the rest of the game!

  • I just made an example, but realised there's a small change in the file format in 0.98.4, and it won't load in 0.98.3 if I upload it... beh. Still, unbounded scrolling with Start of Layout - set Zoom to 200, 200 was working just fine.

    Here's the .cap Davioware mentioned, we were doing it exactly as you described:

    http://willhostforfood.com/files3/9756073/wonky.cap

    And here's a screenshot of what it's doing in case it actually is working fine for you:

    <img src="http://i42.tinypic.com/330qn90.png">

    What's happening is:

    1. The black bars

    2. Tiled BG objects disappearing when they get near the edge of the screen

    3. The pink sprite with 8Dir on it doesn't show at all

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