Pulled the rain render out of the render bundle, I won't likely benefit from it.

Threw together renderToCanvas, which renders a texture to the canvas texture.
This commit is contained in:
Rezmason
2021-11-03 01:19:22 -07:00
parent 8f09fade43
commit 35afa7ca01
3 changed files with 86 additions and 25 deletions

View File

@@ -27,6 +27,12 @@ const loadTexture = async (device, url) => {
return texture;
};
const loadShaderModule = async (device, url) => {
const response = await fetch(url);
const code = await response.text();
return device.createShaderModule({ code });
};
const makeUniformBuffer = (device, structLayout, values = null) => {
const buffer = device.createBuffer({
size: structLayout.size,
@@ -40,4 +46,4 @@ const makeUniformBuffer = (device, structLayout, values = null) => {
return buffer;
};
export { getCanvasSize, loadTexture, makeUniformBuffer };
export { getCanvasSize, loadTexture, loadShaderModule, makeUniformBuffer };