areaportal visibility by filami. objectives practice the techniques of visibility determination...

31
AreaPortal Visibility By Filami

Upload: brianna-chauncey

Post on 16-Dec-2015

220 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

AreaPortal Visibility

By Filami

Page 2: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Objectives

Practice the techniques of visibility determination using Area Portals;

Develop an experimental application showing techniques of visibility determination for interior scenes;

Develop Know How for future game applications in the style of Doom3 or Unreal Tournament.

Page 3: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

What are AreaPortals?

A Technique the splits a scene in several areas interconnected by portals;

Lets to compute the visibility of contained objects fast and efficiently;

Effective on interior scenes full of rooms, corridors and the corresponding “doors” or portals.

Page 4: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

How to build a scenariowith AreaPortals?

All scenes are built using many objects that adds detail and mood to the scenery;

Those scenes are not adequate for the construction of the data structures, they have got a lot of small details and is difficult to identity the areas.

Page 5: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

How to build a scenariowith AreaPortals? (cont.)

The scene is then separated into 2 kinds of objects: A “Cage” that only has

walls, ceilings and floors.

“Static Meshes” with the remaining scene detail;

In the following picture, only the “Cage” is being shown; it is at the same viewpoint as the previous picture.

Page 6: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

How to build a scenariowith AreaPortals? (cont.)

It's then inserted new models into the “Cage” that will be identified as portals that will connect the areas.

Page 7: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

DEMO

Page 8: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Construction

After the scene as been loaded from hard drive, this one has to be prepared: Calculate the scene's areas; Compute the portals and corresponding area

connections; But first of all, the scene has to be subdivided

into convex volumes.

Page 9: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Binary Space Partition (BSP)

The BSP divides the “Cage” into convex volumes;

A BSP is computational binary tree whose divider are three-dimensional planes;

The following image shows a small example of a 2D scene divided by a BSP.

Page 10: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Binary Space Partition (Cont.)

It's possible to note that the BSP actually cuts some triangles;

Those cuts have to be minimized and that is possible using a subdivision heuristic that minimizes cuts without sacrificing the balancing of the tree.

The following images shows the cuts that have been applied by the application.

Page 11: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Binary Space Partition (Cont.)

The following image shows the computational tree generated for the actual test scene;

The blue dots are the nodes containing the cutting planes;

The rectangles are the tree's leaves with the number of “Cage's” faces on that leaf.

Page 12: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

DEMO

Page 13: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Calculating the Areas

After dividing the scene into convex volumes, it is then possible to determine the areas.

The areas are computed using raytracing: For each leaf pair, a given number of random

rays are traced; If one of those rays is not occluded, the two

leaves have to be part of the same area; The portals do not let rays pass.

Page 14: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Calculating the Areas (Cont.)

Page 15: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Calculating the Areas (Cont.)

Apart form occluding those rays, the portals also uses them to determine which areas it connects.

When a portal receives a ray coming from an area, the portal stores that area and the area is also notified that that portal is in it's inside;

The areas knows it's portals and the portals knows it's areas.

Page 16: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Calculating the Areas (Cont.)

The portals have to be simplified as well;

Their geometries are simplified into rectangles so in the future it simplifies the visibility system workings.

Page 17: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

DEMO

Page 18: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Application

After the needed data structures had been computed it is then possible, through a given point of view, identify which the tree's leaves are potentially visible;

Page 19: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

How the Portals are used?

It is calculated a visibility frustum through the point of view to determine which objects are visible;

The portals cuts out the visibility frustum; this way, the frustums are not able to see through the walls.

Page 20: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

DEMO

Page 21: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

What about Details?

Now that the scene's areas have been identified and it's possible to determine which leaves are potentially visible, how to insert again the details into the original scene?

Page 22: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

What about Details? (Cont.)

Each scene's detail is represented by a polygonal mesh and each mesh has a Bounding Box. That box can be inserted, through the use of the BSP, into a leaf (and corresponding area);

After being inserted into the scene, the polygonal mesh can then use the underlying structure to determine whether it is potentially visible to a particular point of view.

Page 23: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

DEMO

Page 24: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Where are those techniquesbeing used?

A lot of modern games still uses Area Portal or similar techniques to accelerate the drawing of their's interior scenes;

An example is Doom3 that used very similar techniques presented here both for construction of scenes as well for the visibility determination;

The Unreal Engine is also a very effective engine for interior scenes and it also uses some of the techniques presented here.

Page 25: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Prey

Prey is a 3DRealms game that uses the same game engine developed for Doom3;

It uses the same visibility system presented at the original game;

Those images where taken from the playable demo of the game and shows the portals on operation.

Page 26: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Prey (cont.)

Page 27: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Unreal Engine

In an article written for Game Developer Magazine by Lee Parry, Epic Game's lead level designer, it is possible to note that this engine also uses the concept of “Cage” and “Detail Meshes”.

“Cage” used for BSP and created using CSG (Constructive Solid

Geometry)

Addition of “Static Meshes” giving important details to

the scene.

http://udn.epicgames.com/Three/rsrc/Three/ModularLevelDesign/ModularLevelDesign.pdf

Page 28: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Unreal Engine (cont.)

The following websites from UDN also explains in detail all the techniques used by this engine for scene development: http://udn.epicgames.com/Two/IntroToUnrealEd.html http://udn.epicgames.com/Two/LevelOptimization.html

Page 29: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

Future Work...

Create a loading and compilation tool for scenes to be integrated into an artistic workflow and level editors;

Develop CSP (Constructive Solid Geometry) to create “Cages” simplifying the artists' work;

Automating placement of portals through the scene.

Page 30: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application

??

??

?

??

?

?

?

Page 31: AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application