• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Deliverance

Portal Rendering - graph traversal

3 posts in this topic

I experience some problems when trying to perform portal rendering. First of all doing portal rendering with the clipping phase in world space is not an option, because this would be too slow. So as wondering on the internet I read somewhere that John Carmack's take on this was: to clip the portals in window space. That's clever :) and really fast. Anyway I did this but there are some problems, maybe I'm doing something wrong. Here are the problems: I transform every portal in window coordinates, find the bounding box(rectangle in fact) and then clip it against the (0,0,width,height) orthogonal frustum. Well this seemed right to me (before I implemented), but in fact it isn't. Sometimes when the clipping plane is spanning the portal, problems arise, even if there is a small portion of the portal Visible, the transformed portal (in window coordinates) does not fit in this: (0,0,width,height) I'm transforming the portal in window coordinates using gluProject passing the current modelview, projection and viewport (retrieved with glGet..) and I'm positive gluProject returns the correct results based on the information passed. I'm also considering implementing PVS, this would be faster(rendering) but it would require additional code to write, and more memory(a LOT on todays huge game levels) , I think that the portal alternative is a better option considering modern hardware and it is faster to achieve in code due to it's simplicity. And one more thing :) what does the Z component returned by gluProject stands for? I was hoping that some of you who already done this could point me in the right direction( please :) ) [Edited by - Deliverance on September 1, 2006 5:28:13 AM]
0

Share this post


Link to post
Share on other sites
What i do is that if the portal crosses the near plane, I just treat the clipped portal as [0,0]->[w-1, h-1] in size.

0

Share this post


Link to post
Share on other sites
You could also try clipping the portal against the view plane prior to gluProject'ing. In the end, though, as SimmerD says, you might as well just consider it takes up the full-screen because if it's intersecting the view plane it must be taking up a lot of screen area anyway. :)
0

Share this post


Link to post
Share on other sites
Thanks guys, making the portal as big as the screen solved the problem, I did not understand how can I figure out if a polygon in clip space is intersecting the near clip plane, and that was the source of error and confusion. Anyway the problem is solved now, and the portal rendering works really nice.

However, there is a BIG performance hit on fairly small levels (4000-5000 poly) polygons and I think the problem is due to the portal graph traversal: it traverses the same leaves more than once, even if sometimes these traversals are redundant.
Solving this with a "visited" flag for each leaf is not the way to go, this way drawing will be incorrect sometimes, missing some visible leaves.

Here's how I'm rendering:
1.0 Build for every portal a duplicate one(this way assigning directions to every portal) and then assign every leaf a list of portals. This is alsaw called sometimes: building the portal flow.

2.0 The actual rendering is as follows:


// No leaf visible
ZeroMemory(LeafVisible, NumLeaves);

void RenderWithPortals(int Portal, int Leaf, CVector3D Position, Rectangle2D Frustum)
{

LeafVisible[Leaf] = true;

// This computes the bounding rectangle in window coordinates
Rectangle2D NewFrustum = GetRectangle(Portal);
Rectangle2D Intersection;

if (!IntersectRect(NewFrustum, Frustum, Intersection))
return;

for every portal "NextPortal" that belongs to Leaf do
{
if (Portal can see NextPortal)and (Position is at the back of NextPortal's Plane) then
{
RenderWithPortals(NextPortal, the leaf next portal is pointing to,
Position, Intersection);
}
}
}

After the function is called for every portal in the current leaf LeafVisible[] will contain the visibility information.


I was wondering if this is the way to go, are there any better options, or maybe is this approach wrong in some way?
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0