mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-17 22:09:28 -07:00
Slowly working out what's required to support uniform buffers that store integers as well as floats
This commit is contained in:
10
TODO.txt
10
TODO.txt
@@ -1,7 +1,15 @@
|
|||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
WebGPU
|
WebGPU
|
||||||
std140 problem with uniform buffers
|
std140
|
||||||
|
Right now, buildStruct packs an array, which is changed to a typedarray and fed to a GPUBuffer
|
||||||
|
That limits the type to whatever the typedarray is
|
||||||
|
Instead, we need to represent the type of each value, and write it as such
|
||||||
|
Create an array buffer
|
||||||
|
Create a Float32Array view into it, and an Int32Array view
|
||||||
|
Transcribe the values into these views
|
||||||
|
Return the array buffer
|
||||||
|
|
||||||
|
|
||||||
Write an explanation of the rain pass (and include images)
|
Write an explanation of the rain pass (and include images)
|
||||||
Compute
|
Compute
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ export default (regl, config) => {
|
|||||||
const screenSize = [1, 1];
|
const screenSize = [1, 1];
|
||||||
const { mat4, vec3 } = glMatrix;
|
const { mat4, vec3 } = glMatrix;
|
||||||
const camera = mat4.create();
|
const camera = mat4.create();
|
||||||
const translation = vec3.set(vec3.create(), 0, 0.5 / numRows, -1);
|
const translation = vec3.set(vec3.create(), 0, 0, -1);
|
||||||
const scale = vec3.set(vec3.create(), 1, 1, 1);
|
const scale = vec3.set(vec3.create(), 1, 1, 1);
|
||||||
const transform = mat4.create();
|
const transform = mat4.create();
|
||||||
mat4.translate(transform, transform, translation);
|
mat4.translate(transform, transform, translation);
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ export default async (canvas, config) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const camera = mat4.create();
|
const camera = mat4.create();
|
||||||
const translation = vec3.set(vec3.create(), 0, 0.5 / numRows, -1);
|
const translation = vec3.set(vec3.create(), 0, 0, -1);
|
||||||
const scale = vec3.set(vec3.create(), 1, 1, 1);
|
const scale = vec3.set(vec3.create(), 1, 1, 1);
|
||||||
const transform = mat4.create();
|
const transform = mat4.create();
|
||||||
mat4.translate(transform, transform, translation);
|
mat4.translate(transform, transform, translation);
|
||||||
|
|||||||
@@ -58,14 +58,12 @@ struct VertexOutput {
|
|||||||
f32(config.numRows)
|
f32(config.numRows)
|
||||||
);
|
);
|
||||||
position = 1.0 - position * 2.0;
|
position = 1.0 - position * 2.0;
|
||||||
position = position * scene.screenSize;
|
// position = position * scene.screenSize;
|
||||||
|
|
||||||
var depth:f32 = 0.0;
|
var depth:f32 = 0.0;
|
||||||
|
|
||||||
var pos: vec4<f32> = vec4<f32>(position, depth, 1.0);
|
var pos: vec4<f32> = vec4<f32>(position, depth, 1.0);
|
||||||
|
|
||||||
// pos.x = pos.x / glyphHeightToWidth;
|
// pos.x = pos.x / glyphHeightToWidth;
|
||||||
// pos = scene.camera * scene.transform * pos;
|
pos = scene.camera * scene.transform * pos;
|
||||||
|
|
||||||
return VertexOutput(
|
return VertexOutput(
|
||||||
pos,
|
pos,
|
||||||
|
|||||||
Reference in New Issue
Block a user