Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques...

19
Honours Graphics 2008 Session 7

Transcript of Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques...

Page 1: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Honours Graphics 2008

Session 7

Page 2: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Today’s focus

• Indoor environment rendering

• BSP and Portal techniques revisited

Page 3: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.
Page 4: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.
Page 5: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Indoor / urban rendering

• Often makes use of BSP / PVS system

• Octrees and Portal systems in use as well

• Portals form a solution for PVS creation

Page 6: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

BSP

• Several types of BSP trees:• Node-storing BSP• Leaf-storing BSP• Solid BSP

• Each BSP type has specific properties that make it more useful for certain purposes

Page 7: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Node BSP

• Original BSP tree as described by Fuchs• Chooses dividing plane from available faces in

geometry. Stores dividing face in node, passes along remaining faces as appropriate

• Not conducive to tasks such as collision detection as the faces on nodes have no spatial relationship

• Traditionally used in software renderers as it generates the least amount of splits

Page 8: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Node BSP, image

Page 9: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Leaf BSP• All geometric data stored in leafs• Nodes store only dividing plane• Leafs represent cells that store all the triangles

in a list• Cells are convex and it is possible to find the

openings between cells (sometimes called portals)

• Useful in hardware rendering and techniques such as collision detection

• Portals can be used to compute PVS for BSP

Page 10: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Leaf BSP, image

Page 11: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Solid BSP

• Expands leafs of leafy BSP to provide solid information

• Effective and elegant for techniques such as collision detection

Page 12: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Solid BSP, image

Page 13: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Solid Leafy BSP

• Simply combines leafy and solid BSPs to maintain advantages of both

Page 14: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Solid Leafy BSP, image

Page 15: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Portals

• Either placed manually by level-designers, or automatically

• Automatic placement not optimal, but useful in many cases – such as automatically creating a PVS (requires portal information)

• Uses splitting nodes of BSP to determine portals automatically

Page 16: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Portals for rendering

• Many advantages:• Theoretically no overdraw (optimal for software

rendering)• Allows effects such as transparency and reflection• Can cater for somewhat dynamic environments• Conceptually easy to understand

• But: can have significant computational overhead with arbitrary shaped view frusta with large number of planes.

• Not as good for urban scenes in general

Page 17: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Portals for rendering, cont.

• Automatic portal creation normally produces a very large set of portals

• Thus typically has to rely on manually placed portals by level-designers

Page 18: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

BSP, Collision detection

Page 19: Honours Graphics 2008 Session 7. Todays focus Indoor environment rendering BSP and Portal techniques revisited.

Homework

• Write code (pseudo or real) for Line-of-Sight determination

• boolean GetLOS(BSP t, point a, point b);• Complete for session 9