This was a very well structured into to GLSL. Can anyone comment on what it would be like in Vulkan or WebGPU/WebGL?
Pretty much the same. Both Vulkan and WebGL can use GLSL directly (well, GLSL -> SPIR-V for Vulkan). WebGPU technically can't if you run it in a browser, but native WebGPU implementations can take GLSL, you can transpile, and finally you could just write WGSL as it's basically the same as GLSL, just with more Rust-inspired syntax rather than C-inspired.
Programming SDF animations of Rick and Morty
31–40 of 42 posts
Re: Programming SDF animations of Rick and Morty
#32Re: Programming SDF animations of Rick and Morty
#33Earlier quoted context omitted.
Pretty much the same. Both Vulkan and WebGL can use GLSL directly (well, GLSL -> SPIR-V for Vulkan). WebGPU technically can't if you run it in a browser, but native WebGPU implementations can take GLSL, you can transpile, and finally you could just write WGSL as it's basically the same as GLSL, just with more Rust-inspired syntax rather than C-inspired.
Technically WebGPU and Metal support GLSL exactly as Vulkan supports it. You transpile. there is no difference except maybe you're used to that step with Vulkan and not with the others
Vulkan you're doing GLSL -> SPIR-V
WebGPU you're doing GLSL -> WGSL -> (HLSL->DXIL) / (MSL->IR) / SPIR-V / GLSL (for the compact backend)
Then the driver takes GLSL/DXIL/Metal IR/SPIR-V/etc and produces it's own bytecode. Different copies of LLVM are involved a few different times in different places. It's a complex and frankly fairly crappy pipeline.
Re: Programming SDF animations of Rick and Morty
#34Re: Programming SDF animations of Rick and Morty
#35This is awesome. Shader devs are next level; it’s a type of tight, repetitive iteration which is super different from the webby, protocoly, applicationy development that many of us are used to. There’s something really satisfying about changing a float, pressing shift-enter, and then immediately seeing a result. Well done!
Is working with the javascript canvas or abstractions on it like p5.js similar to what you're describing? Im not sure if you're talking about graphics programming (some familiarity with) or more specifically working with GPU shaders (no familiarity).
Re: Programming SDF animations of Rick and Morty
#36Animations don't render in Edge, but Chrome (and surprisingly Safari!) work.
Re: Programming SDF animations of Rick and Morty
#37Gives you the ability to make some cool looking effects like fresnel without post-processing filters
Re: Programming SDF animations of Rick and Morty
#38This is awesome. Shader devs are next level; it’s a type of tight, repetitive iteration which is super different from the webby, protocoly, applicationy development that many of us are used to. There’s something really satisfying about changing a float, pressing shift-enter, and then immediately seeing a result. Well done!
> Shader devs are next level; it’s a type of tight, repetitive iteration which is super different from the webby, protocoly, applicationy development that many of us are used to. There’s something really satisfying about changing a float, pressing shift-enter, and then immediately seeing a result. Is working with the javascript canvas or abstractions on it like p5.js similar to what you're describing? Im not sure if…
Re: Programming SDF animations of Rick and Morty
#39Wow, 8 months to achieve this animation reflects a sheer amount of perseverance.