You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, i try to create a custom shader and a custom primitivestream, what i want is to add attributes and to modify size of POSITION, to be a vector2,
the problem is simply modifying the size of POSITION, it render the wrong ammount of triangles, attributes seems messed up,
steps:
in a clone of pbr.js file, i modified the vertex shader for the position to be vec2,
in a clone of primitivestream.js, i modified the primitive to not push the z value in pushVertex method, and i did modify attributes definition like so:
let attribs = [
new PrimitiveAttribute('POSITION', vertexBuffer, 2, GL.FLOAT, 32, 0),
new PrimitiveAttribute('TEXCOORD_0', vertexBuffer, 2, GL.FLOAT, 32, 8),
new PrimitiveAttribute('SCALE', vertexBuffer, 1, GL.FLOAT, 32, 16),
];
but it fails to render all the triangles i want to render, and i looked almost everywhere but i dont find why it doesnt work
and how to fix it, do you have any clue?
Also, do you think simply adding custom attributes here and in the shader will work? Or how to do it correctly?
The text was updated successfully, but these errors were encountered:
Hey, i try to create a custom shader and a custom primitivestream, what i want is to add attributes and to modify size of POSITION, to be a vector2,
the problem is simply modifying the size of POSITION, it render the wrong ammount of triangles, attributes seems messed up,
steps:
let attribs = [
new PrimitiveAttribute('POSITION', vertexBuffer, 2, GL.FLOAT, 32, 0),
new PrimitiveAttribute('TEXCOORD_0', vertexBuffer, 2, GL.FLOAT, 32, 8),
new PrimitiveAttribute('SCALE', vertexBuffer, 1, GL.FLOAT, 32, 16),
];
but it fails to render all the triangles i want to render, and i looked almost everywhere but i dont find why it doesnt work
and how to fix it, do you have any clue?
Also, do you think simply adding custom attributes here and in the shader will work? Or how to do it correctly?
The text was updated successfully, but these errors were encountered: