Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Portal Render Frustum question Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
ArkangeL

April 12, 2005, 05:40 PM

Hi all

One of my friends are asking me about what is the algorithm or transformation matrix to transform the actual frustum to 'one' frustum that are viewing only the portal that you can see in the actual position.

Anyone who have experience on portal rendering have any idea about it ??

Thx alot poeple

ARKANGEL

 
michaelz

April 13, 2005, 10:49 PM

I'm working on a portal engine right now and could probably help but I dont really understand what your asking......

Could you restate the Question differently please?

Michaelz

 
ArkangeL

April 14, 2005, 02:48 AM

Hi

Well my friend are working on a portal engine, so the problem he have is:

Imagine you are in a room, in this room you can see 1 portal, that portal are linked to another room.

Well when you try to render the geometry of the second room you will render all geometry inside your actual frustum. Are there any way to 'change' this frustum to fill only the portal area ? Doing this you can render the second room a little faster than if you render with the frustum of the first room.

So the question is, how can he do this 'transformation' or 'change' to the actual frustum to have a new frustum filling the portal linked with the second room.

thx a lot

ARKANGEL

P.D: Sorry for my english

 
michaelz

April 14, 2005, 09:49 AM

Ok I understand!!

What I have done to achive my portal furstrum is to have the program create a new frustrum which uses one point located at the viewer and the locations of the vertics of the unrendered portal polygon.

To create this frustrum from a portal with 4 sides you would create 4 planes with the 3 points being the:

---------Point 1----------Point2------Point3-------
1) (viewer position) and (1st) and (2ed) vertex,
2) (viewer position) and (2ed) and (3rd) vertex,
3) (viewer position) and (3rd) and (4th) vertex,
4) (viewer position) and (4th) and (1st) vertex

This 4 planes or frustrum are now used to clip your polygons behind your portal.

You could also add a near and far plane to clip agenst too.

Ok well I hope that my post made sence.

Just remember that if your cliping polygons with texture coords you must clip the coords too!!!!!

Michaelz

 
ArkangeL

April 14, 2005, 12:59 PM

Hi

Ok, a lot of thanks, but i have a question about the last comment, why we need to clip these coords too ?? Whats happen if you dont do this ??

Again a lot of thanks

ARKANGEL

 
michaelz

April 14, 2005, 05:56 PM

The texture coordinates (if you are texture mapping) need to be clipped so that the texture placement is correct on the polygon. So if you donít clip the texture coordinates you get really odd effects occur or no texture at all appearing if you just set them to NULL by default.

Later

Michaelz

 
ArkangeL

April 15, 2005, 04:52 AM

Hi

Ok, thanks for all

See you

ARKANGEL

 
gandalfsg1

April 19, 2005, 04:33 AM

I have a question about this solution when there are more than one portal.

The camera is in a room and I can see a portal, so I crate a new frustum with the information of the portal and the viewer point. But in the next room there are a second portal and I can only see a little part of this portal.

The problem I see is the algorithm don't use the information of the actual frustum and in that case you clip the frustum with the complete portal(ERROR), not with the visible part.

I think that using the information of the frustum this problem will be solved, but I don't know how to clip a frustum (6 planes) against the portal or a rectangle. If you have a diferent solution, please tell me it.

Thank you very much for your help

Alvaro

 
SeraVDF

April 21, 2005, 10:36 AM

Hi

I solved this problem by using a frustum stack. When a portal is visible for all! frustums of the frustum stack, a new frustum is created by the portal edge points and pushed to the stack. This isn't slow as it seems, couse you don't need to check all frustums. The test often stop after the first or second test.

Another solution is to create a convex bounding frustum by the current frustum and the portal. But at the moment I can't find a good solutions to do this.

If there is a better/faster way to do this ... my ears are open :o)

Sera

 
This thread contains 9 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.