⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vox.htm

📁 关于windows游戏编程的一些文章还有相关图形
💻 HTM
字号:
<!--Header-->
<HTML>
<HEAD>
<TITLE>GPMega - Advanced Section - Voxel Texturing</TITLE>
<META NAME="DESCRIPTION" CONTENT="An extensive and technical abstract on Voxel Texturing, a method that uses voxel's (volumized pixels) to render 3d objects.  The article covers the rendering procedure for using voxels to texture polygons and then presents detailed analysis of performance of the algorithm with pictures.">
</HEAD>
<BODY BGCOLOR=#000000 TEXT=#FFFFFF LINK=#00FF00 VLINK=#00FF00 ALINK=#0000FF>
<!--End Header-->
<!--Advertiser-->
<CENTER>
<TABLE>
<TR>
<TD>
<A HREF="http://www.ugo.com/">
<IMG SRC="/GPMega/ugologo120.gif" BORDER=0 WIDTH=120 HEIGHT=60></A>
</TD>
<TD>
<IMG SRC="/GPMega/sponsored.gif" WIDTH=468 HEIGHT=10><br><br>
<SCRIPT LANGUAGE= "JavaScript">
<!--
var now = new Date();
var random_num = now.getSeconds();
document.write("<A HREF='http://www.ugo.net/RealMedia/ads/click_nx.cgi/www.perplexed.com/GPMega/advanced/vox.htm/" + random_num + "/@Top'>");
document.write("<IMG SRC='http://www.ugo.net/RealMedia/ads/adstream_nx.cgi/www.perplexed.com/GPMega/advanced/vox.htm/" + random_num + "/@Top' BORDER='0' WIDTH='468' HEIGHT='60'></A>");
//-->
</SCRIPT>
</TD>
</TR>
</TABLE>
</CENTER>
<!--End Advertiser-->
<!--Splitter-->
<BR>
<!--End Splitter-->
<!--Body-->
<FONT SIZE=2 FACE=Helvetica>
<STRONG>
<!--Top Navigation-->
<A NAME="top"></A>
<CENTER>
<TABLE WIDTH=75%>
   <TR VALIGN=MIDDLE>
   <TD ALIGN=LEFT>
      <IMG SRC="gradsplit2.jpg" WIDTH=100% HEIGHT=1><BR><BR>
      <A HREF="http://www.perplexed.com/GPMega/"><IMG SRC="logo.jpg" BORDER=0 ALT="Home" WIDTH=80 HEIGHT=47 ALIGN=CENTER></A>
      <FONT COLOR=#666666 FACE=HELVETICA SIZE=-1><I>
      This Article Is Taken From <A HREF="http://www.perplexed.com/GPMega/">The Game Programming MegaSite</A>, A Definitive Resource For Game Developers!
      </I></FONT><BR>
      <IMG SRC="gradsplit2.jpg" WIDTH=100% HEIGHT=1>
   </TD>
   </TR>
</TABLE>
</CENTER>
<BR><!--End Top Navigation-->
<!--Title-->
<H3 ALIGN=CENTER><font color="#FFEE00">V</font><font color="#FFDD00">o</font><font color="#FFCC00">x</font><font color="#FFBB00">e</font><font color="#FFAA00">l</font><font color="#FF9900"> </font><font color="#FF8800">T</font><font color="#FF7700">e</font><font color="#FF6600">x</font><font color="#FF5500">t</font><font color="#FF4400">u</font><font color="#FF3300">r</font><font color="#FF2200">i</font><font color="#FF1100">n</font><font color="#FF0000">g</font><BR><FONT SIZE=-2>By: Martin Weiner and Jon Wise</FONT></H3>
<!--End Title-->

<p>In this paper, we present our new graphical rendering concept
called Voxel Texturing. It is a derivative of voxel landscaping
and texture mapping. In Voxel Texturing, three-dimensional
objects are rendered from a single polygon with a voxel landscape
mapped on it. This technique has resulted in both large speed
increases and increased quality over flat polygonal rendering.
Voxel-textured polygons are very easy to manipulate. Memory
requirements are significantly decreased. Complex
three-dimensional effects are achieved faster and with greater
ease.

<H3><FONT COLOR=YELLOW><I>Introduction</I></FONT></H3>

<p>Voxel Texturing is a derivative of two methods of rendering
commonly used today. Voxel rendering<sup>1,2</sup> is commonly
used for creating landscapes because of its ability to handle
rough surfaces without compromising speed. These landscapes are
made of lines, or voxels, drawn from a pixel on a flat bitmap
(note: the term &#145;voxel&#146; can also refer to a cubic unit,
but for this paper, we assume a line). Texture mapping<sup>3,4,5,6,9</sup>
is commonly used in rendering objects with easy manipulation.
Texture mapping onto polygons is used in most real-time
simulations (for example, games) because of its speed. However,
the objects made from these textured polygons can only have a few
polygons to maintain an average of fifteen to twenty frames per
second. Thus, objects appear &quot;blocky&quot; because the edges
are usually easily visible and unrealistic. When voxel
landscaping is combined with flat polygonal texturing, the ease
of manipulation, speed, and versatility of polygonal rendering is
combined with the realism, quality, and ease-of-manipulation of
voxels creating a high-speed rendering system with all of the
beneficial qualities of both rendering methods with few
limitations. We have denominated this rendering system
&quot;Voxel Texturing.&quot;

<p>We created Voxel Texturing to speed up rendering of objects,
to increase quality and definition of rendered objects, and to
increase ease of object creation. Voxel Texturing, after testing
and rendering, does exceed current rendering in speed,
versatility, definition, resolution, and creation. The concept
involves replacing the pixels of a textured polygon (in
three-dimensional space) with lines perpendicular to the polygon.
The height of each of these lines is specified in a height-map.
Thus, the final rendered product consists of a voxel landscape
mapped onto a polygon. With variable voxel heights, a few
voxel-textured polygons (generally two polygons) can make entire
objects, whereas with flat polygonal rendering, an equivalent
object would need hundreds or thousands of polygons. Thus,
rendering speed is significantly increased over flat polygonal
rendering. In addition, quality can increase. Since Voxel
Texturing involves a surface made of pixels rather than polygons,
then the highest definition is exactly one pixel. Therefore, the
highest definition possible is easily achieved (lower definition
can be achieved by make a level surface) allowing real-time
simulations to have movie-quality objects. With flat-polygonal
rendering, many small polygons must be created to equal the pixel
definition of voxel texturing. Another type of rendering, volume
rendering<sup>7,8</sup>, can achieve maximum quality. This method
involves placing voxels, in this case voxels are referring to a
cubic area, or volume element, in three-dimensional positions
specified by a three-dimensional array. Volume rendering requires
a three-dimensional matrix that requires every pixel to be drawn.
For a 100x100x100 object, one million pixels would have to be
rendered, making this method too slow for real-time simulation
while requiring immense storage and each of the one million
pixels to be drawn. Voxel Texturing can replace volume rendering
as well, in most cases by achieving equivalent quality but with
improved speed. For high-quality rendering, Voxel Texture
rendering is most often the best choice. Considering that an
object created with Voxel Texturing consists of raised lines, the
creation of an object is as simple as drawing a topography map in
a paint program with colors representing heights.

<p>In comparison with creating an object with flat polygons,
Voxel Textured objects are much easier to create because flat
polygons require special hardware (most commonly, a magnetic
positioning pen to plot points of an object in the computer) for
rendering actual objects. If this hardware is not used,
painstaking creation of every vertex to make polygons small
enough to create a smooth surface is required. Voxel Texturing
only requires a two-dimensional object (for example, a
photograph) and a paint program to create voxels. Voxel Texturing
is made from a two-dimensional picture instead of chopping up a
picture to make each piece or polygon of the picture. As an
example of the speed increase with Voxel Texturing, a sphere with
one thousand polygons was rendered <u>fifty</u> <u>times</u>
faster with Voxel Texturing. With this speed increase being one
of the smaller increases in speed clocked, there is little doubt
that Voxel Texturing will replace, or at very least augment,
every type of rendering in existence today.

<H3><FONT COLOR=YELLOW><I>Rendering Procedure of a Voxel Textured Polygon</I></FONT></H3>

<OL>
<LI>1. A picture (texture) and height map are created (see
procedure: &quot;Creating a Voxel Textured Polygon&quot;). The
vertices of the polygon are assumed to be co-planar, and the
polygon is assumed to be a quadrilateral.
<LI>2. Normal polygonal texturing is applied. In the case of
perspective-correct rendering, each pixel along the polygon is
projected. A line, in the final product, replaces each of these
pixels. The corresponding height map is also textured.
<LI>3. To ensure that the voxels are perpendicular to the polygon
surface, a vector cross product is performed using any three
points of the polygon. The returned number is the normal to the
polygon.
<LI>4. From each point on the polygon, a line is projected
parallel to the polygon&#146;s normal. This line has a length
equal to the height specified on the height map (at the
corresponding point) and a color equal to the corresponding
number on the texture map. The line starts from the pixel being
extended.
<LI>5. Once every line has been drawn, the process is complete.
</OL>

<H3><FONT COLOR=YELLOW><I>Creating a Voxel Textured Polygon</I></FONT></H3>

<OL>
<LI>1. As normally performed in creating a flat polygon, a picture
is created to apply to the polygon as a texture.
<LI>2. To create the height map, a paint program can be used to
draw a topography map. This can be done by using colors to
represent heights considering the colors represent numbers. The
numbers (colors) from the topography map are read by the engine
as heights.
<LI>3. Once the picture and height map are finished, the process
is complete and the values are stored. In special programs we
have written, a paint program and voxel editor are combined and
the values are stored in a single file.
</OL>

<H3><FONT COLOR=YELLOW><I>Shading a Voxel Textured Polygon</I></FONT></H3>

<p>Note: To achieve shading, the angle of the surface and the
vector of a light source are required.

<OL>
<LI>1. The position of a surface pixel and its four adjacent
surface pixels must be found (if a pixel is on the side of a
height map so that there are fewer adjacent pixels, as many as
possible are used).
<LI>2. Four vectors must be found by subtracting the four adjacent
pixel positions from the center (once again, if there are fewer
adjacent pixels, fewer vectors can be found).
<LI>3. A cross product is run between the center and two adjacent
vectors. Once this cross product is run on each adjacent vector,
four normals should now be known.
<LI>4. The four normals are averaged to get a single normal
representing the center pixel.
<LI>5. This normal is normalized.
<LI>6. A dot product performed on this new normal and the vector
of the light source yields a number between -1 and 1. The closer
the number is to -1 or 1, the brighter the pixel should be.
<LI>7. The value that is returned is multiplied times the red,
blue, and green components of the center pixel&#146;s color. The
returned numbers represent the colors of the shaded voxel.
<LI>8. Once every voxel has been shaded (steps 1-7), the process
is complete.
</OL>

<H3><FONT COLOR=YELLOW><I>Procedural Analysis</I></FONT></H3>

<p>Since creating a voxel-textured polygon involves simply
drawing a height map and a picture, voxel-textured objects are
much easier to create than objects composed of flat polygons.
Whereas an object rendered with flat polygons would require well
over a thousand polygons to appear smooth, Voxel Texturing
requires simply raising voxel heights in succession. Flat
polygons usually require professionals or expensive equipment to
create anything of quality. However, with Voxel Texturing,
objects can be created with such ease that almost any person can
make extremely high-quality objects. Objects digitized or scanned
can be converted into three-dimensional objects simply by raising
the pixels of the image. With flat polygons, the digitized image
has to be separated and then positioned in three dimensions.
Thus, the quality of a real person, object, or just about
anything can be copied into the three-dimensional world of the
computer with greater speed and ease.

<H3><FONT COLOR=YELLOW><I>Data</I></FONT></H3>

<div align="center"><center>

<table border="1" cellpadding="7" cellspacing="1" width="558">
    <tr>
        <td valign="top" width="70%"><font size="4">Object
        rendered</font></td>
        <td valign="top" width="30%"><font size="5">Speed
        (seconds)</font></td>
    </tr>
    <tr>
        <td valign="top" width="70%">1 Voxel-textured polygon</td>
        <td valign="top" width="30%">~0.018 </td>
    </tr>
    <tr>
        <td valign="top" width="70%">1 Flat Polygon </td>
        <td valign="top" width="30%">~0.0018 </td>
    </tr>
    <tr>
        <td valign="top" width="70%">Sphere &#150; low definition
        (12 flat polygons)</td>
        <td valign="top" width="30%">~0.022 </td>
    </tr>
    <tr>
        <td valign="top" width="70%">Sphere &#150; intermediate
        definition (50 flat polygons)</td>
        <td valign="top" width="30%">~0.090 </td>
    </tr>
    <tr>
        <td valign="top" width="70%">Sphere &#150; high
        definition (1,000 flat polygons)</td>
        <td valign="top" width="30%">~1.818 </td>
    </tr>
    <tr>
        <td valign="top" width="70%" height="20">Sphere &#150;
        any definition (2 Voxel-textured polygons)</td>
        <td valign="top" width="30%" height="20">~0.036 </td>
    </tr>
    <tr>
        <td valign="top" width="70%" height="20">Sphere &#150;
        high definition (volume rendered with Xvision<sup>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -