I am trying to implement sha256 hashing algorithm with GLSL in WebGL and I have 3 questions:
In program info:
objectPropertieName: gl.getUniformLocation(shaderProgram, 'myArray')
In the shader:
uniform int myArray;
but it doesn’t work.
2.How to do bitwise operations? ( xor, and, not, shiftleft )
For an array, this:
void uniform1fv(WebGLUniformLocation? location, Float32List v);
Your array contains
ints so you should actually be using:
void uniform1iv(WebGLUniformLocation? location, Int32List v);
GLSL ES 2 (= WebGL 1) doesn’t support bitwise operations or shifts; the operators are defined but reserved. GLSL ES 2 is designed to be supported on GPUs which only provide floating-point arithmetic.
By having the shader render into a texture. Desktop OpenGL has other options (SSBOs, image load/store), but ES 2 shaders don’t have any outputs except the framebuffer.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.