Commit Graph

63 Commits

Author SHA1 Message Date
Rezmason
e27c1820cb Figuring out what's wrong in FF Nightly 2021-12-05 19:30:49 -08:00
Rezmason
b540ef4620 Explicitly using rgba8unorm format for rain pass render targets 2021-11-17 18:27:10 -08:00
Rezmason
3e6196a964 A merge into master revealed some problems with the way ES modules are imported. This will require some investigation. 2021-11-15 01:35:05 -08:00
Rezmason
b26155d20e Adding some more comments. Destructuring the context object in the pass modules. A little code cleanup in bloomPass. Changing the endPass sampler to be cheaper. 2021-11-15 01:05:05 -08:00
Rezmason
1b61e304a5 Refactoring the pass and pipeline, so that inputs and size are handed to and returned from the build function (formerly setSize). This is now the earliest place to build bind groups, which makes sense, because it's also the earliest place to create textures that are proportional to the size of the canvas. 2021-11-15 00:30:09 -08:00
Rezmason
b0a4acdfdb Rewrote the WebGPU bloom pass based on the classic Unreal solution of blurring and combining the levels of an image pyramid. Fixed the regl bloom pass to use the downscaled blurred mipmap levels to build the first pyramid. 2021-11-14 23:09:29 -08:00
Rezmason
7eecace634 My friend recommended a much simpler blur that doesn't build any image pyramids. Unfortunately my work towards an implementation isn't very promising— it doesn't pack the same wollop as the WebGL version— but I can built my pyramids on top of it. 2021-11-13 21:25:27 -08:00
Rezmason
910d29e175 Poking gpu-buffer a bit because I'm apparently afraid of writing a blur shader which I've already written once. 2021-11-11 23:30:37 -08:00
Rezmason
db928bbe7a All the post processing passes are now based on compute pipelines instead of render pipelines. 2021-11-11 21:50:27 -08:00
Rezmason
9c861fd50b Replacing the final copyToTexture call with a tiny render pass, so that the postprocessing passes can be compute shaders working off of storage textures instead. 2021-11-11 08:24:30 -08:00
Rezmason
dc4032e42a A little reorganization of methods in the passes. 2021-11-10 18:10:26 -08:00
Rezmason
a143e3fc03 Renamed gpu-uniforms to gpu-buffer, and messed around with its API.
I believe all the align, size, stride and byteOffset values are now in the proper units, ie. bytes.
2021-11-08 22:56:00 -08:00
Rezmason
6ab16b3091 Trying to implement the spec for the alignment and size of struct and array fields in gpu-uniforms. 2021-11-08 08:58:55 -08:00
Rezmason
1528ca39a5 Commenting out the tables and adding select to some shaders in place of the original ternary operator. 2021-11-08 03:45:06 -08:00
Rezmason
415ffa77ee Driving more uniforms.read calls from the actual shaders. 2021-11-08 03:01:46 -08:00
Rezmason
61a3a6d783 Moved the WebGPU code off of "std140" and onto gpu-uniforms. 2021-11-08 02:23:33 -08:00
Rezmason
bd3d0c76d2 Fixing the names of shaders in the passes. The loadShader utility function now returns the code and the module, since I'm hoping to parse uniform buffer layouts from the code. 2021-11-07 00:41:25 -07:00
Rezmason
bade1667ad Making some comments in the WebGPU rainPass and changing the "effect=none" view to be easier on the eyes. 2021-11-06 15:19:56 -07:00
Rezmason
89b9f4e363 Ported all the post processing regl passes to WebGPU. Fixed the CORS stuff in loadTexture. Renamed createRenderTargetTexture to makePassFBO, to conform with the regl project. Added make1DTexture, which stripePass uses. 2021-11-06 05:03:16 -07:00
Rezmason
230847e5b8 Added runtime texture targets. A pass now returns its resources in getOutputs(), which subsequent passes access as getInputs(). 2021-11-05 01:06:39 -07:00
Rezmason
f8959cd7d9 Renaming msdfSampler to linearSampler; adding loadShaderModule utility method; busting the rain render out of its render bundle (which won't be useful long-term). 2021-11-03 20:01:59 -07:00
Rezmason
8f09fade43 Contemplating my next steps. 2021-11-02 23:20:54 -07:00
Rezmason
348b07d237 Actually the ping-pong setup isn't necessary for this compute shader, since it does everything in-place.
Undid all the y-flips I could find, and they all canceled one another out, except for the glyph UVs in the fragment shader.
2021-11-01 08:38:48 -07:00
Rezmason
6460f4401a Ported the rain compute shader to wgsl. Tons of inverted-y errors abound. 2021-11-01 01:52:57 -07:00
Rezmason
1c1b1e4f03 We have ping-pong! And all the rain pass's shaders can coexist in one module! And I met and received ample help from @kainino0x and others on the WebGPU Matrix chat! 2021-11-01 00:29:16 -07:00
Rezmason
6f58882851 The MSDF stuff shouldn't be in its own uniform buffer. This is basically config stuff.
Added a compute pass that currently does nothing while I learn how to make use of it.
2021-10-31 20:00:11 -07:00
Rezmason
375560d6a1 Fixed a math issue in the symbol UV function. 2021-10-30 20:30:55 -07:00
Rezmason
4ea6cadd2f Fixing some y-flip related stuff in the rain pass fragment shader. Consolidating and changing the type of a bunch of info in the config uniform. Improving the code comments. 2021-10-30 20:05:07 -07:00
Rezmason
d8701c9408 Ported the rain vertex shader to wgsl. 2021-10-30 18:07:07 -07:00
Rezmason
cc75938fcb Passing all the rain pass configs through a giant struct into the rain shader. I've included the compute shader fields, because I have hope that the compute pass can use the same shader module. 2021-10-30 13:48:28 -07:00
Rezmason
33437a722d Finding ways to construct WebGPU descriptors more concisely. Moving some functions to webgpu's utils.js. 2021-10-30 08:40:42 -07:00
Rezmason
0c26cc7660 Moving assets into a subdirectory. 2021-10-29 12:21:40 -07:00
Rezmason
fb6406e753 The texture sampler should operate linearly 2021-10-29 09:16:28 -07:00
Rezmason
f9b80224fe More std140 tweaks 2021-10-29 08:57:23 -07:00
Rezmason
e79e741fcf Fixed a struct layout bug. Struct layout and builder now support mixing integer and float data in a struct, and output an ArrayBuffer. 2021-10-29 07:43:39 -07:00
Rezmason
81f77c70ae Slowly working out what's required to support uniform buffers that store integers as well as floats 2021-10-29 00:38:58 -07:00
Rezmason
c3254c3aa1 Adding WebGPU to TODO.md. Annotating the parts of the WebGPU code that involve uniform buffer layout issues. 2021-10-27 22:34:47 -07:00
Rezmason
48a6f2cf34 Fixing a typo and adding looping functionality to the TODO list 2021-10-27 19:03:38 -07:00
Rezmason
cf5f8c2113 Simplifying rainPass.compute's weirder operations. 2021-10-23 01:12:31 -07:00
Rezmason
1a97861fed Resurrections version now vertically spaces the glyphs (groan). 2021-10-22 22:57:14 -07:00
Rezmason
6d8f5ba41a Overhauled the rainPass's support for the "operator" version of the effect. It now overrides the brightness of any glyph brighter than a threshold, which I think is a much clearer concept.
Also changed the way the glyphs cycle in the "operator" version, after noticing they only change once every four or five frames in the original effect.
2021-10-22 08:38:37 -07:00
Rezmason
7569246b5b Renaming rainPass shaders, and updating TODO. 2021-10-22 00:48:49 -07:00
Rezmason
d285697640 Documenting the passes and config variables. 2021-10-20 21:50:01 -07:00
Rezmason
4c6ff879fd Added some documentation, cleaned up some code, fleshed out the remaining work to make the project a little easier for newcomers to approach 2021-10-20 21:01:32 -07:00
Rezmason
f17281ab4d Adding notes to support some recent variations on the Matrix code rain seen in Matrix Resurrection promotional material. 2021-09-19 21:51:42 -07:00
Rezmason
f2b29d45e0 Experimenting with a more expensive bloom. 2020-06-26 12:46:28 -07:00
Rezmason
021ade45e1 Passes now accept as input and provide as output Objects with FBOs as values. This allows passes to work with more than one input texture. 2020-06-26 12:46:28 -07:00
Rezmason
f065b32fe3 Improved the classic palette. 2020-06-26 12:46:18 -07:00
Rezmason
a48b8dffbe Cleaned up config by moving its responsibilities into the passes 2020-01-26 13:53:19 -08:00
Rezmason
99ef8bbf0a Separated color passes into separate modules.
Moved main JS into its own module.
Main module now builds passes into a pipeline, based on the value of config.effect.
The passes no longer make stubs when they're not meant to be active.
Asset loading has been moved into the passes, which resolve their ready promise when they've finished loading.
2020-01-25 23:05:54 -08:00