<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>XNA Framework Content Pipeline</title><link>http://forums.xna.com/forums/55.aspx</link><description>Get the most from your art assets in XNA Game Studio Express</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25757.aspx</link><pubDate>Mon, 24 Sep 2007 02:24:45 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25757</guid><dc:creator>wachichi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25757.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25757</wfw:commentRss><description>&lt;P&gt;Excellent! I found the first solution on the train, I guess the more answers you get from a forum, the less you try yourself ;)&lt;/P&gt;
&lt;P&gt;Thanks for all you posts, they really helped me out and now I finally got my proof-of-concept working!&lt;/P&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25741.aspx</link><pubDate>Sun, 23 Sep 2007 19:00:24 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25741</guid><dc:creator>Shawn Hargreaves</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25741.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25741</wfw:commentRss><description>If your object contains any graphics types (vertex buffer, effect, texture, etc) you can look at their GraphicsDevice properties&lt;br&gt;&amp;nbsp;to find the device.&lt;br&gt;&lt;br&gt;Alternatively you can look this up and store it from inside your ContentTypeReader. Look up ContentReader.ContentManager.ServiceProvider, query that for an IGraphicsDeviceService, and look up the actual GraphicsDevice from there.&lt;br&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25723.aspx</link><pubDate>Sun, 23 Sep 2007 17:35:50 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25723</guid><dc:creator>wachichi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25723.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25723</wfw:commentRss><description>&lt;P&gt;okok I know you must be bored of my questions by now, but I get the feeling I'm getting there ;)&lt;/P&gt;
&lt;P&gt;to load and render a Model, you don't have to specify the device anywhere. However, when rendering primitives, you always need to specify the device.&lt;/P&gt;
&lt;P&gt;So... in my example, i'm loading an object through a ccp. Now, I want to render this to the screen the same as when rendering&amp;nbsp;a Model: using a simple myObject.Draw() call, without having to specify the device.&lt;/P&gt;
&lt;P&gt;How can this be done?&lt;/P&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25635.aspx</link><pubDate>Sat, 22 Sep 2007 10:57:10 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25635</guid><dc:creator>wachichi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25635.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25635</wfw:commentRss><description>&lt;TABLE id=HB_Mail_Container cellSpacing=0 cellPadding=0&gt;

&lt;TR&gt;
&lt;TD id=HB_Focus_Element&gt;OK thanks again, I was already looking at the basicmaterial content, but didn't hope it would be deserialized into a basiceffect immediately. Thanks again!&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="FONT-SIZE:1pt;"&gt;
&lt;DIV id=hotbar_promo&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25604.aspx</link><pubDate>Fri, 21 Sep 2007 20:54:17 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25604</guid><dc:creator>jwatte</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25604.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25604</wfw:commentRss><description>&lt;P&gt;Good start! Now if you can get that table into the documentation on MSDN.&lt;/P&gt;
&lt;P&gt;Also, I think you're missing the bone and node content types, and a diagram showing how they go together to create a model (I'm away from my reference -- is there a ModelContent ?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25601.aspx</link><pubDate>Fri, 21 Sep 2007 19:57:50 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25601</guid><dc:creator>Shawn Hargreaves</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25601.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25601</wfw:commentRss><description>Funnily enough, I just finished the doc for a sample showing how to make a custom replacement for our Model class, which includes this table:&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;table&gt;

&lt;tr&gt;
&lt;th&gt;Design-time type&lt;/th&gt;
&lt;th&gt;&amp;nbsp;Run-time type&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VertexBufferContent&lt;/td&gt;
&lt;td&gt;&amp;nbsp; VertexBuffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IndexCollection&lt;/td&gt;
&lt;td&gt;&amp;nbsp; IndexBuffer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VertexElement[] &lt;br&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp; VertexDeclaration&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TextureContent&lt;/td&gt;
&lt;td&gt;&amp;nbsp; Texture&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EffectMaterialContent&lt;/td&gt;
&lt;td&gt;&amp;nbsp; Effect&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BasicMaterialContent&lt;/td&gt;
&lt;td&gt;&amp;nbsp; BasicEffect&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CompiledEffect&lt;/td&gt;
&lt;td&gt;&amp;nbsp; Effect&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;br&gt;I'm sure I missed something, and we could certainly use a lot more documentation in this area, but that covers at least the most important types.&lt;br&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25596.aspx</link><pubDate>Fri, 21 Sep 2007 19:14:18 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25596</guid><dc:creator>jwatte</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25596.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25596</wfw:commentRss><description>I don't think the documentation is very clear on what the different content DOM classes are, and how they relate to the runtime content types. A diagram of some sort, with reference arrows, would help a lot!</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25548.aspx</link><pubDate>Fri, 21 Sep 2007 12:33:13 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25548</guid><dc:creator>Shawn Hargreaves</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25548.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25548</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://forums.xna.com/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;wachichi:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;
&lt;p&gt;Now I can't figure out how to create a basiceffect in the reader ... or should I load a custom .x file? A Basiceffect would be a lot cleaner though ...&lt;/p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br&gt;&lt;br&gt;Two ways:&lt;br&gt;&lt;ul&gt;&lt;li&gt;The way our Model class does it&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Have a BasicMaterialContent instance in the content processor&lt;/li&gt;&lt;li&gt;Use writer.WriteObject to save this to XNB&lt;/li&gt;&lt;li&gt;In the reader, use reader.ReadObject&amp;lt;BasicEffect&amp;gt; to load it in&lt;/li&gt;&lt;li&gt;You can also use reader.ReadObject&amp;lt;Effect&amp;gt; to load the same data, which will give you back the data as type Effect, but the instance it returns will actually be a BasicEffect if the design time source type was a BasicMaterialContent&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;The manual way&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Just call "new BasicEffect" in your reader, and then store whatever parameters you like into it&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25540.aspx</link><pubDate>Fri, 21 Sep 2007 11:46:17 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25540</guid><dc:creator>ShawMishrak</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25540.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25540</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://forums.xna.com/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;wachichi:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;When creating a graphicsdevice from the default adapter, you need to pass in a pointer to a form... but this is not XBox compatible.&lt;/p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br&gt;&lt;br&gt;You mean the renderWindowHandle parameter of the GraphicsDevice constructor?&amp;nbsp; On Xbox, you can just pass in IntPtr.Zero, since you don't have window handles on Xbox.&amp;nbsp; I've successfully created GraphicsDevice instances on Xbox that work using this.&amp;nbsp; I'm not sure if it's a "supported" or "recommended" way of doing this, but it works.&lt;br&gt;&lt;br&gt;Of course, I would follow Shawn's suggestions in your content pipeline.&amp;nbsp; This post is just meant to say that you *can* create your own GraphicsDevice instances on Xbox if you so choose.&amp;nbsp; Just don't create a GraphicsDeviceManager as well!&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25532.aspx</link><pubDate>Fri, 21 Sep 2007 11:10:49 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25532</guid><dc:creator>wachichi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25532.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25532</wfw:commentRss><description>&lt;P&gt;Thanks, thanks ... That helped me out again.&lt;/P&gt;
&lt;P&gt;At least for 5 minutes.. I'm stuck again. Now I can't figure out how to create a basiceffect in the reader ... or should I load a custom .x file? A Basiceffect would be a lot cleaner though ...&lt;/P&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25373.aspx</link><pubDate>Thu, 20 Sep 2007 05:37:58 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25373</guid><dc:creator>Leaf Garland</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25373.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25373</wfw:commentRss><description>The type is &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.content.pipeline.graphics.indexcollection.aspx"&gt;IndexCollection&lt;/a&gt;, not IndexBufferContent.&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;Leaf.&lt;br&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/25370.aspx</link><pubDate>Thu, 20 Sep 2007 04:51:03 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:25370</guid><dc:creator>wachichi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/25370.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=25370</wfw:commentRss><description>&lt;P&gt;Your answer solved most of my problems, but I cannot seem to find the IndexBufferContent class ... not even in the help file, while the VertexBufferContent was no problem at all.&lt;/P&gt;
&lt;P&gt;Can you guide me on how to create an indexbuffer in the TypeReader?&lt;/P&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/24191.aspx</link><pubDate>Mon, 10 Sep 2007 03:42:18 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:24191</guid><dc:creator>wachichi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/24191.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=24191</wfw:commentRss><description>&lt;P&gt;OK thanks for the extremely detailed answer,&amp;nbsp;it actually makes sense ;)&lt;/P&gt;
&lt;P&gt;I will try it right away.&lt;/P&gt;</description></item><item><title>Re: questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/24145.aspx</link><pubDate>Sun, 09 Sep 2007 17:19:23 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:24145</guid><dc:creator>Shawn Hargreaves</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/24145.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=24145</wfw:commentRss><description>I'll answer 2) first, as that actually covers your question 1) as well.&lt;br&gt;&lt;br&gt;The trick is, your ContentTypeWriter and ContentTypeReader don't have to implement the same type! The ContentTypeWriter has a GetRuntimeType method, which can report whatever type this data will be loaded into at runtime. For instance (contrived case) I could have:&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContentTypeWriter MyWriter&amp;lt;string&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; overrride void Write(string value)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  output.Write(value);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; override string GetRuntimeType()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  return typeof(int).AssemblyQualifiedName;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;and then at runtime:&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContentTypeReader MyReader&amp;lt;int&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  override int Read()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  return int.Parse(input.ReadString());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;Ok, so that on isn't particularly useful, but it gets the point across: as long as both the writer and reader agree as to what the format of the data on disk is, you can write one type, and then read that same data back into a different one.&lt;br&gt;&lt;br&gt;This is not only how ModelContent -&amp;gt; Model works, but also how we handle things like VertexBufferContent -&amp;gt; VertexBuffer, IndexBufferContent -&amp;gt; IndexBuffer, EffectContent -&amp;gt; Effect, Texture2DContent -&amp;gt; Texture2D, etc.&lt;br&gt;&lt;br&gt;There is never a graphics device during the build process, but instead it can use other related content types that do not require a graphics device. Then when this data is loaded back in, it can be read into the actual type that does use the graphics device.&lt;br&gt;&lt;br&gt;There are two huge advantages to this separation of types:&lt;br&gt;&lt;ul&gt;&lt;li&gt;It is much faster, since at build time we can store the data in simple managed types, not bothering to upload it to the graphics card as an actual GPU data type (for instance building large models is much faster if you don't bother to upload all the vertex data to the GPU each time)&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Doing things this way makes it possible to build Xbox format textures and shaders, even though it wouldn't be possible to create an Xbox format GPU object on a Windows PC during the build process.&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;</description></item><item><title>questions on the default ModelProcessor</title><link>http://forums.xna.com/forums/thread/24138.aspx</link><pubDate>Sun, 09 Sep 2007 16:47:02 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:24138</guid><dc:creator>wachichi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/24138.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=55&amp;PostID=24138</wfw:commentRss><description>&lt;P&gt;I'm playing around with a custom content pipeline, and there are 2 more things I would like to do before I&amp;nbsp;get to&amp;nbsp;the proof-of-concept level. I cannot find how to do it, but they should be possible as the default ModelProcessor seems to be capable of doing them.&lt;/P&gt;
&lt;P&gt;Here we go...&lt;/P&gt;
&lt;P&gt;1) In a custom typewriter, I would like to be able to access the graphicsdevice. A Model comes loaded with vertexbuffer and indexbuffer, so I know it should be possible as you need the graphicsdevice when creating a v-or-i-buffer. When creating a graphicsdevice from the default adapter, you need to pass in a pointer to a form... but this is not XBox compatible.&lt;/P&gt;
&lt;P&gt;2) The default model processor generates a ModelContent object, but when you load a model you get a Model object! So somehow in the TypeReader it should be possible to do this conversion, but the different overloads of the Read method doesn't allow me to do this ... I always end up with some kind of violation.&lt;/P&gt;
&lt;P&gt;Any comments/suggestions/ideas/thoughts ?&lt;/P&gt;</description></item></channel></rss>