TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Three.js Shading Language

160 pointsby bpierre12 months ago

9 comments

lifthrasiir12 months ago
TSL is not really a language to be pedantic, because it is an EDSL to build a common AST that can be translated to the target shader language later. All caveats for the overly eager evaluation and usual impedance mismatch between JS and TSL data model also apply here.
评论 #40516055 未加载
bhouston12 months ago
I&#x27;ve seen this done in C++ for generating GLSL before a few times.<p>One from Waterloo Univeesity in the early 2000s became RapidMind: <a href="http:&#x2F;&#x2F;web.cs.ucla.edu&#x2F;~palsberg&#x2F;course&#x2F;cs239&#x2F;papers&#x2F;rapidmind.pdf" rel="nofollow">http:&#x2F;&#x2F;web.cs.ucla.edu&#x2F;~palsberg&#x2F;course&#x2F;cs239&#x2F;papers&#x2F;rapidmi...</a><p>There were a few others, but I can not remember their names.<p>Generally these techniques work, but for some reason they tend to die out.
评论 #40518291 未加载
评论 #40520922 未加载
评论 #40518631 未加载
stevebmark12 months ago
Looks interesting! There is always a tension between high level paradigms like this and just writing the damn GLSL. glslify is another solution in this space that lets you have more fine control over the GLSL, which is usually way less verbose than a high level API.
评论 #40518907 未加载
stanleykm12 months ago
Almost like the old days of fixed function pipelines. The example at the top seems a little contrived, I wonder why you would build a shader like that.
评论 #40512810 未加载
评论 #40517657 未加载
评论 #40512399 未加载
pjmlp12 months ago
This is what happens when everyone decides to break compatibility with the shading languages for the Web, instead of what happened with Khronos APIs on the native side.<p>On the other side, it is business as usual given GLSL, HLSL, MSL, Slang, PSSL,...
评论 #40516570 未加载
CountHackulus12 months ago
What if we stopped adding layers of abstraction? The idea of renderer-agnostic shaders is cool, but in general you want to write your shaders for a specific renderer for best performance.
评论 #40516707 未加载
评论 #40514913 未加载
评论 #40521022 未加载
10000truths12 months ago
One thing I&#x27;d love to see is whether bundlers can &quot;statically compile&quot; the TSL nodes via constant propagation into a single template literal.
评论 #40518900 未加载
jasonjmcghee12 months ago
Has anyone taken a crack at building a shading language debugger?<p>I want to be able to step through a shader and see the values at each step (ideally for any &#x2F; every pixel)<p>The best case scenario would be while it&#x27;s actually running, but simulating it seems like a great solution too.<p>These are the best I could find: <a href="https:&#x2F;&#x2F;github.com&#x2F;burg&#x2F;glsl-simulator">https:&#x2F;&#x2F;github.com&#x2F;burg&#x2F;glsl-simulator</a> and <a href="https:&#x2F;&#x2F;github.com&#x2F;cdave1&#x2F;shdr">https:&#x2F;&#x2F;github.com&#x2F;cdave1&#x2F;shdr</a> - both seem to be missing a fair amount of features, though shdr seems like much better support.<p>There&#x27;s also: <a href="https:&#x2F;&#x2F;glsl-debugger.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;glsl-debugger.github.io&#x2F;</a> but it doesn&#x27;t support OS X and feels quite out of date.<p>There&#x27;s &quot;print statements&quot; for wgsl: <a href="https:&#x2F;&#x2F;github.com&#x2F;looran&#x2F;wgsl-debug">https:&#x2F;&#x2F;github.com&#x2F;looran&#x2F;wgsl-debug</a><p>I guess WGSL is the up and comer... as opposed to GLSL - but both would be great.<p>Anyone else have this hope&#x2F;dream?<p>The hacks I use today are crazy - like conditionally exiting early based on a time variable and mapping values to colors.<p>So many folks I talk to are like, &quot;yeah that&#x27;s how it is&quot;. But this just seems not good enough to me...
评论 #40515875 未加载
评论 #40517241 未加载
评论 #40520703 未加载
评论 #40517182 未加载
评论 #40520687 未加载
评论 #40521077 未加载
kitaedesigns12 months ago
My first thoughts as a technical artist is that TSL should be abstracted to a VPL like most shader artists are used to whether it&#x27;s the nodes in Unreal, Blender, Vray etc. They&#x27;re already starting with three.js playground, but this would allow any traditional shader artists in gamedev or really any industry related to 3D to create really awesome shaders using the same exact workflow they&#x27;re used to on other apps.