-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for WebGL2 #114
Comments
Another use case for more structured shader code is similarity to shader graph nodes module.exports = (node, graph) => {
const vec3In = node.in("vec3", [1, 1, 1, 1]);
const xOut = node.out("x", 1);
const yOut = node.out("y", 1);
const zOut = node.out("z", 1);
node.sg = {
ins: {
vec3: { type: "vec3", port: vec3In },
},
outs: {
x: { type: "float", port: xOut },
y: { type: "float", port: yOut },
z: { type: "float", port: zOut },
},
code: (sg) => `
${sg.outs.x.type} ${sg.outs.x.var} = ${sg.ins.vec3.var}.x;
${sg.outs.y.type} ${sg.outs.y.var} = ${sg.ins.vec3.var}.y;
${sg.outs.z.type} ${sg.outs.z.var} = ${sg.ins.vec3.var}.z;
`,
};
}; |
It looks like BabylonJS doesn't care about this kind of issues and have most shaders still in GLSL100 with some in GLSL300. |
Another thing to consider is not only how you create the source code but also how you provide all those attributes and uniforms (buffers). In WebGL you have attributes and uniforms |
- [x] convert require to import and module.exports to exports - [x] docs: convert example to esm - [x] docs: fix examples - [x] docs: aggregate instancing/batching/shadows example - [x] fix: handle buffer.length for ArrayBuffer - [x] fix: debug not working in esm - [x] fix(webgl2): use gl.MAX_COLOR_ATTACHMENTS instead of "MAX_COLOR_ATTACHMENTS" - [x] fix(webgl2): handle EXT_disjoint_timer_query_webgl2 - [x] feat: add width/height getters - [x] feat: set type to webgl2 #114 Closes #66 Closes #38 BREAKING CHANGE: switch to type module
To make this transition manageable i propose following steps
The questions is why would we need that?
The text was updated successfully, but these errors were encountered: