Re: mesh to 3D texture?

Francis Boivin <[email protected]> Thu, 25 Aug 2011 13:34:12 -0400
Newsgroups gmane.games.devel.algorithms
Message-ID <E7F3301F6AF1F341AB107794F4F80A6F02E01458BB@MDC-MAIL-CMS01.ubisoft.org>
--===============5181260176859643666==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_E7F3301F6AF1F341AB107794F4F80A6F02E01458BBMDCMAILCMS01u_"

--_000_E7F3301F6AF1F341AB107794F4F80A6F02E01458BBMDCMAILCMS01u_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

That's pretty much how d3d10+ implementation of Light Propagation Volumes w=
ork.
This example, for instance http://blog.blackhc.net/wp-content/uploads/2010/=
07/LPVPrototype.zip, handles all volume texture data (writing and reading) =
on the gpu.  The magic lies in the use of Draw with a NULL vertex buffer an=
d a geometry shader that correctly selects the slice of volume to render in=
to.

From: Jeff Russell [mailto:[email protected]]
Sent: August-25-11 1:05 PM
To: Game Development Algorithms
Subject: [Algorithms] mesh to 3D texture?

So, suppose that I wanted to voxelize a mesh into a regular 3D grid (a 3D t=
exture on the GPU, fairly low res, something like 64^3). At each point I'd =
like to have access to color, a (rough) surface normal, and some kind of in=
dicator of whether the space is "empty" or "filled".

Is there some clever way I can use GPU rasterization to fill it (ideally ke=
eping the whole process on the GPU)? I thought about rendering the mesh in =
slices with very narrow front and back clip planes, once for each slice of =
the 3D texture, but it seems like there could be issues with polygons perpe=
ndicular to my z axis not showing up, creating holes...

Any advice?

--
Jeff Russell
Engineer, 8monkey Labs
www.8monkeylabs.com<http://www.8monkeylabs.com>

--_000_E7F3301F6AF1F341AB107794F4F80A6F02E01458BBMDCMAILCMS01u_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DFR-CA link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span lang=3DEN-CA style=3D'font-size:11.0pt;font-fami=
ly:"Calibri","sans-serif";
color:#1F497D'>That&#8217;s pretty much how d3d10+ implementation of Light =
Propagation
Volumes work.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-CA style=3D'font-size:11.0pt;font-fami=
ly:"Calibri","sans-serif";
color:#1F497D'>This example, for instance <a
href=3D"http://blog.blackhc.net/wp-content/uploads/2010/07/LPVPrototype.zip=
">http://blog.blackhc.net/wp-content/uploads/2010/07/LPVPrototype.zip</a>,
handles all volume texture data (writing and reading) on the gpu. &nbsp;The=
 magic
lies in the use of Draw with a NULL vertex buffer and a geometry shader tha=
t
correctly selects the slice of volume to render into.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-CA style=3D'font-size:11.0pt;font-fami=
ly:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm'>

<p class=3DMsoNormal><b><span lang=3DEN-US style=3D'font-size:10.0pt;font-f=
amily:
"Tahoma","sans-serif"'>From:</span></b><span lang=3DEN-US style=3D'font-siz=
e:10.0pt;
font-family:"Tahoma","sans-serif"'> Jeff Russell
[mailto:[email protected]] <br>
<b>Sent:</b> August-25-11 1:05 PM<br>
<b>To:</b> Game Development Algorithms<br>
<b>Subject:</b> [Algorithms] mesh to 3D texture?<o:p></o:p></span></p>

</div>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>So, suppose that I wanted to voxelize a mesh into a re=
gular
3D grid (a 3D texture on the GPU, fairly low res, something like 64^3). At =
each
point I'd like to have access to color, a (rough) surface normal, and some =
kind
of indicator of whether the space is &quot;empty&quot; or &quot;filled&quot=
;.<br>
<br>
Is there some clever way I can use GPU rasterization to fill it (ideally
keeping the whole process on the GPU)? I thought about rendering the mesh i=
n
slices with very narrow front and back clip planes, once for each slice of =
the
3D texture, but it seems like there could be issues with polygons perpendic=
ular
to my z axis not showing up, creating holes...<br>
<br>
Any advice?<br clear=3Dall>
<br>
-- <br>
Jeff Russell<br>
Engineer, 8monkey Labs<br>
<a href=3D"http://www.8monkeylabs.com" target=3D"_blank">www.8monkeylabs.co=
m</a><o:p></o:p></p>

</div>

</body>

</html>

--_000_E7F3301F6AF1F341AB107794F4F80A6F02E01458BBMDCMAILCMS01u_--


--===============5181260176859643666==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
--===============5181260176859643666==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
--===============5181260176859643666==--