Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
How Can I Get Result of Math Operation in WebGL Shader

There is a slow math operation. I don't want to do this by using javascript, I want to do in WebGL Shaders, but I need to get the value result of this operation.

        var VertexShaderCode = `
        precision lowp float;
        uniform float value;
        float result;
        void main(void) {
            result = ........ // math operation
            // return result
            gl_Position = vec4(0, 0, 0, 1);
        }
        `

        var vertexShader = gl.createShader(gl.VERTEX_SHADER)
        gl.shaderSource(vertexShader, VertexShaderCode)
        gl.compileShader(vertexShader)

        var FragmentShaderCode = `precision lowp float;
        void main() {
                gl_FragColor= vec4(0);
        }`

        var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER)
        gl.shaderSource(fragmentShader, FragmentShaderCode)
        gl.compileShader(fragmentShader)
        var shaderProgram = gl.createProgram()
        gl.attachShader(shaderProgram, vertexShader)
        gl.attachShader(shaderProgram, fragmentShader)
        gl.linkProgram(shaderProgram)
        return shaderProgram

How can I do this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!