3 ms·
Thanks for the heads up. I actually did look at that reference, and in particular, the WebGL State Diagram is fantastic. Unfortunately, it still uses some helpe
by akdas 6y ago
Thanks for the heads up. I actually did look at that reference, and in particular, the WebGL State Diagram is fantastic. Unfortunately, it still uses some helper libraries that, for me, obscure the core APIs. That said, WebGL Fundamentals is definitely going to be one of my references going forward.
- Jasper_ 6y agoI do recommend writing some DSA-like helpers for OpenGL, its global state is annoying to wrangle and not that meaningful to the actual GPU. The tricky part of OpenGL is understanding when something is a bad API accident and when something is actually meaningful. Texture bindings are a good example of something that came about mostly by accident, as they didn't want to break legacy code. So we went from "the texture" to "the current texture", and then had to introduce "the active texture" once multi sampling entered the picture.
- Twisol 6y agoCould you expand on what you mean by "DSA-like helpers"?
- akdas 6y ago100% agreed that I'll be writing abstractions as the program grows. But without understanding the underlying APIs, I don't know which abstractions to write. As another commenter asked: what does "DSA-like helpers" mean in this case?
- Jasper_ 6y agoDSA is Direct State Access, it's an OpenGL extension to remove some (not all!) of the more annoying binding state. https://www.khronos.org/opengl/wiki/Direct_State_Access https://www.khronos.org/opengl/wiki/Direct_State_Access
- Twisol 6y agoAh, so for "DSA-like helpers" you're suggesting additional helpers that will take care of binding the given object, making manipulations, and unbinding it?
- Jasper_ 6y agoYep. Though it's a lot trickier than just bind/unbind, e.g. if you have a VAO bound, you need to unbind the VAO before binding a vertex buffer, or else you might have overwritten the VAO's vertex buffer binding slot. And I've encountered many, many similar cases like that and edge cases, especially around framebuffer management. The OpenGL programming model is unfortunate.
- gfxgirl 6y agoIt doesn't use any helpers in its first article. After that 90% of the articles only use code to compile shaders. The rest is raw. At some point you have stop using raw OpenGL/WebGL. The point becomes to show how to apply the concepts, not focus on minutia of setting up things that were covered before. AFAICT every article links to the articles it depends on and they all lead back to the issues that were already covered. Did you read the linked prerequisites or did you expected every article to have 10s or 100s of pages of repeated explanation? This is no different than reading a book. If you jump to chapter 14 you can't complain it's not re-covering topics that were covered in chapters 1 through 13.
- akdas 6y agoI actually think the other resources, including WebGL fundamentals, are really great. But whenever I tried reading them, they just didn't click for me. I don't mind organizing the code. I just want the barebones in the beginning. I see that WebGL fundamentals, for example, uses a webgl-utils library, which is what tripped me up, even though it's only used for one small utility. Basically, I'm still on Chapter 0 :)