point interpolation sampling for the window object

New releases and general discussions.

Post » Wed Jan 07, 2009 6:28 am

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?
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Jan 07, 2009 4:08 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Wed Jan 07, 2009 5:58 pm

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?
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Jan 07, 2009 6:04 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Wed Jan 07, 2009 6:37 pm

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.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Jan 07, 2009 6:40 pm

@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.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Jan 07, 2009 6:48 pm

[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.

[/quote:1yrtrg90]

I'm thinking you could override OnSize and do a resolution switch to the nearest available res? Perhaps a runtime setting.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Wed Jan 07, 2009 6:56 pm

rich this would ultimately simplify things.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Jan 07, 2009 7:12 pm

[quote="Davioware":2waikdp0]@ash, so are you saying my layout must be 640 and i must live with a centred zoom?[/quote:2waikdp0]
No. Try it. Unbounded scrolling stops the centred zoom.

[quote="Rich":2waikdp0]I'm thinking you could override OnSize and do a resolution switch to the nearest available res? Perhaps a runtime setting.[/quote:2waikdp0]
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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Wed Jan 07, 2009 7:41 pm

[quote="Ashley":33nvqzo0]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.[/quote:33nvqzo0]

so ash are you saying a simple 2x doubling is implmentable? as an app property lets say?
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests