Replies: 10 comments
-
|
WebGPU is about to go live in March I think? |
Beta Was this translation helpful? Give feedback.
-
|
Okay, I just read through the spec for WGSL. It feels a bit rough and
unfinished for a March release, and I still find errors in it, but hey,
this is W3C, and I've seen worse. The syntax reads like a throwback to me,
with elements of disassembly, flashes of Fortran loops, a lack of
overloading for user defined functions, finicky greedy parsing that will
have me swearing when I forget space-after-colon, a modulo operator that is
actually a remainder operator, and a few weird details that will take some
getting used to, but it looks human-writable, and I could probably port the
two psrdnoise functions myself.
If I decide to try it, what do I use for testing?
|
Beta Was this translation helpful? Give feedback.
-
|
Install chrome canary per this article ... |
Beta Was this translation helpful? Give feedback.
-
|
Hmm. I can't find any concrete code examples not using Node or Rust. Is
there any basic JS-only template for just pushing a full viewport quad in
view coords and render pixels to a canvas with a pair of WGSL vertex and
fragment shaders? WGSL seems easy enough, but Node and Rust are barriers I
don't have the option to work my way through right now.
Den fre 25 feb. 2022 23:14John Davis ***@***.***> skrev:
… Install chrome canary per this article ...
https://web.dev/gpu-compute/
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFGK2WISNB3HGXSKFMHNUTU475KRANCNFSM5PKIBVGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
https://github.com/austinEng/webgpu-samples Does this work? |
Beta Was this translation helpful? Give feedback.
-
|
Meh. Node. Thanks for looking, though.
I found a vanilla JS version just now. It's from a few years ago and
required some updates and tweaks, and a change from GLSL to WGSL, but
Chrome gave reasonably informative deprecation messages, and I now have a
basic WGSL shader running from plain JS.
The port is underway, but it won't be done in a jiffy. WGSL is about as
awkward to use as SPIR-V assembly language. Which is natural, of course,
since that is what it's supposed to map to in a bijective and "trivial"
fashion.
I'll post an update when/if anything works out. Right now I'm just
rendering a grid of dots, but at least it's the 2D simplex grid.
|
Beta Was this translation helpful? Give feedback.
-
|
An incomplete WGSL port of the 2D noise is in the src/ folder. No derivatives yet. |
Beta Was this translation helpful? Give feedback.
-
|
Port of 3D noise added, still without the derivatives. This will have to do for today. Hopefully I can find the time to do the gradient-computing versions soon. It's really just a matter of deciding on the field names for the return struct, but names are important. [n, g] or [noise, gradient]? I will sleep on that. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @stegu ! |
Beta Was this translation helpful? Give feedback.
-
|
You're welcome! I enjoyed it, and I needed a reason to learn WGSL.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Has anyone ported to wgsl yet?
Beta Was this translation helpful? Give feedback.
All reactions