1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HTML>
<HEAD>
<TITLE>Crystal Space: VIS portal/Sector visibility</TITLE>
<META NAME="description" CONTENT="Crystal Space: VIS portal/Sector visibility">
<META NAME="keywords" CONTENT="Crystal Space: VIS portal/Sector visibility">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC401"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_186.html#SEC400"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_188.html#SEC402"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_174.html#SEC377"> << </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_181.html#SEC390"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_190.html#SEC405"> >> </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<HR SIZE=1>
<H4> 7.6.7.6 Portal/Sector Visibility </H4>
<!--docid::SEC401::-->
<P>
Portal/sector visibility is based on 2D clipping. The 2D projected
outline (in screen coordinates) of the last portal is used as a clipper
for all geometry that can be seen through that portal.
</P><P>
This approach obviously has some disadvantages. It means we have to
transform all geometry to camera space and then to screen space. Given
the current advances in hardware (i.e. hardware accelerated transforms)
this is no longer a good thing to do. In the future it might be possible
to change this system to 3D clipping. For now this is a fundamental change
and we'll try to get around this limitation in other ways.
</P><P>
The most important way to fix this limitation is not to cull detail
objects like this. i.e. sprites, curved surfaces, and detail things should
not be clipped to the 2D portal this way. Only for the software renderer
could this make some sense as overdraw is expensive there. The
new DrawTriangleMesh and the even newer DrawPolygonMesh (in iGraphics3D
interface) will be able to handle this. All detail objects will be
rendered with those. The engine will take care to only enable
clipping if <EM>really</EM> needed (i.e. there are some cases where clipping
is mandatory: for example, if you have a floating portal you cannot
rely on correct Z-buffer information. So you need to clip geometry
to the 2D clipper).
</P><P>
For detail objects we have a number of options. We can simply
consider them visible is they are in the view frustum and ignore
portals all-together. Note that all detail objects are linked to a
sector. If a sector is not traversed too (because the current viewable
portals don't connect to that sector) then the detail objects in
that sector will not be considered as well. So for fast hardware this
approach can be good as overdraw is not very expensive.
</P><P>
Another option is to clip the convex outline of the detail object to
the portal. This is a rough clip which will simply indicate if part
of the object is visible and then render it in total if that's the case
(unless we have a special case like a floating portal which requires
clipping). This option is useful for intermediate speed hardware or
even for software if the detail object is very small. Clipping is
still an expensive operation (especially doing it for every triangle
or polygon) so we need to balance that against the cost of overdraw.
</P><P>
The last option is to clip every individual triangle or polygon.
For software rendering this might be the base case as overdraw
is expensive. This will have to be tested to see if that is really
the case.
</P><P>
So this will limit 2D clipping to world geometry which is still useful
because that enables good culling of other portals. Culling portals
is valuable because culling a portal means that the entire sector behind
that portal is also culled.
</P><P>
<A NAME="VIS in Sector Visibility"></A>
<HR SIZE=1>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_186.html#SEC400"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_188.html#SEC402"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_174.html#SEC377"> << </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_181.html#SEC390"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_190.html#SEC405"> >> </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|