WebGL is shader based. In my shaders I can write code like
int a = 1;
int b = 2;
int c = a + b;
Is there a way to extract the value of c from shader-land to JavaScript-land?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The output of a WebGL drawing pass is writes to the render target color buffer. You will need to study up on GPGPU programming with OpenGL and WebGL specifically. See this blog post for a discussion on doing GPGPU with WebGL:
https://mchouza.wordpress.com/2011/02/21/gpgpu-with-webgl-solving-laplaces-equation/