170 points · by felipellrocha · 11y ago · 50 comments
Also, I've come into many situations where webgl doesn't work in some particular situations, would it be a a combination of OS, webgl driver support or web browser.
I guess it should work and will as time passes, but as long as there is nothing else than javascript, I won't bother.
Just one example: http://twgljs.org
JavaScript, for all its flaws, is far less painful to use than C for this.
One thing that I think is missing is having a code description of how things work. If you can present shaders as for loops over the input vertices or pixels, it might be more clear than just a bunch of diagrams. I had to write my own rasterizer in order to get a decent idea of how it worked.
Another that might be missing is the state possessed by OpenGL. The linked guide calls it a state machine but there's no state machine diagram or anything. Just having a list of the most common OpenGL state and a way to print it all out might be nice. I've had a lot of bugs (like not setting glViewport or having the wrong GL_RENDERBUFFER bound) that would probably be easier if I could see the current OpenGL state or even know that GL_RENDERBUFFER wasn't changed by GL_FRAMEBUFFER.
* Live editing tutorials with the code directly embedded [0]
* Hot-reloadable WebGL code [1]
* Hot-reloadable WebGL code in multiple browsers [2]
* Inspector tools that are able to detect common errors and explain them [3]
The live-editing aspects really helps recover from black-screen-syndrome much faster, and keeps the experience from being more overwhelming than it has to be.Unfortunately, almost everything that's written for WebGL on the web right now is actually written for Three.js. Three.js is great, but it does make it a bit frustrating trying to understand the basic WebGL state/code underneath when first learning.
I'm up to 32 lessons so far (e.g. textures, specular maps, camera, WebSockets, WebRTC/udp), and definitely hoping to be able to explore more and more holistic topics. If anyone has suggestions for topics they'd like to see covered, happy to take a look!
[0] https://www.youtube.com/watch?v=Q5vh1Xj-xM4
[1] https://www.youtube.com/watch?v=rboZswsKwaw
It is taught using three.js which is a very very easy to use wrapper library around webgl. If you don't have a graphics background you can still make very pretty things with it.
I've spent a significant amount of time learning both OpenGL and WebGL, and I have to say, there is significant value in starting with OpenGL first. For starters, the GLSL compiler is much friendlier. There are also merits to understanding the state-machine from a "C" perspective.
What's so difficult about linking against a lib/including some headers and pasting the code snippets? The only part I really had problems with was figuring out that I needed glew, and why it wouldn't work on osx with the core profile .
I haven't looked recently, but at one point I did a survey of rotation matrix examples online and the vast majority of them were wrong, with subtle typographic errors in a sign on a term here, or a cosine swapped with a sine operation there. I've seen "game rendering loop"s that leak memory every frame (in C++) or allocate every frame and eventually cause GC (Java, C#, JavaScript). I've seen OpenGL initialization snippets that didn't account for pixel density of the display properly and ended up rendering at too low of a resolution.
No, don't paste snippets of anything you find online. It's likely to be really bad.
It doesn't seem to matter all that much which one you choose, either.
Want to change the pointer using GLFW to one of the standard X11 pointers like the busy hour glass. Good luck, it can't be done as far as I know.
WebGL is still far away from widespread distribution, I hope it will get there in couple of years.
The most attractive aspect of this website is that it's oriented towards opengl 3.3 core profile, so it's really up to date, but now I admit I don't understand how vulkan will change that.
https://en.wikibooks.org/wiki/OpenGL_Programming
http://www.videotutorialsrock.com/
http://www.lighthouse3d.com/tutorials/
http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/#
https://web.archive.org/web/20150309070928/http://www.arcsyn...
https://www.npmjs.com/package/shader-school
http://www.ntu.edu.sg/home/ehchua/programming/opengl/cg_basi...
http://nullprogram.com/blog/2015/06/06/
https://github.com/zuck/opengl-examples
https://github.com/progschj/OpenGL-Examples
https://github.com/g-truc/ogl-samples
https://github.com/apitrace/apitrace
https://en.wikipedia.org/wiki/Portal:Computer_graphics
https://blog.inovex.de/android-graphics-pipeline-from-button...
https://blog.inovex.de/android-graphics-pipeline-from-button...
http://www.tomdalling.com/blog/category/modern-opengl/
https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-...
Also, if you're interested in OpenGL with Go (and IMO Go is excellent to use with OpenGL), look at:
(I like the features of visual studio but i am never going back to windows.)