<story><title>How video games use lookup tables</title><url>https://blog.frost.kiwi/WebGL-LUTS-made-simple/</url></story><parent_chain></parent_chain><comment><author>zeta0134</author><text>Lookup tables are the only reason I was able to get this effect working at all:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;zeta0134&amp;#x2F;status&amp;#x2F;1756988843851383181&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;zeta0134&amp;#x2F;status&amp;#x2F;1756988843851383181&lt;/a&gt;&lt;p&gt;The clever bit is that it&amp;#x27;s two lookup tables here: the big one stores the lighting details for a circle with a configurable radius around the player (that&amp;#x27;s one full lookup table per radius), but the second one is a pseudo-random ordering for the background rows. I only have time to actually update 1&amp;#x2F;20th of the screen each time the torchlight routine is called, but by randomizing the order a little bit, I can give it a sortof &amp;quot;soft edge&amp;quot; and hide the raster scan that you&amp;#x27;d otherwise see. I use a table because the random order is a grab bag (to ensure rows aren&amp;#x27;t starved of updates) and that bit is too slow to calculate in realtime.</text></comment>
<story><title>How video games use lookup tables</title><url>https://blog.frost.kiwi/WebGL-LUTS-made-simple/</url></story><parent_chain></parent_chain><comment><author>bemmu</author><text>The first look-up table effect that really impressed me was to use them for making a textured tunnel.&lt;p&gt;You have a look-up table such that for each pixel on the screen, you know its angle and distance from the center of the screen. With this you can pick which texel to put at each pixel location.&lt;p&gt;It looks as if you are moving in a tunnel with 3D geometry, but it&amp;#x27;s so cheap you can even do it on pico: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.lexaloffle.com&amp;#x2F;bbs&amp;#x2F;?pid=63818&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.lexaloffle.com&amp;#x2F;bbs&amp;#x2F;?pid=63818&lt;/a&gt;&lt;p&gt;At first I thought the game Stardust must have used this effect, but reading up on it just now they actually just play a repeating 6 frame animation for the background! &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;codetapper.com&amp;#x2F;amiga&amp;#x2F;sprite-tricks&amp;#x2F;stardust&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;codetapper.com&amp;#x2F;amiga&amp;#x2F;sprite-tricks&amp;#x2F;stardust&amp;#x2F;&lt;/a&gt;</text></comment>