<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Uniform Buffers VS Texture Buffers</title>
	<atom:link href="http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/feed/" rel="self" type="application/rss+xml" />
	<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/</link>
	<description>A technical blog from Daniel Rákos (aka aqnuep)</description>
	<lastBuildDate>Sat, 28 Jan 2012 01:53:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Daniel Rákos</title>
		<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/comment-page-1/#comment-2081</link>
		<dc:creator>Daniel Rákos</dc:creator>
		<pubDate>Mon, 27 Jun 2011 14:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=68#comment-2081</guid>
		<description>Yes, you are right, quaternions avoid several artifacts that may appear in case you lerp the bone matrices, however, if you have enough key matrices then the artifacts are not really visible. But nobody stops you from storing simply the quaternions in the texture, you can still take advantage of the linear filtering to lerp them.
Also, for bone matrices usually you need only three rows, not all fours so you are right, but the theory still stands, you can halve the number of fetches, then from 6 to 3. I just didn&#039;t want to confuse you, so I simply talked about 4x4 matrices.
So the conclusion should be that no matter if you interpolate quaternions or matrices, you can speed up things theoretically by 100% by using the free linear filtering, of course, with the trade-off of limited precision.</description>
		<content:encoded><![CDATA[<p>Yes, you are right, quaternions avoid several artifacts that may appear in case you lerp the bone matrices, however, if you have enough key matrices then the artifacts are not really visible. But nobody stops you from storing simply the quaternions in the texture, you can still take advantage of the linear filtering to lerp them.<br />
Also, for bone matrices usually you need only three rows, not all fours so you are right, but the theory still stands, you can halve the number of fetches, then from 6 to 3. I just didn&#8217;t want to confuse you, so I simply talked about 4&#215;4 matrices.<br />
So the conclusion should be that no matter if you interpolate quaternions or matrices, you can speed up things theoretically by 100% by using the free linear filtering, of course, with the trade-off of limited precision.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: airfeng</title>
		<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/comment-page-1/#comment-2079</link>
		<dc:creator>airfeng</dc:creator>
		<pubDate>Mon, 27 Jun 2011 13:15:17 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=68#comment-2079</guid>
		<description>Thank you very much for the quick reply and I really appriciate with the answer. One more thing i doubt is whether or not the matrices could be interpolated peacefully without something strange happens.  I used to think the interplolation should be done on cpu side with the rotation quternions be slerped and position vectors be lineared, from whitch regenerate the bone&#039;s matrix? 
Besides, can the texture be just three rows since the bone matrices generally give their sub 3X4 matrices of value? thank you.</description>
		<content:encoded><![CDATA[<p>Thank you very much for the quick reply and I really appriciate with the answer. One more thing i doubt is whether or not the matrices could be interpolated peacefully without something strange happens.  I used to think the interplolation should be done on cpu side with the rotation quternions be slerped and position vectors be lineared, from whitch regenerate the bone&#8217;s matrix?<br />
Besides, can the texture be just three rows since the bone matrices generally give their sub 3X4 matrices of value? thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Rákos</title>
		<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/comment-page-1/#comment-2077</link>
		<dc:creator>Daniel Rákos</dc:creator>
		<pubDate>Mon, 27 Jun 2011 10:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=68#comment-2077</guid>
		<description>When I said &quot;we can take advantage of the free interpolation thanks to the dedicated texture fetching units&quot; I meant that the texture fetching units of GPUs perform linear filtering (interpolation) on the texels for free.
As in case of animation you usually interpolate matrices, you can reduce the number of necessary texture fetches by using a 2D texture instead of a texture buffer as an example.
Just put the first row of a transformation matrix in the RGBA components of a float texture texel, then the next row in the texel below that and so on. Then put the next transformation matrix data in the next texel column. This way, if you want to interpolate between the two matrix, you need only 4 texture fetches (one for each texel row) using a U (column) coordinate that will cause the rows of the two matrices to be linearly interpolated thanks to the free bilinear filtering exposed by the hardware. With a texture buffer, you can achieve the same thing only with 8 texture fetches and a manual interpolation in the shader. While this later may be more accurate (because the bilinear filtering done by the texture fetching units are less accurate), in practice this may prove acceptable and you can potentially get a 100% speedup.</description>
		<content:encoded><![CDATA[<p>When I said &#8220;we can take advantage of the free interpolation thanks to the dedicated texture fetching units&#8221; I meant that the texture fetching units of GPUs perform linear filtering (interpolation) on the texels for free.<br />
As in case of animation you usually interpolate matrices, you can reduce the number of necessary texture fetches by using a 2D texture instead of a texture buffer as an example.<br />
Just put the first row of a transformation matrix in the RGBA components of a float texture texel, then the next row in the texel below that and so on. Then put the next transformation matrix data in the next texel column. This way, if you want to interpolate between the two matrix, you need only 4 texture fetches (one for each texel row) using a U (column) coordinate that will cause the rows of the two matrices to be linearly interpolated thanks to the free bilinear filtering exposed by the hardware. With a texture buffer, you can achieve the same thing only with 8 texture fetches and a manual interpolation in the shader. While this later may be more accurate (because the bilinear filtering done by the texture fetching units are less accurate), in practice this may prove acceptable and you can potentially get a 100% speedup.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: airfeng</title>
		<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/comment-page-1/#comment-2074</link>
		<dc:creator>airfeng</dc:creator>
		<pubDate>Mon, 27 Jun 2011 03:22:32 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=68#comment-2074</guid>
		<description>&quot;however, I personally prefer using normal 2D textures for this purpose to take advantage of the free interpolation thanks to the dedicated texture fetching units but that’s another story.&quot;

----do you mind sharing the story with us? I am just finding a way to trans the bone&#039;s matrix to shader.  if a 2d texture can just do it, how should i prepare/organize the tex&#039;s data for better performance? i&#039;am not sure what&#039;s the meaning of &quot;dedicated texture fetching units&quot;, is it a new cap of specific vender or ...? thank you.</description>
		<content:encoded><![CDATA[<p>&#8220;however, I personally prefer using normal 2D textures for this purpose to take advantage of the free interpolation thanks to the dedicated texture fetching units but that’s another story.&#8221;</p>
<p>&#8212;-do you mind sharing the story with us? I am just finding a way to trans the bone&#8217;s matrix to shader.  if a 2d texture can just do it, how should i prepare/organize the tex&#8217;s data for better performance? i&#8217;am not sure what&#8217;s the meaning of &#8220;dedicated texture fetching units&#8221;, is it a new cap of specific vender or &#8230;? thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Rákos</title>
		<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/comment-page-1/#comment-1279</link>
		<dc:creator>Daniel Rákos</dc:creator>
		<pubDate>Thu, 10 Mar 2011 09:08:19 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=68#comment-1279</guid>
		<description>Well, that&#039;s a pretty interesting question. I think this is something that only AMD guys can tell, but I think UBO binding should be cheap if caching is used as well. At least its cost should be very minor compared to the additional performance gain thanks to the on-chip constant store.</description>
		<content:encoded><![CDATA[<p>Well, that&#8217;s a pretty interesting question. I think this is something that only AMD guys can tell, but I think UBO binding should be cheap if caching is used as well. At least its cost should be very minor compared to the additional performance gain thanks to the on-chip constant store.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Supnik</title>
		<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/comment-page-1/#comment-1277</link>
		<dc:creator>Ben Supnik</dc:creator>
		<pubDate>Wed, 09 Mar 2011 18:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=68#comment-1277</guid>
		<description>So does that imply that when a UBO is bound, it might be _copied_ onto the local data share caches on chip?

Reading the R700 docs, it looks like ATI chips can source &#039;constants&#039; from _either_ VRAM by a ptr or a direct (but _very_ small) constant file.  Of course, direct fetches from VRAM are always possible.

I bring this up because I&#039;m wondering about the cost of using UBO values vs the cost of _changing_ which UBO is bound.  If the GPU is using UBOs &quot;by ptr&quot; a bind has the potential to be cheap, but if it&#039;s using them &quot;by caching&quot; then we pay for the cache upload at batch start.</description>
		<content:encoded><![CDATA[<p>So does that imply that when a UBO is bound, it might be _copied_ onto the local data share caches on chip?</p>
<p>Reading the R700 docs, it looks like ATI chips can source &#8216;constants&#8217; from _either_ VRAM by a ptr or a direct (but _very_ small) constant file.  Of course, direct fetches from VRAM are always possible.</p>
<p>I bring this up because I&#8217;m wondering about the cost of using UBO values vs the cost of _changing_ which UBO is bound.  If the GPU is using UBOs &#8220;by ptr&#8221; a bind has the potential to be cheap, but if it&#8217;s using them &#8220;by caching&#8221; then we pay for the cache upload at batch start.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregory Maddox</title>
		<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/comment-page-1/#comment-395</link>
		<dc:creator>Gregory Maddox</dc:creator>
		<pubDate>Thu, 19 Aug 2010 22:05:36 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=68#comment-395</guid>
		<description>Thank you for this informative post. Most valuable! I was having trouble finding out the differences.</description>
		<content:encoded><![CDATA[<p>Thank you for this informative post. Most valuable! I was having trouble finding out the differences.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jcabeleira</title>
		<link>http://rastergrid.com/blog/2010/01/uniform-buffers-vs-texture-buffers/comment-page-1/#comment-12</link>
		<dc:creator>Jcabeleira</dc:creator>
		<pubDate>Thu, 28 Jan 2010 19:45:37 +0000</pubDate>
		<guid isPermaLink="false">http://rastergrid.com/blog/?p=68#comment-12</guid>
		<description>Thanks for this article, it&#039;s a god giving to me. 
I just finished a small GPU raytracing experiment that I&#039;m working on for my master thesis, and although I&#039;m using textures to feed the shader with the scene data, I was considering using an alternative method to pass the data like uniforms.
I was unsure of the benefits of this,  but thanks to you I now know all the prons and cons of each method.

Once again, thank you very much!</description>
		<content:encoded><![CDATA[<p>Thanks for this article, it&#8217;s a god giving to me.<br />
I just finished a small GPU raytracing experiment that I&#8217;m working on for my master thesis, and although I&#8217;m using textures to feed the shader with the scene data, I was considering using an alternative method to pass the data like uniforms.<br />
I was unsure of the benefits of this,  but thanks to you I now know all the prons and cons of each method.</p>
<p>Once again, thank you very much!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

