<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>NVIDIA Advanced Rendering Forum - mr Shaders - Advanced</title>
		<link>http://forum.nvidia-arc.com/</link>
		<description>Advanced shader discussion</description>
		<language>en</language>
		<lastBuildDate>Mon, 20 May 2013 04:07:20 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forum.nvidia-arc.com/images/misc/rss.png</url>
			<title>NVIDIA Advanced Rendering Forum - mr Shaders - Advanced</title>
			<link>http://forum.nvidia-arc.com/</link>
		</image>
		<item>
			<title>Geometry shader and mtion boxes</title>
			<link>http://forum.nvidia-arc.com/showthread.php?12400-Geometry-shader-and-mtion-boxes&amp;goto=newpost</link>
			<pubDate>Wed, 08 May 2013 20:15:49 GMT</pubDate>
			<description>I have a geometry shader that creates a polygon mesh composed of its Vertices, motion vectors, normals and UVs. I had been struggling with the motion...</description>
			<content:encoded><![CDATA[<div>I have a geometry shader that creates a polygon mesh composed of its Vertices, motion vectors, normals and UVs. I had been struggling with the motion blur until I realized that to enable the blur, I had to do the following : <br />
<br />
1. Set obj-&gt;mbox_explicit = miTRUE<br />
and,<br />
2. Set the obj-&gt;bbox_min_m and obj-&gt;bbox_max_m. <br />
<br />
As of now, I am setting them to be my old bounding box expanded by 10 units for both min and max. But my motion blur, where the vectors are much smaller than 10, does not come out correctly. <br />
<br />
Since I have not actually found a documentation explaining what the motion box is and how to calculate it, I am very confused. What exactly are we supposed to put as the motion box vectors? Min and max motion vectors? Or, is the way I am doing it right now correct?<br />
<br />
My data (vertices/motion vectors) is exactly the same as what I see when I export a deforming cube in maya. Here is the relevant part of the .mi file : <br />
<br />
trilist vertex 24 p m n t 2 b 2 triangle 12<br />
		[<br />
		 -0.5 -0.5 0.5 -0.0869565 0. 0. 0. 0. 1. 0.375 0. 1.33333 0. 2.66667 0.695652 4. 0.<br />
		 0.5 -0.5 0.5 -0.0869565 0. 0. 0. 0. 1. 0.625 0. 2.66667 0. -1.33333 0.695652 4. 0.<br />
		 0.5 0.5 0.5 0.0869565 0. 0. 0. 0. 1. 0.625 0.25 2.4 0. -1.6 0.417391 2.4 -1.6<br />
		 -0.5 0.5 0.5 0.0869565 0. 0. 0. 0. 1. 0.375 0.25 3. 0. 1. 0.521739 3. -1.<br />
		 -0.5 0.5 0.5 0.0869565 0. 0. 0. 1. 0. 0.375 0.25 3. 0. 1. 0.521739 3. -1.<br />
		 0.5 0.5 0.5 0.0869565 0. 0. 0. 1. 0. 0.625 0.25 2.4 0. -1.6 0.417391 2.4 -1.6<br />
		 0.5 0.5 -0.5 0.0869565 0. 0. 0. 1. 0. 0.625 0.5 4. 0. 0. -0.347826 -2. -2.<br />
		 -0.5 0.5 -0.5 0.0869565 0. 0. 0. 1. 0. 0.375 0.5 4. 0. 0. -0.347826 -2. -2.<br />
		 -0.5 0.5 -0.5 0.0869565 0. 0. 0. 0. -1. 0.375 0.5 4. 0. 0. -0.347826 -2. -2.<br />
		 0.5 0.5 -0.5 0.0869565 0. 0. 0. 0. -1. 0.625 0.5 4. 0. 0. -0.347826 -2. -2.<br />
		 0.5 -0.5 -0.5 -0.0869565 0. 0. 0. 0. -1. 0.625 0.75 4. 0. 0. -0.347826 -2. 2.<br />
		 -0.5 -0.5 -0.5 -0.0869565 0. 0. 0. 0. -1. 0.375 0.75 4. 0. 0. -0.347826 -2. 2.<br />
		 -0.5 -0.5 -0.5 -0.0869565 0. 0. 0. -1. 0. 0.375 0.75 4. 0. 0. -0.347826 -2. 2.<br />
		 0.5 -0.5 -0.5 -0.0869565 0. 0. 0. -1. 0. 0.625 0.75 4. 0. 0. -0.347826 -2. 2.<br />
		 0.5 -0.5 0.5 -0.0869565 0. 0. 0. -1. 0. 0.625 1. 4. 0. 0. 0. 0. 4.<br />
		 -0.5 -0.5 0.5 -0.0869565 0. 0. 0. -1. 0. 0.375 1. 4. 0. 0. 0. 0. 4.<br />
		 0.5 -0.5 0.5 -0.0869565 0. 0. 1. 0. 0. 0.625 0. 2.66667 0. -1.33333 0.695652 4. 0.<br />
		 0.5 -0.5 -0.5 -0.0869565 0. 0. 1. 0. 0. 0.875 0. 0. 0. -4. 0.695652 4. 0.<br />
		 0.5 0.5 -0.5 0.0869565 0. 0. 1. 0. 0. 0.875 0.25 0. 0. -4. 0.695652 4. 0.<br />
		 0.5 0.5 0.5 0.0869565 0. 0. 1. 0. 0. 0.625 0.25 2.4 0. -1.6 0.417391 2.4 -1.6<br />
		 -0.5 -0.5 -0.5 -0.0869565 0. 0. -1. 0. 0. 0.125 0. 0. 0. 4. 0.695652 4. 0.<br />
		 -0.5 -0.5 0.5 -0.0869565 0. 0. -1. 0. 0. 0.375 0. 1.33333 0. 2.66667 0.695652 4. 0.<br />
		 -0.5 0.5 0.5 0.0869565 0. 0. -1. 0. 0. 0.375 0.25 3. 0. 1. 0.521739 3. -1.<br />
		 -0.5 0.5 -0.5 0.0869565 0. 0. -1. 0. 0. 0.125 0.25 0. 0. 4. 0.695652 4. 0.<br />
		]<br />
		[<br />
		 0 0 1 3<br />
		 0 3 1 2<br />
		 0 4 5 7<br />
		 0 7 5 6<br />
		 0 9 10 8<br />
		 0 8 10 11<br />
		 0 12 13 15<br />
		 0 15 13 14<br />
		 0 16 17 19<br />
		 0 19 17 18<br />
		 0 20 21 23<br />
		 0 23 21 22<br />
		]<br />
<br />
What should be the motion box in this case?<br />
<br />
<br />
Following is my C++ shader : <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">#include &lt;stdio.h&gt;<br />
#include &lt;math.h&gt;<br />
#include &lt;string.h&gt;<br />
#include &lt;shader.h&gt;<br />
#include &lt;mi_version.h&gt;<br />
#include &lt;shader.h&gt;<br />
#include &lt;geoshader.h&gt;<br />
#include &lt;iostream&gt;<br />
<br />
using namespace std;<br />
struct test_color<br />
{<br />
<br />
};<br />
<br />
extern &quot;C&quot; DLLEXPORT<br />
int test_color_version(void) { return 1; }<br />
<br />
extern &quot;C&quot; DLLEXPORT<br />
void init_object_flags(miObject * object)<br />
{<br />
<br />
&nbsp; &nbsp; object-&gt;visible&nbsp; &nbsp;  = miTRUE;<br />
&nbsp; &nbsp; object-&gt;shadow&nbsp; &nbsp; &nbsp; =<br />
&nbsp; &nbsp; object-&gt;reflection&nbsp; =<br />
&nbsp; &nbsp; object-&gt;refraction&nbsp; =<br />
&nbsp; &nbsp; object-&gt;finalgather = 0x03;<br />
<br />
}<br />
<br />
DLLEXPORT miBoolean test_color_cb(miTag tag, void *args)<br />
{<br />
<br />
&nbsp; &nbsp; const char *name;<br />
&nbsp; &nbsp; miObject *obj;<br />
&nbsp; &nbsp; test_color *params = (test_color*)args;<br />
&nbsp; &nbsp; name&nbsp; &nbsp; &nbsp; &nbsp;  = mi_api_tag_lookup(tag);<br />
&nbsp; &nbsp; mi_api_incremental(miTRUE);<br />
&nbsp; &nbsp; obj&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = mi_api_object_begin(mi_mem_strdup(name));<br />
&nbsp; &nbsp; init_object_flags(obj);<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; miVector v;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; if(mi_api_object_group_begin(0.0))<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; //Add vertices(0-7) :<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -0.5; v.y= -0.5;v.z= 0.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.5; v.y= -0.5;v.z= 0.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -0.5; v.y= 0.5;v.z= 0.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.5; v.y= 0.5;v.z= 0.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -0.5; v.y= 0.5;v.z= -0.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.5; v.y= 0.5;v.z= -0.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -0.5; v.y= -0.5;v.z= -0.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.5; v.y= -0.5;v.z= 0.5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //Add Normals(8-31)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 0;v.z= 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 0;v.z= 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 0;v.z= 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 0;v.z= 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 0;v.z= -1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 0;v.z= -1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 0;v.z= -1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= 0;v.z= -1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= -1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= -1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= -1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0; v.y= -1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 1; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 1; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 1; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 1; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -1; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -1; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -1; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -1; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //Add UVs(32-45)<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.375; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.625; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.375; v.y= 0.25;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.625; v.y= 0.25;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.375; v.y= 0.5;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.625; v.y= 0.5;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.375; v.y= 0.75;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.625; v.y= 0.75;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.375; v.y= 1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.625; v.y= 1;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.875; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.875; v.y= 0.25;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.125; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.125; v.y= 0.25;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //Add motion Vectors(46-53)<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = 0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; v.x = -0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vector_xyz_add(&amp;v);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //Tell MR about the indices<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(8);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(46);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(32,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(9);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(47);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(33,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(3);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(10);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(49);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(35,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(2);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(11);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(48);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(34,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(2);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(12);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(48);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(34,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(3);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(13);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(49);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(35,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(5);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(14);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(51);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(37,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(4);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(15);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(50);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(36,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(4);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(16);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(50);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(36,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(5);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(17);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(51);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(37,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(7);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(18);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(53);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(39,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(6);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(19);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(52);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(38,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(6);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(20);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(52);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(38,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(7);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(21);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(53);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(39,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(22);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(47);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(41,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(23);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(46);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(40,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(24);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(47);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(33,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(7);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(25);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(53);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(42,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(5);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(26);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(51);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(43,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(3);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(27);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(49);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(35,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(6);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(28);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(52);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(44,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(29);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(46);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(32,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(2);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(30);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(48);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(34,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_add(4);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_normal_add(31);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_motion_add(50);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_vertex_tex_add(45,-1,-1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //Begin polygon indexing definition<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_begin_tag(1, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(2);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(3);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_end();<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_begin_tag(1, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(4);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(5);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(6);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(7);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_end();<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_begin_tag(1, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(8);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(9);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(10);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(11);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_end();<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_begin_tag(1, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(12);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(13);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(14);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(15);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_end();<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_begin_tag(1, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(16);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(17);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(18);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(19);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_end();<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_begin_tag(1, 0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(20);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(21);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(22);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_index_add(23);<br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_poly_end();<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; mi_api_object_group_end();<br />
<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;&quot;mi_api_object_group begin returned with an error&quot;&lt;&lt;endl;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; mi_api_object_end();<br />
&nbsp; &nbsp; return miTRUE;<br />
}<br />
<br />
<br />
extern &quot;C&quot; DLLEXPORT<br />
miBoolean test_color (miTag *result, miState *state, struct test_color *params)<br />
{<br />
<br />
&nbsp; &nbsp; miObject&nbsp; &nbsp; &nbsp; &nbsp; *obj;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; char * name = &quot;Cube&quot;;<br />
&nbsp; &nbsp; obj = mi_api_object_begin(mi_mem_strdup(name));<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; init_object_flags(obj);<br />
&nbsp; &nbsp; obj-&gt;bbox_min.x = -0.5;<br />
&nbsp; &nbsp; obj-&gt;bbox_min.y = -0.5;<br />
&nbsp; &nbsp; obj-&gt;bbox_min.z = -0.5;<br />
&nbsp; &nbsp; obj-&gt;bbox_max.x = 0.5;<br />
&nbsp; &nbsp; obj-&gt;bbox_max.y = 0.5;<br />
&nbsp; &nbsp; obj-&gt;bbox_max.z = 0.5;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; //If the next 6 lines are not present, no motion blur!<br />
&nbsp; &nbsp; //How do I put the bbox_m before the callback if I don't know what the geo is?<br />
&nbsp; &nbsp; //And what is the bbox_m??<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; obj-&gt;mbox_explicit = miTRUE;<br />
&nbsp; &nbsp; miVector v;<br />
&nbsp; &nbsp; v.x = 0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; obj-&gt;bbox_min_m = v;<br />
&nbsp; &nbsp; v.x = -0.0869565; v.y= 0;v.z= 0;<br />
&nbsp; &nbsp; obj-&gt;bbox_max_m = v;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; mi_api_object_callback(test_color_cb, (void *)params);<br />
&nbsp; &nbsp; miTag tag = mi_api_object_end();<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; mi_geoshader_add_result(result,&nbsp; &nbsp; &nbsp; &nbsp; tag);<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; return(miTRUE);<br />
<br />
}</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forum.nvidia-arc.com/forumdisplay.php?85-mr-Shaders-Advanced">mr Shaders - Advanced</category>
			<dc:creator>nfsfan</dc:creator>
			<guid isPermaLink="true">http://forum.nvidia-arc.com/showthread.php?12400-Geometry-shader-and-mtion-boxes</guid>
		</item>
		<item>
			<title>Fluid render problem</title>
			<link>http://forum.nvidia-arc.com/showthread.php?12394-Fluid-render-problem&amp;goto=newpost</link>
			<pubDate>Sat, 04 May 2013 09:49:33 GMT</pubDate>
			<description>Accidently placed in the wrong forum: 
 
http://forum.nvidia-arc.com/showthread.php?12391-Maya-Fluid-render-problem</description>
			<content:encoded><![CDATA[<div>Accidently placed in the wrong forum:<br />
<br />
<a href="http://forum.nvidia-arc.com/showthread.php?12391-Maya-Fluid-render-problem" target="_blank">http://forum.nvidia-arc.com/showthre...render-problem</a></div>

]]></content:encoded>
			<category domain="http://forum.nvidia-arc.com/forumdisplay.php?85-mr-Shaders-Advanced">mr Shaders - Advanced</category>
			<dc:creator>haggi</dc:creator>
			<guid isPermaLink="true">http://forum.nvidia-arc.com/showthread.php?12394-Fluid-render-problem</guid>
		</item>
		<item>
			<title>Creating MR geoshaders without normals</title>
			<link>http://forum.nvidia-arc.com/showthread.php?12381-Creating-MR-geoshaders-without-normals&amp;goto=newpost</link>
			<pubDate>Fri, 26 Apr 2013 02:47:45 GMT</pubDate>
			<description>I am trying to read a mesh file and create the object in MR using a geoshader. I can get it to work using two ways : as a poly mesh and as a ccmesh,...</description>
			<content:encoded><![CDATA[<div>I am trying to read a mesh file and create the object in MR using a geoshader. I can get it to work using two ways : as a poly mesh and as a ccmesh, but both are bringing with them some problem or the other that i am unable to solve. <br />
<br />
To begin with, I have the following limitation : I don't have the normals and I am hoping MR can create smooth normals for me automatically. <br />
<br />
Poly mesh : Every thing here works but the normals. I can create objects, assign texture values. But if I don't assign normals, MR does not do a smooth shade for me. I see flatly shaded polygons.<br />
<br />
For the polymesh, I did something like this (with mi_api_vertex_add,mi_api_vertex_normal_add, mi_api_vertex_tex_add calls)<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">For each polygon p<br />
&nbsp; &nbsp; Add vertex i of p<br />
&nbsp; &nbsp; Add UV vector</code><hr />
</div>CcMesh : My problem of flat shading goes away in the ccmesh, but I am unable to assign the textures to the ccmesh the same way I did for my poly object. Or for that matter add vertices in the same way. Let me explain :<br />
<br />
For the ccmesh, I have to modify my method to make it work(even without the UVs) : <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">For each vertex v<br />
&nbsp; &nbsp; Add vertex v<br />
&nbsp; &nbsp; Add all UV values associated with vertex v</code><hr />
</div>Now without the UV, it does fine. It creates a ccmesh and it is smoothly shaded. But when I add the code for UVs, MR crashes with the call to mi_api_ccmesh_end()<br />
<br />
For my purposes, I just want the final result and don't care about which method gets me there. <br />
<br />
Has anyone faced a similar problem or knows a way out of this?</div>

]]></content:encoded>
			<category domain="http://forum.nvidia-arc.com/forumdisplay.php?85-mr-Shaders-Advanced">mr Shaders - Advanced</category>
			<dc:creator>nfsfan</dc:creator>
			<guid isPermaLink="true">http://forum.nvidia-arc.com/showthread.php?12381-Creating-MR-geoshaders-without-normals</guid>
		</item>
	</channel>
</rss>
