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.

This commit is contained in:
Rezmason
2021-10-30 12:53:26 -07:00
parent 1516f82554
commit cc75938fcb
4 changed files with 168 additions and 55 deletions

View File

@@ -68,7 +68,7 @@ const buildStruct = (fields, values, buffer) => {
for (let i = 0; i < values.length; i++) {
const view = views[fields[i].baseType];
const value = values[i];
const array = value[Symbol.iterator] == null ? [value] : value;
const array = value[Symbol.iterator] == null ? [Number(value)] : value;
view.set(array, fields[i].byteOffset);
}
return buffer;