TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

15 Years of Shader Minification

144 点作者 laurentlb5 天前

8 条评论

laurentlb2 天前
I wrote this article mainly for the people in the demoscene. If anything is unclear or missing for the Hackernews audience, I&#x27;m happy to answer questions here.<p>If anyone wants to try it, I&#x27;ve made a web build: <a href="https:&#x2F;&#x2F;ctrl-alt-test.fr&#x2F;minifier&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ctrl-alt-test.fr&#x2F;minifier&#x2F;</a><p>I might write a more general article later on writing code minifiers, e.g. how it compares to writing a code formatter, how to implement the transformations, etc.<p>On the tech side, the code is written in F#. The web build uses Bolero (Blazor for F#). So maybe I&#x27;ll write later about my experience writing an open source project with F# and evolving it.
评论 #43971444 未加载
monokai_nl2 天前
Thank you for making this tool. I&#x27;m calling it in a custom webpack plugin so it transforms GLSL code into a single minified string on every build &#x2F; watch event. I used this setup for my latest artwork: <a href="https:&#x2F;&#x2F;monokai.com&#x2F;work&#x2F;origin" rel="nofollow">https:&#x2F;&#x2F;monokai.com&#x2F;work&#x2F;origin</a>
pjmlp2 天前
The pain of GL shaders, only because they don&#x27;t embrace modern programming like modules and bytecode delivery.<p>That is how one ends up with shader minification.<p>And this is still quite actual as pain point, given how shaders work in 3D Web APIs.
评论 #43970449 未加载
sagacity2 天前
This is an awesome tool, thanks Laurent! Currently using it for my next 64k intro which will probably ship sometime in 2047 :)
slimbuck2 天前
Have you tested the shader&#x27;s runtime performance penalty after minification?<p>Also wondering how you handle named uniforms?
评论 #43970531 未加载
评论 #43970504 未加载
zombot2 天前
&gt;<p><pre><code> #define R return </code></pre> OK, that was not what I thought of when reading &quot;shader minification&quot;.
评论 #43969923 未加载
评论 #43970165 未加载
akomtu2 天前
With recursive #defines it would be possible to do LZW compression.
评论 #43970358 未加载
gitroom2 天前
Man, 15 years grinding on this is hardcore - big respect, love this kinda craft.
评论 #43971328 未加载