<?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: Implementing fixed function T&amp;L in vertex shaders</title>
	<atom:link href="http://aras-p.info/blog/2009/06/09/implementing-fixed-function-tl-in-vertex-shaders/feed/" rel="self" type="application/rss+xml" />
	<link>http://aras-p.info/blog/2009/06/09/implementing-fixed-function-tl-in-vertex-shaders/</link>
	<description>Random thoughts of a triangle pusher</description>
	<lastBuildDate>Fri, 10 Feb 2012 03:15:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Aras Pranckevičius</title>
		<link>http://aras-p.info/blog/2009/06/09/implementing-fixed-function-tl-in-vertex-shaders/comment-page-1/#comment-19434</link>
		<dc:creator>Aras Pranckevičius</dc:creator>
		<pubDate>Fri, 12 Jun 2009 03:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=364#comment-19434</guid>
		<description>@ryg: that&#039;s beyond awesome. Thanks for sharing!</description>
		<content:encoded><![CDATA[<p>@ryg: that&#8217;s beyond awesome. Thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabian "ryg" Giesen</title>
		<link>http://aras-p.info/blog/2009/06/09/implementing-fixed-function-tl-in-vertex-shaders/comment-page-1/#comment-19431</link>
		<dc:creator>Fabian "ryg" Giesen</dc:creator>
		<pubDate>Thu, 11 Jun 2009 21:46:40 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=364#comment-19431</guid>
		<description>Woops, just noticed: view the files with tab width 2 or they&#039;re screwed up (sorry, should&#039;ve cleaned this up before uploading).</description>
		<content:encoded><![CDATA[<p>Woops, just noticed: view the files with tab width 2 or they&#8217;re screwed up (sorry, should&#8217;ve cleaned this up before uploading).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabian "ryg" Giesen</title>
		<link>http://aras-p.info/blog/2009/06/09/implementing-fixed-function-tl-in-vertex-shaders/comment-page-1/#comment-19430</link>
		<dc:creator>Fabian "ryg" Giesen</dc:creator>
		<pubDate>Thu, 11 Jun 2009 21:45:29 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=364#comment-19430</guid>
		<description>Just for the sake of showing how a bytecode-based solution looks, I&#039;ve put the shader generator code that was used for debris (and also the never-materialized kkrieger final, and a couple of other things) online here: http://www.farbrausch.de/~fg/code/shadergen/. It&#039;s basically a custom shader assembler that supports (macro assembler level) flow control. Everything is stored as shader bytecode, with some new opcodes for the flow control instructions. This was mainly for size reasons; the only thing that is needed on the app side is shadercodegen.cpp, which is comperatively tiny (boiled down to about 880 bytes of code in the final executable), somewhat at the expense of readability. That&#039;s the part that also resolves flow control and register allocation, and even though it has some limitations you need to work around at the source level, I&#039;m still quite fond of it. :)

I&#039;ve also thrown in the sources for the &quot;ubershader&quot; used in kkrieger (long before that term was coined) and the tons-of-permutations multipass lighting stuff used in debris to show some examples. I certainly don&#039;t miss writing these, but still, merely having variable names with automatic register allocation made them an order of magnitude more useful than &quot;plain&quot; ASM shaders; the flow-control with automatic bitfields on everything (that&#039;s what the [16..19] after a variable name means, it&#039;s bits 16 through 19) is admittedly weird, but that allowed me to pass the material parameters to the shader compiler directly in the bitpacked format in which it was stored. Not very clean, but it got rid of a whole translation layer, which was lots of code. (This kind of fakery is precisely why I&#039;m sick of size-optimizing!)</description>
		<content:encoded><![CDATA[<p>Just for the sake of showing how a bytecode-based solution looks, I&#8217;ve put the shader generator code that was used for debris (and also the never-materialized kkrieger final, and a couple of other things) online here: <a href="http://www.farbrausch.de/~fg/code/shadergen/" rel="nofollow">http://www.farbrausch.de/~fg/code/shadergen/</a>. It&#8217;s basically a custom shader assembler that supports (macro assembler level) flow control. Everything is stored as shader bytecode, with some new opcodes for the flow control instructions. This was mainly for size reasons; the only thing that is needed on the app side is shadercodegen.cpp, which is comperatively tiny (boiled down to about 880 bytes of code in the final executable), somewhat at the expense of readability. That&#8217;s the part that also resolves flow control and register allocation, and even though it has some limitations you need to work around at the source level, I&#8217;m still quite fond of it. :)</p>
<p>I&#8217;ve also thrown in the sources for the &#8220;ubershader&#8221; used in kkrieger (long before that term was coined) and the tons-of-permutations multipass lighting stuff used in debris to show some examples. I certainly don&#8217;t miss writing these, but still, merely having variable names with automatic register allocation made them an order of magnitude more useful than &#8220;plain&#8221; ASM shaders; the flow-control with automatic bitfields on everything (that&#8217;s what the [16..19] after a variable name means, it&#8217;s bits 16 through 19) is admittedly weird, but that allowed me to pass the material parameters to the shader compiler directly in the bitpacked format in which it was stored. Not very clean, but it got rid of a whole translation layer, which was lots of code. (This kind of fakery is precisely why I&#8217;m sick of size-optimizing!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://aras-p.info/blog/2009/06/09/implementing-fixed-function-tl-in-vertex-shaders/comment-page-1/#comment-19414</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Tue, 09 Jun 2009 09:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/?p=364#comment-19414</guid>
		<description>Nice work! I think I would have done it as a Cg/HLSL fragment generator (and maybe cached compiled assembler in GL and bytecode in D3D), but that&#039;s because I&#039;ve totally gone off working with assembler these days (it&#039;s the age). Your way is clearly more hardcore :)</description>
		<content:encoded><![CDATA[<p>Nice work! I think I would have done it as a Cg/HLSL fragment generator (and maybe cached compiled assembler in GL and bytecode in D3D), but that&#8217;s because I&#8217;ve totally gone off working with assembler these days (it&#8217;s the age). Your way is clearly more hardcore :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

