Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline MSDeveloper  
#1 Posted : Thursday, January 12, 2012 12:35:41 AM(UTC)
MSDeveloper

Joined: 11/19/2011(UTC)
Posts: 10

Thanks: 2 times
Dear Developers and DE Team Members,

Currently I am developing for WP7 but always looking on DE. I think I will pick it up in Q1/Q2 2012 this year.


Actually I want to develop or finish my games on wp7 in a clean way, so I can easily jump to DE.
I am currently working on ScreenSpace (0-1) and PixelSpace (0-maxResolution).

My Question is,
if I have preferedBackBuffer.Width set to 300. But my GraphicsDevice.Viewport.Width is 1000.

What do I have to calculate that I have the correct values?

I mean if i have screenspace between 0 and 1 and I have a border that should go from the left to the right side, the pixelspace hast to be (0,1000) and not (0,300) right?


Hope I am clear enough to get help.

Thanks

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Thursday, January 12, 2012 2:02:54 AM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Well, this question has not much to do with ScreenSpace, but in fact how up-scaling is implemented in WP7.

If you set preferedBackBuffer.Width to 300 in your XNA game (or do it pretty much the same way with Settings.Resolution = new Size(300, 200) via the Delta Engine), your game will actually use 300 pixels in PixelSpace. No pixel beyond that will be rendered. Your GraphicsDevice.Viewport is just used to tell the device where to render your back-buffer (it could even just be half your screen or whatever else region you want to paint, usually it will cover the whole device to do the up-scaling).

So the pixelspace is your prefered back buffer size (or Settings.Resolution in DE) and not the up-scaling size of your device, which is Graphics.Viewport by default if you have not changed it (or Application.Information.MaxResolution in DE).

See: http://msdn.microsoft.co...us/library/ff966425.aspx
thanks 1 user thanked Benjamin for this useful post.
MSDeveloper on 1/12/2012(UTC)
Offline MSDeveloper  
#3 Posted : Thursday, January 12, 2012 3:39:08 PM(UTC)
MSDeveloper

Joined: 11/19/2011(UTC)
Posts: 10

Thanks: 2 times
Hello Benjamin,

thanks for your quick anwser.


Well, I didnt get it.
I thought the DE uses two spaces. The one is used for rendering on screen (with pixel coordinates)
The other is used for example for calculating collision (in relative size to screen between 0 and 1. 1,1 is 100% and means the right bottom corner).

Thats what I d like to use in my current wp7 project too, to be easily able to switch in future to DE (and for perfomance reason too ;-) )


but I am confused what I have to use to calculate from screenspace (0.2f,0.2f) to pixelspace (800*0.2f, 480*0.2f) ??

Thanks in advance

Edit: you said, preferedbackbuffer is my pixelspace. So I calculate (0.2f * PreferredBackBufferWidth, 0.2f * PreferredBackBufferHeight) right?
What about rounding differences due to integer float?

Thanks

Edited by user Thursday, January 12, 2012 3:43:07 PM(UTC)  | Reason: Not specified

Offline Benjamin  
#4 Posted : Thursday, January 12, 2012 6:30:06 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Checkout the wiki page about Quadratic Screen Space to understand it better: http://deltaengine.net/Wiki.ScreenSpace

The basic idea is to get rid of resolutions and aspect ratios and keep all applications and games inside the (0-1) range for both width and height. Obviously everything would look stretched and wrong, so either top and bottom (for widescreen or landscape mode) will be cropped or left and right (for portrait mode) will be cropped.

This means you should not use the full (0-1) range in your game, but instead some inner area that is always available. You can still dock stuff at the screen borders via Screen.DrawArea (which tells you where the border is in quadratic space).

Use the ScreenSpace.ToQuadraticSpace and ToPixelSpace helper methods to convert from one space to another. Since this functionality is not in XNA it won't be that easy to port it outside of the Delta Engine ^^
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.304 seconds.