Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Doing 2D "Portal rendering" in XNA


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Dai++   Members   -  Reputation: 116

Like
0Likes
Like

Posted 21 February 2013 - 02:30 AM

I'm not talking about the 3D culling technique, but like the game Portal, but in 2D.

 

What I'm wanting to do has already been done by a couple of really simple games: ASCIIPortal ( http://cymonsgames.com/asciiportal/ ) and Portile ( http://www.increpare.com/2008/11/portile/ ), however they are both limited... ASCIIPortal is text-mode (but an amazing achievement nonetheless) and Portile which tessellatess the game world - I'm interested in duplicating ASCIIPortal's 2D "viewport" concept. Is anyone aware of any other similar games/concepts?

 

(Note that I'm not actually going to make a platformer)

 

I'm wondering what the best way to implement this is. The simplest would be to just have a single sprite surface and do all of the rendering in software, but that's just hackish.

 

I was thinking I could render the "original" 2D world to a full-screen sprite surface, then each 2D portal is a blitted copy of the original world that is  renderedto a new sprite surface layered on top of the original world but with an alpha channel that forms the "view cone" of the portal, the process is repeated as necessary in case the portal copy of a portal is visible.

 

...if I phrased that correctly.

 

I'm using XNA, if it helps.

 

Thanks in advance!

 

EDIT: I juust found out about Gateways for the Xbox ( http://marketplace.xbox.com/en-US/Product/Gateways/66acd000-77fe-1000-9115-d80258550bea ), which does the rendering effect I'm after. So at least I know it's possible, but what's the best way to do it?


Edited by Dai++, 21 February 2013 - 02:41 AM.

Printed on 100% Recycled Pixels

Sponsor:

#2 Seabolt   Members   -  Reputation: 633

Like
0Likes
Like

Posted 21 February 2013 - 01:39 PM

You should be able to do it the same way portal does:
 

a.) Designate a portal

b.) Place a camera looking out from that portal

c.) Bind portal render target

d.) Draw the world using that camera. (Could be expensive, try to keep the Fov small and frustum cull)

e.) Unbind portal target

f.) Draw world

  - If you're drawing a portal surface, draw the sprite using the portal render target as the texture

  - Then draw your portal border


Perception is when one imagination clashes with another




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS