<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>DirectX Tool Kit</title><link>http://directxtk.codeplex.com/project/feeds/rss</link><description>DirectXTK is a shared source library of helpers for Direct3D 11 C&amp;#43;&amp;#43; applications.</description><item><title>New Post: Create dynamic texture on SpriteBatch in WP8.</title><link>http://directxtk.codeplex.com/discussions/444880</link><description>&lt;div style="line-height: normal;"&gt;Hello . I have one spriteBatch witch the texture.  When i click on this spritebatch then I would  change color of the texture to 'grayscale' or 'sepia' . Does Directxtk support any effect with grayscale  or sepia? &lt;br /&gt;
Could you help me?&lt;br /&gt;
&lt;/div&gt;</description><author>slavo_par</author><pubDate>Fri, 24 May 2013 13:09:52 GMT</pubDate><guid isPermaLink="false">New Post: Create dynamic texture on SpriteBatch in WP8. 20130524010952P</guid></item><item><title>Commented Unassigned: Implement polyhedron as geometric primitive [931]</title><link>http://directxtk.codeplex.com/workitem/931</link><description>DirectXTK implements a number of GeometricPrimitives, but it is missing several shapes supported by OpenGL&amp;#39;s glut library.&lt;br /&gt;&lt;br /&gt;&amp;#42; glut&amp;#42;Dodecahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Octahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Tetrahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Icosahedron&lt;br /&gt;&lt;br /&gt;This combined with the existing Cube implementation make up the &amp;#39;&amp;#91;platonic solids&amp;#93;&amp;#40;http&amp;#58;&amp;#47;&amp;#47;en.wikipedia.org&amp;#47;wiki&amp;#47;Platonic_solid&amp;#41;&amp;#39; &lt;br /&gt;&lt;br /&gt;PS&amp;#58; It&amp;#39;s also missing glut&amp;#42;Cone, but that&amp;#39;s covered by &amp;#91;921&amp;#93;&amp;#40;https&amp;#58;&amp;#47;&amp;#47;directxtk.codeplex.com&amp;#47;workitem&amp;#47;921&amp;#41;&lt;br /&gt;Comments: ** Comment from web user: walbourn ** &lt;p&gt;Vertex and connectivity information for these shapes is pretty easy to come by&lt;/p&gt;&lt;p&gt;Schneider &amp;amp; Eberly, _Geometric Tools for Computer Graphics_, pg 346-351&lt;/p&gt;&lt;p&gt;Normals for these shapes are 'face-normals' necessitating vertex duplication. but should also be fairly easy to derive.&lt;/p&gt;&lt;p&gt;The real challenge is going to be to provide reasonable texture coordinates. It looks like 'gift-wrapping' or just projection of a sphere are the choices here.&lt;/p&gt;</description><author>walbourn</author><pubDate>Fri, 24 May 2013 06:22:40 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: Implement polyhedron as geometric primitive [931] 20130524062240A</guid></item><item><title>Commented Unassigned: Implement polyhedron as geometric primitive [931]</title><link>http://directxtk.codeplex.com/workitem/931</link><description>DirectXTK implements a number of GeometricPrimitives, but it is missing a number of shapes supported by OpenGL&amp;#39;s glut library.&lt;br /&gt;&lt;br /&gt;&amp;#42; glut&amp;#42;Dodecahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Octahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Tetrahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Icosahedron&lt;br /&gt;&lt;br /&gt;This combined with the existing Cube implementation make up the &amp;#39;&amp;#91;platonic solids&amp;#93;&amp;#40;http&amp;#58;&amp;#47;&amp;#47;en.wikipedia.org&amp;#47;wiki&amp;#47;Platonic_solid&amp;#41;&amp;#39; &lt;br /&gt;&lt;br /&gt;PS&amp;#58; It&amp;#39;s also missing glut&amp;#42;Cone, but that&amp;#39;s covered by &amp;#91;921&amp;#93;&amp;#40;https&amp;#58;&amp;#47;&amp;#47;directxtk.codeplex.com&amp;#47;workitem&amp;#47;921&amp;#41;&lt;br /&gt;Comments: ** Comment from web user: walbourn ** &lt;p&gt;Note that one difference between DirectXTK and OpenGL's glUT is that DirectXTK supports texture coordinates as well as normal on all GeometricPrimitive shapes. glut supports normals but not texture coordinates except on the Utah teapot.&lt;/p&gt;</description><author>walbourn</author><pubDate>Wed, 22 May 2013 22:42:29 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: Implement polyhedron as geometric primitive [931] 20130522104229P</guid></item><item><title>Updated Wiki: GeometricPrimitive</title><link>https://directxtk.codeplex.com/wikipage?title=GeometricPrimitive&amp;version=31</link><description>&lt;div class="wikidoc"&gt;This is a helper for drawing simple geometric shapes including texture coordinates and surface normals.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Cube&lt;/li&gt;
&lt;li&gt;Sphere&lt;/li&gt;
&lt;li&gt;Geodesic Sphere&lt;/li&gt;
&lt;li&gt;Cylinder&lt;/li&gt;
&lt;li&gt;Torus&lt;/li&gt;
&lt;li&gt;Teapot&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Initialization&lt;/h1&gt;The GeometryPrimitive class must be created from a factory method which takes the Direct3D 11 device context.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
std::unique_ptr&amp;lt;GeometricPrimitive&amp;gt; shape(
GeometricPrimitive::CreateTeapot(deviceContext) );
&lt;/pre&gt;&lt;/div&gt;For exception safety, it is recommended you make use of the C++ RAII pattern and use a std::unique_ptr or std::shared_ptr&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;CreateCube( deviceContext, float size = 1)&lt;/li&gt;
&lt;li&gt;CreateSphere( deviceContext, float diameter = 1, size_t tessellation = 16)&lt;/li&gt;
&lt;li&gt;CreateGeoSphere( deviceContext, float diameter = 1, size_t tessellation = 3)&lt;/li&gt;
&lt;li&gt;CreateCylinder( deviceContext, float height = 1, float diameter = 1, size_t tessellation = 32)&lt;/li&gt;
&lt;li&gt;CreateTorus( deviceContext, float diameter = 1, float thickness = 0.333f, size_t tessellation = 32)&lt;/li&gt;
&lt;li&gt;CreateTeapot( deviceContext, float size = 1, size_t tessellation = 8)&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Simple drawing&lt;/h1&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
shape-&amp;gt;Draw(world, view, projection, Colors::CornflowerBlue);
&lt;/pre&gt;&lt;/div&gt;The draw method accepts an optional texture parameter, wireframe flag, and a callback function which can be used to override the default rendering state:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
shape-&amp;gt;Draw(world, view, projection, Colors::White, catTexture, &lt;span style="color:Blue;"&gt;false&lt;/span&gt;, [=]
{
    deviceContext-&amp;gt;OMSetBlendState(...);
});
&lt;/pre&gt;&lt;/div&gt;This makes use of a BasicEffect shared by all geometric primitives drawn on that device context.&lt;br /&gt;
&lt;h1&gt;Advanced drawing&lt;/h1&gt;This form of drawing makes use of a custom &lt;a href="https://directxtk.codeplex.com/wikipage?title=Effects&amp;referringTitle=GeometricPrimitive"&gt;Effects&lt;/a&gt; instance. The caller is responsible for using an input layout that matches the effect.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
IEffect* myeffect = ...

Microsoft::WRL::ComPtr&amp;lt;ID3D11InputLayout&amp;gt; inputLayout;
shape-&amp;gt;CreateInputLayout( myeffect, &amp;amp;inputLayout );

shape-&amp;gt;Draw( myeffect, inputLayout.Get() );
&lt;/pre&gt;&lt;/div&gt;This takes an optional parameter for enabling alpha-blending, wireframe, and a callback function which can be used to override the default rendering state.&lt;br /&gt;
&lt;h1&gt;Coordinate systems&lt;/h1&gt;These geometric primitives (based on the XNA Game Studio conventions) use right-handed coordinates. They can be used with left-handed coordinates by setting the &lt;i&gt;rhcoords&lt;/i&gt; parameter on the factory methods to &amp;#39;false&amp;#39; to reverse the winding ordering (the parameter defaults to &amp;#39;true&amp;#39;).&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
std::unique_ptr&amp;lt;GeometricPrimitive&amp;gt; shape(
GeometricPrimitive::CreateTeapot( deviceContext, 1.f, 8, &lt;span style="color:Blue;"&gt;false&lt;/span&gt; ) );
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Alpha blending&lt;/h1&gt;Alpha blending defaults to using premultiplied alpha. To make use of &amp;#39;straight&amp;#39; alpha textures, override the blending mode via the optional callback:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
CommonStates states(deviceContext);

shape-&amp;gt;Draw(world, view, projection, Colors::White, catTexture, &lt;span style="color:Blue;"&gt;false&lt;/span&gt;, [=]
{
    deviceContext-&amp;gt;OMSetBlendState( states.NonPremultiplied(), &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;, 0xFFFFFFFF);
});
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Feature Level Notes&lt;/h1&gt;In order to support all feature levels, the GeometricPrimitive implementation make use of 16-bit indices (DXGI_FORMAT_R16_UINT) which limits to a maximum of 65535 vertices. Feature Level 9.1 is limited to a maximum of 65535 primitives in a single draw.&lt;br /&gt;
&lt;h1&gt;Threading model&lt;/h1&gt;Each GeometricPrimitive instance only supports drawing from one thread at a time, but you can simultaneously submit primitives on multiple threads if you create a separate GeometricPrimitive instance per Direct3D 11 deferred context.&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476892.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ff476892.aspx&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Further Reading&lt;/h1&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Cube"&gt;http://en.wikipedia.org/wiki/Cube&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Sphere"&gt;http://en.wikipedia.org/wiki/Sphere&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Cylinder_(geometry)"&gt;http://en.wikipedia.org/wiki/Cylinder_(geometry)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Utah_teapot"&gt;http://en.wikipedia.org/wiki/Utah_teapot&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Torus"&gt;http://en.wikipedia.org/wiki/Torus&lt;/a&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Wed, 22 May 2013 22:32:33 GMT</pubDate><guid isPermaLink="false">Updated Wiki: GeometricPrimitive 20130522103233P</guid></item><item><title>Updated Wiki: GeometricPrimitive</title><link>https://directxtk.codeplex.com/wikipage?title=GeometricPrimitive&amp;version=30</link><description>&lt;div class="wikidoc"&gt;This is a helper for drawing simple geometric shapes including texture coordinates and surface normals.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Cube&lt;/li&gt;
&lt;li&gt;Sphere&lt;/li&gt;
&lt;li&gt;Geodesic Sphere&lt;/li&gt;
&lt;li&gt;Cylinder&lt;/li&gt;
&lt;li&gt;Torus&lt;/li&gt;
&lt;li&gt;Teapot&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Initialization&lt;/h1&gt;The GeometryPrimitive class must be created from a factory method which takes the Direct3D 11 device context.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
std::unique_ptr&amp;lt;GeometricPrimitive&amp;gt; shape(
GeometricPrimitive::CreateTeapot(deviceContext) );
&lt;/pre&gt;&lt;/div&gt;For exception safety, it is recommended you make use of the C++ RAII pattern and use a std::unique_ptr or std::shared_ptr&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;CreateCube( deviceContext, float size = 1)&lt;/li&gt;
&lt;li&gt;CreateSphere( deviceContext, float diameter = 1, size_t tessellation = 16)&lt;/li&gt;
&lt;li&gt;CreateGeoSphere( deviceContext, float diameter = 1, size_t tessellation = 3)&lt;/li&gt;
&lt;li&gt;CreateCylinder( deviceContext, float height = 1, float diameter = 1, size_t tessellation = 32)&lt;/li&gt;
&lt;li&gt;CreateTorus( deviceContext, float diameter = 1, float thickness = 0.333f, size_t tessellation = 32)&lt;/li&gt;
&lt;li&gt;CreateTeapot( deviceContext, float size = 1, size_t tessellation = 8)&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Simple drawing&lt;/h1&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
shape-&amp;gt;Draw(world, view, projection, Colors::CornflowerBlue);
&lt;/pre&gt;&lt;/div&gt;The draw method accepts an optional texture parameter, wireframe flag, and a callback function which can be used to override the default rendering state:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
shape-&amp;gt;Draw(world, view, projection, Colors::White, catTexture, &lt;span style="color:Blue;"&gt;false&lt;/span&gt;, [=]
{
    deviceContext-&amp;gt;OMSetBlendState(...);
});
&lt;/pre&gt;&lt;/div&gt;This makes use of a BasicEffect shared by all geometric primitives drawn on that device context.&lt;br /&gt;
&lt;h1&gt;Advanced drawing&lt;/h1&gt;This form of drawing makes use of a custom &lt;a href="https://directxtk.codeplex.com/wikipage?title=Effects&amp;referringTitle=GeometricPrimitive"&gt;Effects&lt;/a&gt; instance. The caller is responsible for using an input layout that matches the effect.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
IEffect* myeffect = ...

Microsoft::WRL::ComPtr&amp;lt;ID3D11InputLayout&amp;gt; inputLayout;
shape-&amp;gt;CreateInputLayout( myeffect, &amp;amp;inputLayout );

shape-&amp;gt;Draw( myeffect, inputLayout.Get() );
&lt;/pre&gt;&lt;/div&gt;This takes an optional parameter for enabling alpha-blending, wireframe, and a callback function which can be used to override the default rendering state.&lt;br /&gt;
&lt;h1&gt;Coordinate systems&lt;/h1&gt;These geometric primitives (based on the XNA Game Studio conventions) use right-handed coordinates. They can be used with left-handed coordinates by setting the &lt;i&gt;rhcoords&lt;/i&gt; parameter on the factory methods to &amp;#39;false&amp;#39; to reverse the winding ordering (the parameter defaults to &amp;#39;true&amp;#39;).&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
std::unique_ptr&amp;lt;GeometricPrimitive&amp;gt; shape(
GeometricPrimitive::CreateTeapot( deviceContext, 1.f, 8, &lt;span style="color:Blue;"&gt;false&lt;/span&gt; ) );
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Alpha blending&lt;/h1&gt;Alpha blending defaults to using premultiplied alpha. To make use of &amp;#39;straight&amp;#39; alpha textures, override the blending mode via the optional callback:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
CommonStates states(deviceContext);

shape-&amp;gt;Draw(world, view, projection, Colors::White, catTexture, &lt;span style="color:Blue;"&gt;false&lt;/span&gt;, [=]
{
    deviceContext-&amp;gt;OMSetBlendState( states.NonPremultiplied(), &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;, 0xFFFFFFFF);
});
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Feature Level Notes&lt;/h1&gt;In order to support all feature levels, the GeometricPrimitive implementation make use of 16-bit indices (DXGI_FORMAT_R16_UINT) which limits to a maximum of 65535 vertices. Feature Level 9.1 is limited to a maximum of 65535 primitives in a single draw.&lt;br /&gt;
&lt;h1&gt;Threading model&lt;/h1&gt;Each GeometricPrimitive instance only supports drawing from one thread at a time, but you can simultaneously submit primitives on multiple threads if you create a separate GeometricPrimitive instance per Direct3D 11 deferred context.&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476892.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ff476892.aspx&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Further Reading&lt;/h1&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Cube"&gt;http://en.wikipedia.org/wiki/Cube&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Utah_teapot"&gt;http://en.wikipedia.org/wiki/Utah_teapot&lt;/a&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Wed, 22 May 2013 22:29:11 GMT</pubDate><guid isPermaLink="false">Updated Wiki: GeometricPrimitive 20130522102911P</guid></item><item><title>Commented Unassigned: Implement polyhedron as geometric primitive [931]</title><link>http://directxtk.codeplex.com/workitem/931</link><description>DirectXTK implements a number of GeometricPrimitives, but it is missing a number of shapes supported by OpenGL&amp;#39;s glut library.&lt;br /&gt;&lt;br /&gt;&amp;#42; glut&amp;#42;Dodecahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Octahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Tetrahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Icosahedron&lt;br /&gt;&lt;br /&gt;PS&amp;#58; It&amp;#39;s also missing glut&amp;#42;Cone, but that&amp;#39;s covered by &amp;#91;921&amp;#93;&amp;#40;https&amp;#58;&amp;#47;&amp;#47;directxtk.codeplex.com&amp;#47;workitem&amp;#47;921&amp;#41;&lt;br /&gt;Comments: ** Comment from web user: walbourn ** &lt;p&gt;[Dodecahedron](http://en.wikipedia.org/wiki/Dodecahedron)&lt;br&gt;[Octahedron](http://en.wikipedia.org/wiki/Octahedron)&lt;br&gt;[Tetrahedron](http://en.wikipedia.org/wiki/Tetrahedron)&lt;br&gt;[Icosahedron](http://en.wikipedia.org/wiki/Icosahedron)&lt;br&gt;&lt;/p&gt;</description><author>walbourn</author><pubDate>Wed, 22 May 2013 22:22:25 GMT</pubDate><guid isPermaLink="false">Commented Unassigned: Implement polyhedron as geometric primitive [931] 20130522102225P</guid></item><item><title>Commented Feature: Implement cone as geometry primitive [921]</title><link>http://directxtk.codeplex.com/workitem/921</link><description>Hello,&lt;br /&gt;&lt;br /&gt;I&amp;#39;m sorry if this is not the right place to request, is there a chance to implement a cone as a geometry primitive in DirectxTK&amp;#63;&lt;br /&gt;&lt;br /&gt;the reason is, cones are very useful in implementing spot lights, especially in deferred or pre-pass lightning renderers.&lt;br /&gt;&lt;br /&gt;thanks in advance.&lt;br /&gt;Comments: ** Comment from web user: walbourn ** &lt;p&gt;Related to workitem [931](https://directxtk.codeplex.com/workitem/931)&lt;/p&gt;</description><author>walbourn</author><pubDate>Wed, 22 May 2013 22:22:12 GMT</pubDate><guid isPermaLink="false">Commented Feature: Implement cone as geometry primitive [921] 20130522102212P</guid></item><item><title>Created Unassigned: Implement polyhedron as geometric primitive [931]</title><link>http://directxtk.codeplex.com/workitem/931</link><description>DirectXTK implements a number of GeometricPrimitives, but it is missing a number of shapes supported by OpenGL&amp;#39;s glut library.&lt;br /&gt;&lt;br /&gt;&amp;#42; glut&amp;#42;Dodecahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Octahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Tetrahedron&lt;br /&gt;&amp;#42; glut&amp;#42;Icosahedron&lt;br /&gt;&lt;br /&gt;PS&amp;#58; It&amp;#39;s also missing glut&amp;#42;Cone, but that&amp;#39;s covered by &amp;#91;921&amp;#93;&amp;#40;https&amp;#58;&amp;#47;&amp;#47;directxtk.codeplex.com&amp;#47;workitem&amp;#47;921&amp;#41;&lt;br /&gt;</description><author>walbourn</author><pubDate>Wed, 22 May 2013 22:20:51 GMT</pubDate><guid isPermaLink="false">Created Unassigned: Implement polyhedron as geometric primitive [931] 20130522102051P</guid></item><item><title>Commented Feature: Implement cone as geometry primitive [921]</title><link>http://directxtk.codeplex.com/workitem/921</link><description>Hello,&lt;br /&gt;&lt;br /&gt;I&amp;#39;m sorry if this is not the right place to request, is there a chance to implement a cone as a geometry primitive in DirectxTK&amp;#63;&lt;br /&gt;&lt;br /&gt;the reason is, cones are very useful in implementing spot lights, especially in deferred or pre-pass lightning renderers.&lt;br /&gt;&lt;br /&gt;thanks in advance.&lt;br /&gt;Comments: ** Comment from web user: walbourn ** &lt;p&gt;Thanks for the suggestion.  Note that the choice of GeometricPrimitives we already implemented was based on historical precedent.&lt;/p&gt;&lt;p&gt;XNA Game Studio same &amp;quot;Primitives3D&amp;quot;&lt;br&gt;http://xbox.create.msdn.com/en-US/education/catalog/sample/primitives_3d&lt;/p&gt;&lt;p&gt;DXUT 'shapes' (cube, sphere, cylinder, torus, teapot)&lt;/p&gt;&lt;p&gt;OpenGL's glut implements glut*Cone, so this seems like a reasonable request.&lt;/p&gt;</description><author>walbourn</author><pubDate>Wed, 22 May 2013 22:17:32 GMT</pubDate><guid isPermaLink="false">Commented Feature: Implement cone as geometry primitive [921] 20130522101732P</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
that's it. Works all fine now. Thanks!&lt;br /&gt;
&lt;/div&gt;</description><author>progs</author><pubDate>Fri, 17 May 2013 06:12:07 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130517061207A</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;I imagine that's because the interop hasn't completed initializing yet. Put it in CubeRenderer::CreateWindowSizeDependentResources() instead, or somewhere else.&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Thu, 16 May 2013 20:26:55 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130516082655P</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
I don't get an StackTrace. The Problem i think is here the mixed C++ and C# Code. The WP8 Project is written in C# and includes the C++ Library. I only get the ArgumentViolationException. I also do not think the m_d3dContext is bad, because if I remove the SpriteBatch initialization, all other code (including Context Methods) work fine.&lt;br /&gt;
&lt;br /&gt;
I use the Standard Default Template of Visual Studio and only added the DirectX Tool Kit.&lt;br /&gt;
&lt;/div&gt;</description><author>progs</author><pubDate>Wed, 15 May 2013 18:03:50 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130515060350P</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;Usually I've found this will happen when you've got a bad pointer (perhaps you deleted it somewhere or it was never initialized?). I'd need more information (a stack trace would be handy here) to help you figure out what the cause was. If it's happening when you create your SpriteBatch object, I'd bet your m_d3dContext pointer is bad.&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Wed, 15 May 2013 17:07:33 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130515050733P</guid></item><item><title>New Post: AccessViolationException while creating SpriteBatch</title><link>http://directxtk.codeplex.com/discussions/443692</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
if I try to create a new SpriteBatch, I get an AccessViolationException on (MainPage.xaml)&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;DrawingSurfaceBackground.SetBackgroundContentProvider(m_d3dBackground.CreateContentProvider());&lt;/code&gt;&lt;/pre&gt;

Code to init SpriteBatch (CubeRenderer.cpp in CreateDeviceResources()):&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;m_spriteBatch = unique_ptr&amp;lt;SpriteBatch&amp;gt;(new SpriteBatch(m_d3dContext.Get()));&lt;/code&gt;&lt;/pre&gt;

As Project Template I use the default Windows Phone Direct3D with XAML Tempalte of the Windows Phone 8 SDK and I modify the CubeRenderer basic class. Does anyone know this issue?&lt;br /&gt;
&lt;/div&gt;</description><author>progs</author><pubDate>Wed, 15 May 2013 08:42:54 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException while creating SpriteBatch 20130515084254A</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;That article was perfect! It really helped me understand what was actually going on and how to draw my billboards correctly. My rendering looks great now and is batched together.&lt;br /&gt;
&lt;br /&gt;
Thanks again Shawn! Also, it seems like your blog has a wealth of free information. I'll be studying up on it a lot in the future :)&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Wed, 15 May 2013 05:55:35 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130515055535A</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;This article might help with your question about depth sorting:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://blogs.msdn.com/b/shawnhar/archive/2009/02/18/depth-sorting-alpha-blended-objects.aspx" rel="nofollow"&gt;http://blogs.msdn.com/b/shawnhar/archive/2009/02/18/depth-sorting-alpha-blended-objects.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>ShawnHargreaves</author><pubDate>Wed, 15 May 2013 03:22:40 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130515032240A</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;Thanks Shawn, this is very helpful. I'll take your advice and do a XMVector3Transform() to transform my positions on the CPU using the billboard's world matrix before rendering, keeping each billboard using the same state for the batch.&lt;br /&gt;
&lt;br /&gt;
The 2nd concern I had was the ordering of the billboards when they were drawn. Giving each billboard its own separate batch had them clipping each other. Do I have to sort manually via Z order before drawing or is there a way to have PrimitiveBatch do the right thing?&lt;br /&gt;
&lt;br /&gt;
Thanks again for your help!&lt;br /&gt;
&lt;br /&gt;
Jared&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Tue, 14 May 2013 20:14:53 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130514081453P</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;You cannot change state settings in between individual draw calls within a single batch.  The whole point of a batch is to 'batch' up many draw calls, then submit them to the GPU all in one go.  So by definition, it's impossible to have a different state for each draw, because there is really only one single combined draw taking place.&lt;br /&gt;
&lt;br /&gt;
The simplest solution is to use a separate batch (begin/end block) for each object that you want to draw using a different state.  First set the state, then begin the batch, then draw, then end the batch.&lt;br /&gt;
&lt;br /&gt;
A more efficient approach is to draw everything in a single batch, and change your rendering algorithms so that all the objects within the batch can use the same state.  This means no longer applying a different world matrix to the effect per draw.  One way to do that would be to leave the effect world matrix set to identity, and instead apply that same transform to your source vertex positions on the CPU, before passing them to PrimitiveBatch.&lt;br /&gt;
&lt;br /&gt;
An even more efficient but complex way to draw very large numbers of billboards is to do the billboarding computation inside the vertex shader.  I don't know of a good D3D sample showing this technique, but the XNA Particle 3D sample uses this idea.&lt;br /&gt;
&lt;/div&gt;</description><author>ShawnHargreaves</author><pubDate>Tue, 14 May 2013 19:48:26 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130514074826P</guid></item><item><title>New Post: Batching textured quads using BasicEffect and PrimitiveBatch</title><link>http://directxtk.codeplex.com/discussions/443627</link><description>&lt;div style="line-height: normal;"&gt;I've been struggling a bit to get this working the right way.. figured I'd give this forum a try.&lt;br /&gt;
&lt;br /&gt;
I'd like to batch a textured billboard quad draw using BasicEffect and PrimitiveBatch.. but I'm not sure how to go about doing this. &lt;br /&gt;
&lt;br /&gt;
What I'm trying to do looks something like this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
// Setup during initialization
BasicEffect* be = new BasicEffect(dc);
be-&amp;gt;SetTextureEnabled(true);
be-&amp;gt;EnableDefaultLighting(true);

// Load shader blob using BasicEffect and Create input layout using
// VertexPositionNormalColorTexture in DirectXTK
// Create PrimitiveBatch&amp;lt;VertexPositionNormalColorTexture&amp;gt; 

// Every Update Call 
be-&amp;gt;SetProjection(camera-&amp;gt;GetProjection);
be-&amp;gt;SetView(camera-&amp;gt;GetView);

// Every draw call
be-&amp;gt;SetTexture(myTexture);
be-&amp;gt;Apply(dc);
dc-&amp;gt;IASetInputLayout(myLayout);
primitiveBatch-&amp;gt;Begin();

for(auto it = billboards.begin(); it != billboards.end(); it++)
{
    be-&amp;gt;SetWorld(it-&amp;gt;GetWorld());
    be-&amp;gt;Apply(dc);
    primitiveBatch-&amp;gt;DrawQuad(/* draw quad vertices untransformed */);
}

primitiveBatch-&amp;gt;End();
&lt;/code&gt;&lt;/pre&gt;

In case it's not clear from my code, I'm trying to save to the perframe const buffer the final world translation of each billboard in the effect before calling primitiveBatch draw. The only way I can get this to work properly is do a PrimitiveBatch::Begin() and ::End() call per billboard with each having the basic effect's world translation set each time before the call to ::Begin(). &lt;br /&gt;
&lt;br /&gt;
Also, even with my non-batch like calls to PrimitiveBatch, my billboards do not draw in the correct order... Although they do show up as transparent, when placed next to each other, they seem to clip each other. Do I have to manually order each one before drawing in the batch based on its z value?&lt;br /&gt;
&lt;br /&gt;
Thanks!&lt;br /&gt;
&lt;br /&gt;
Jared&lt;br /&gt;
&lt;/div&gt;</description><author>dajyareo</author><pubDate>Tue, 14 May 2013 17:35:31 GMT</pubDate><guid isPermaLink="false">New Post: Batching textured quads using BasicEffect and PrimitiveBatch 20130514053531P</guid></item><item><title>New Post: Where to start</title><link>https://directxtk.codeplex.com/discussions/443363</link><description>&lt;div style="line-height: normal;"&gt;There's a ton of material on MSDN for &lt;a href="http://dev.windows.com/" rel="nofollow"&gt;Windows Store&lt;/a&gt; and &lt;a href="http://dev.windowsphone.com/" rel="nofollow"&gt;Windows phone 8&lt;/a&gt; which is your best place to start for overviews...&lt;br /&gt;
&lt;br /&gt;
As for DirectXTK, there are a few basic samples to get you &lt;a href="https://directxtk.codeplex.com/wikipage?title=Samples&amp;amp;referringTitle=Documentation" rel="nofollow"&gt;started&lt;/a&gt;:&lt;br /&gt;
&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 14 May 2013 06:55:56 GMT</pubDate><guid isPermaLink="false">New Post: Where to start 20130514065556A</guid></item></channel></rss>