<?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: Encoding floats to RGBA, again</title>
	<atom:link href="http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/feed/" rel="self" type="application/rss+xml" />
	<link>http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/</link>
	<description>Random thoughts of a triangle pusher</description>
	<lastBuildDate>Thu, 09 Feb 2012 07:56:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: HoraceOD</title>
		<link>http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/comment-page-1/#comment-172384</link>
		<dc:creator>HoraceOD</dc:creator>
		<pubDate>Sat, 04 Feb 2012 01:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=181#comment-172384</guid>
		<description>Be convinced of it or not, 7 commuter vehicles are not newfangled inventions. In actuality, they time retreat from to the 1920s when there were vehicles called depot hacks that were euphemistic pre-owned to report people and their luggage to and from train stations. In the 1940s, Jeep truly introduced a 7 rider conduit called the Jeep Wagon.  
  
There possess also been numerous 7 rider vehicles at an end the years that were called status wagons. Some of these were uninterrupted effective of room 9 people. However, appoint wagons be dressed evolved into SUVs and minivans and today it is tough to purchase something called a place wagon.  
  
Today&#039;s 7 Rider Vehicles  
  
Location wagons began losing acceptance in the 1970s suitable mostly to the 1973 unguent crisis. It created a slightly ill of turning instant against the model American rank wagon with its vinyl bench seats and sluggish V8 engine. Some people referred to these as &quot;lumbering landmarks.&quot; The last American-made, full-size models were the Chevrolet Caprice and the Buick Roadmaster. Both were discontinued in 1996.  
  
As mentioned greater than, two types of 7 voyager vehicles pull someone&#039;s leg replaced caste wagons. The first of these is the minivan as mentioned above. Chrysler Corporation introduced it in 1984. Minivans quickly became predominating because they would adapt 7 passengers (or 4 people with a straws of consignment) and because they offered so much more national space than the to some degree low-slung position wagons.  
  
The second category of conveyance that helped kill touched in the head the spot wagon is the 7 rider SUV. There are now varied of these vehicles elbow in a wide range of prices. This includes high-priced, luxuriousness vehicles such as the Cadillac Escalade, the Lincoln Seaman, the Mercedes-Benz GL 450 and the Lexus LX 570, all of which can tariff up to $70,000. Lower-priced 7 rider SUVs list the Toyota Highlander, the Ford Explorer and the Honda Pilot. However, it is important to be conversant with that &quot;lower-priced&quot; means vehicles that cost from $25,000-$35,000. In laconic, they are lower-priced alone when compared to the opulence models. 
 
&lt;a href=&quot;http://www.lida.web.tr&quot; rel=&quot;nofollow&quot;&gt;google lidafuck&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Be convinced of it or not, 7 commuter vehicles are not newfangled inventions. In actuality, they time retreat from to the 1920s when there were vehicles called depot hacks that were euphemistic pre-owned to report people and their luggage to and from train stations. In the 1940s, Jeep truly introduced a 7 rider conduit called the Jeep Wagon.  </p>
<p>There possess also been numerous 7 rider vehicles at an end the years that were called status wagons. Some of these were uninterrupted effective of room 9 people. However, appoint wagons be dressed evolved into SUVs and minivans and today it is tough to purchase something called a place wagon.  </p>
<p>Today&#8217;s 7 Rider Vehicles  </p>
<p>Location wagons began losing acceptance in the 1970s suitable mostly to the 1973 unguent crisis. It created a slightly ill of turning instant against the model American rank wagon with its vinyl bench seats and sluggish V8 engine. Some people referred to these as &#8220;lumbering landmarks.&#8221; The last American-made, full-size models were the Chevrolet Caprice and the Buick Roadmaster. Both were discontinued in 1996.  </p>
<p>As mentioned greater than, two types of 7 voyager vehicles pull someone&#8217;s leg replaced caste wagons. The first of these is the minivan as mentioned above. Chrysler Corporation introduced it in 1984. Minivans quickly became predominating because they would adapt 7 passengers (or 4 people with a straws of consignment) and because they offered so much more national space than the to some degree low-slung position wagons.  </p>
<p>The second category of conveyance that helped kill touched in the head the spot wagon is the 7 rider SUV. There are now varied of these vehicles elbow in a wide range of prices. This includes high-priced, luxuriousness vehicles such as the Cadillac Escalade, the Lincoln Seaman, the Mercedes-Benz GL 450 and the Lexus LX 570, all of which can tariff up to $70,000. Lower-priced 7 rider SUVs list the Toyota Highlander, the Ford Explorer and the Honda Pilot. However, it is important to be conversant with that &#8220;lower-priced&#8221; means vehicles that cost from $25,000-$35,000. In laconic, they are lower-priced alone when compared to the opulence models. </p>
<p><a href="http://www.lida.web.tr" rel="nofollow">google lidafuck</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lost in the Triangles &#187; Blog Archive &#187; Encoding floats to RGBA &#8211; the final?</title>
		<link>http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/comment-page-1/#comment-20146</link>
		<dc:creator>Lost in the Triangles &#187; Blog Archive &#187; Encoding floats to RGBA &#8211; the final?</dc:creator>
		<pubDate>Thu, 30 Jul 2009 12:58:20 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=181#comment-20146</guid>
		<description>[...] right there on my previous blog post [...]</description>
		<content:encoded><![CDATA[<p>[...] right there on my previous blog post [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Salvatore Previti</title>
		<link>http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/comment-page-1/#comment-16380</link>
		<dc:creator>Salvatore Previti</dc:creator>
		<pubDate>Tue, 03 Feb 2009 07:17:13 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=181#comment-16380</guid>
		<description>Use these two :)

inline float4 FloatToRGBA(float value)
{
	float4 packedValue = frac(value * float4(16777216, 65536, 256, 1));
	return packedValue - packedValue.xxyz * float4(0, 1.0 / 256, 1.0 / 256, 1.0 / 256);
}

inline float RGBAToFloat(float4 packedValue)
{
	return dot(packedValue, float4( 1.0 / 16777216, 1.0 / 65536, 1.0 / 256, 1.0));
}

This works quite well for all values from 0.0 (included) to 1.0 (excluded).
If you need to store value 1.0 too, you can simply divide the input of FloatToRGBA and  multiply the output of RGBAToFloat by 0.9999991 loosing only a small amount of precision.
It seems to work quite well also with bilinear interpolation of textures.</description>
		<content:encoded><![CDATA[<p>Use these two :)</p>
<p>inline float4 FloatToRGBA(float value)<br />
{<br />
	float4 packedValue = frac(value * float4(16777216, 65536, 256, 1));<br />
	return packedValue &#8211; packedValue.xxyz * float4(0, 1.0 / 256, 1.0 / 256, 1.0 / 256);<br />
}</p>
<p>inline float RGBAToFloat(float4 packedValue)<br />
{<br />
	return dot(packedValue, float4( 1.0 / 16777216, 1.0 / 65536, 1.0 / 256, 1.0));<br />
}</p>
<p>This works quite well for all values from 0.0 (included) to 1.0 (excluded).<br />
If you need to store value 1.0 too, you can simply divide the input of FloatToRGBA and  multiply the output of RGBAToFloat by 0.9999991 loosing only a small amount of precision.<br />
It seems to work quite well also with bilinear interpolation of textures.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aras Pranckevičius</title>
		<link>http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/comment-page-1/#comment-12339</link>
		<dc:creator>Aras Pranckevičius</dc:creator>
		<pubDate>Tue, 01 Jul 2008 10:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=181#comment-12339</guid>
		<description>@Pat: I think the difference is caused by the texture sampler differences. Even if GPUs do have floating point precision internally, regular 8 bit/channel textures are still sampled (and filtered!) at 8 bit precision, I guess for backwards compatibility reasons. Now, if there&#039;s a very slight change in how the sampling and filtering works, then differences like we have here might surface. That&#039;s my theory at least :)

@Alex: not sure, I haven&#039;t actually tried that approach.</description>
		<content:encoded><![CDATA[<p>@Pat: I think the difference is caused by the texture sampler differences. Even if GPUs do have floating point precision internally, regular 8 bit/channel textures are still sampled (and filtered!) at 8 bit precision, I guess for backwards compatibility reasons. Now, if there&#8217;s a very slight change in how the sampling and filtering works, then differences like we have here might surface. That&#8217;s my theory at least :)</p>
<p>@Alex: not sure, I haven&#8217;t actually tried that approach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Lindsay</title>
		<link>http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/comment-page-1/#comment-12338</link>
		<dc:creator>Alex Lindsay</dc:creator>
		<pubDate>Tue, 01 Jul 2008 10:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=181#comment-12338</guid>
		<description>Hi, I had a go at this problem in my own special way. I&#039;d be very interested in your opinions and results with the following (my post):
http://www.gamedev.net/community/forums/topic.asp?topic_id=485186
It&#039;s certainly less elegant than the frac encode!</description>
		<content:encoded><![CDATA[<p>Hi, I had a go at this problem in my own special way. I&#8217;d be very interested in your opinions and results with the following (my post):<br />
<a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=485186" rel="nofollow">http://www.gamedev.net/community/forums/topic.asp?topic_id=485186</a><br />
It&#8217;s certainly less elegant than the frac encode!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pat Wilson</title>
		<link>http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/comment-page-1/#comment-12252</link>
		<dc:creator>Pat Wilson</dc:creator>
		<pubDate>Tue, 24 Jun 2008 16:49:52 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=181#comment-12252</guid>
		<description>Hmm, come to think of it, I don&#039;t think you could get enough texture addressing with FP16, so scratch that theory.</description>
		<content:encoded><![CDATA[<p>Hmm, come to think of it, I don&#8217;t think you could get enough texture addressing with FP16, so scratch that theory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pat Wilson</title>
		<link>http://aras-p.info/blog/2008/06/20/encoding-floats-to-rgba-again/comment-page-1/#comment-12251</link>
		<dc:creator>Pat Wilson</dc:creator>
		<pubDate>Tue, 24 Jun 2008 16:49:05 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=181#comment-12251</guid>
		<description>This looks like it&#039;s related to the internal float representation of the card. I&#039;m pulling numbers out of air, but I would guess that the early Radeons used FP16, x13-x19 used FP24, and HD series finally went to FP32. That would explain the large discrepancies between the early Radeons and the HD/GeForce/Intel cards.</description>
		<content:encoded><![CDATA[<p>This looks like it&#8217;s related to the internal float representation of the card. I&#8217;m pulling numbers out of air, but I would guess that the early Radeons used FP16, x13-x19 used FP24, and HD series finally went to FP32. That would explain the large discrepancies between the early Radeons and the HD/GeForce/Intel cards.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

