mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-16 21:39:29 -07:00
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.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import std140 from "./std140.js";
|
||||
import { loadTexture, loadShaderModule, makeUniformBuffer, makePassFBO, makePass } from "./utils.js";
|
||||
import { loadTexture, loadShader, makeUniformBuffer, makePassFBO, makePass } from "./utils.js";
|
||||
|
||||
// Multiplies the rendered rain and bloom by a loaded in image
|
||||
|
||||
@@ -35,20 +35,20 @@ export default (context, getInputs) => {
|
||||
let backgroundTex;
|
||||
|
||||
const bgURL = "bgURL" in config ? config.bgURL : defaultBGURL;
|
||||
const assets = [loadTexture(device, bgURL), loadShaderModule(device, "shaders/wgsl/imagePass.wgsl")];
|
||||
const assets = [loadTexture(device, bgURL), loadShader(device, "shaders/wgsl/imagePass.wgsl")];
|
||||
|
||||
const ready = (async () => {
|
||||
const [bgTex, rainShader] = await Promise.all(assets);
|
||||
const [bgTex, imageShader] = await Promise.all(assets);
|
||||
|
||||
backgroundTex = bgTex;
|
||||
|
||||
renderPipeline = device.createRenderPipeline({
|
||||
vertex: {
|
||||
module: rainShader,
|
||||
module: imageShader.module,
|
||||
entryPoint: "vertMain",
|
||||
},
|
||||
fragment: {
|
||||
module: rainShader,
|
||||
module: imageShader.module,
|
||||
entryPoint: "fragMain",
|
||||
targets: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user