-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
Support webgl2 and GLSL 3.00 #13692
Support webgl2 and GLSL 3.00 #13692
Conversation
Do you wanna join the discussion here? #12250 |
And #9965 is for WebGL2.0. |
Rather than adding ifdefs macros everywhere... I would, instead, change the relevant Then I would add a Seems like sooner or later we would need this anyway. |
Great! When I started, I was not sure if all of those changes can be done mechanically. In the end, it was the case (I think). By following some code in WebGLProgram.js, it may not be too hard to provide the source to source translation (without really parsing the GLSL code.) |
That's what I hope! |
I just would like to check with you on the style of my JS, and how much assumptions I can have on the GLSL code. Basically my convertToGLSL1() would look like: https://gist.github.com/yoshikiohshima/7083198c6eb7efdc82627de11e351f72 On my computer, it seems to be working. (The function is kind of long, but not too long.) One thing I wonder about is that a use of glFragColor such as:
can't go multiple lines. So far I don't see a case like that so it maybe okay but somehow it'd have to be understood. If this is good enough, I'll double check things (hopefully tomorrow) and make another pull request. |
Superceded by #13701. |
Another attempt to support WebGL2RenderingContext and GLSL 3.00.
(For our project, we have a GPGPU framework that uses GLSL3.00 features such as texelFetch and new buffer types such as R32F. This patch allows integrating the framework with Three.js. It's been working well for our purpose, and hopefully it is useful for others who are trying a similar stuff.)