7 ms·
I Am Graphics and So Can You
- deleted 9y ago[deleted]
- sk0g 9y agoDespite the weirdly worded title, the actual article is pretty fascinating. I'm quite interested in graphics programming, and one of these days I'll have to drop a subject from my SE degree to do a harder graphics subject. One day.
- logfromblammo 9y agoThe title is likely inspired by the title of a book by Stephen Colbert's The Colbert Report character, Stephen Colbert: I Am America, and So Can You.
- DarkKomunalec 9y agoWith javascript disabled, the site shows the content for a split second before hiding it. I don't like the proliferation of such user-hostile pages one bit.
- lfowles 9y agoInteresting article, I ended up getting the OpenGL SuperBible to take advantage of yesterday's kindle promotion. I thought about the Vulkan programming guide, but ended up deciding modern OpenGL would be an easier starting point. Did anyone else pick up Vulkan as their intro to graphics programming? (In a twist of fate, the SuperBible example code only supports OpenGL 4.0+ and my primary computer is stuck at 3.3)
- malkia 9y agoI wanted to learn Vulkan, but as it happened my laptop of choice is Mac, and there is only a commercial implementation of Vulkan there (or maybe there is one now that I can use without paying?). It's not the money, it's just the spending on things just to learn.
- deleted 9y ago[deleted]
- corysama 9y agoVulkan is not a good first-step path to learning graphics. It's maintainers will tell you to start out by learning OpenGL or DX11. However, even though its unpopular for many reasons, Metal is a very good compromise as a starter API. It's design is very close to Vulkan/DX12, but its complexity is much lower. It can even be said to be less complex than OGL in the way that memcpy is less complex than glSubBufferData.
- y_u_no_rust 9y agoMinus the platform support issue I must admit Metal is a really nice graphics api I'm also a big fan of bgfx (https://github.com/bkaradzic/bgfx https://github.com/bkaradzic/bgfx) and looking forward to whatever crossapi-api-spec khronos comes up with
- pfranz 9y ago> Vulkan is not a good first-step path to learning graphics. It's maintainers will tell you to start out by learning OpenGL or DX11. This article is literally advocating the opposite. 'So how did I finally break through that wall of understanding? ... "But Vulkan is the hardz" I hear you saying. "Shouldn't I start with something easy like OpenGL?" Emphatically I say NO.'
- malkia 9y agoThanks, but your message has a bit of an assumption. I'm not graphics pro, but had my ways through VGA 320x200x256 colors in 0xA0000, then a bit of 3Dfx, some OpenGL 1.1, and DX3 then quickly DX5, a bit of DreamCast (but very shy), etc. No, I'm bit familiar with OpenGL, again not at the level of graphics-pros, more like overall knowledge, and my DX knowledge goes pretty much to DX8 or DX9, but instead of learning DX11 or 12, I think Vulkan might be a better choice. I've returned my company laptop week ago, as I left it, and now I'm stuck with my chromebook + crouton, looks like Vulkan is good there (almost). I certainly don't want to get stuck in Metal.
- planteen 9y agoThe future of OpenGL is most likely OpenGL ES. You might want to try OpenGL ES 2.0 Programming Guide (or OpenGL ES 3.0 Programming Guide). It is far less daunting than the OpenGL Superbible. The differences between OpenGL ES 2 and 3 are small and OGLES2 is modern in the sense of shaders unlike OGLES1.
- vvanders 9y agoVulkan is great when you want to wring every last bit of performance out of something. OpenGL ES is a much more straightforward API and will get you something that runs practically anywhere. Most people don't care about tiled vs immediate mode GPUs when they're starting. They just want to get pixels on the screen and there's a ton of resources out there on OpenGL ES. Once you've got your feet under you(seriously, you need to understand matrices, texture formats, shaders, and a host of other things) then look at Vulkan.
- laythea 9y agoVulkan is not just about performance - it increases reliability. If you have ever attempted the hopelessly frustrating task of trying to manage GPU memory from an OpenGl application in a consistent manner, then you will have felt the pain caused by the vagueness of spec/variety of opengl driver differences. From a product point of view, you don't need to sacrifice perf for the ability to run on more hardware types.
- nhaehnle 9y agoEh, I would say Vulkan decreases reliability. Precisely because Vulkan drivers are much thinner and do no error checking, it becomes very likely that you will end up writing code that works on one system but fails on the next. Granted, OpenGL has some of the same issues. It's incredibly frustrating when vendor B accepts some GLSL that is forbidden by the spec, and then some application fails on the more conformant driver of vendor A because the developer failed to test properly. The thing is, Vulkan multiplies these issues significantly. You still have a compiler in the driver, so you still get the same potential for shader incompatibilities. But you also get to manage barriers and texture transitions yourself, and boy is it likely that you'll get something wrong there. And since memory models are different across vendors (and even different between different generations of hardware from the same vendor), it is extremely likely that you end up with code that works on card A but fails subtly on card B. There are tools that try to catch these kinds of errors, but they're far from perfect. On the issue of memory management, I am unaware of any OpenGL issues here that make applications unreliable. Sure, drivers may not always manage memory optimally, but having an application that runs a bit less than optimally is very different from an application that renders garbage because you failed to allocate your textures with sufficient alignment -- which is something you can do in Vulkan. So really, at the end of the day, Vulkan is about giving graphics developers foot-guns in order to reduce CPU overhead. That was explicitly its mission statement from the beginning!
- slezyr 9y agoSave yourself some time and forget about Superbible. You won't make it. Start from learnopengl.com and then you can try Superbible
- lfowles 9y agoThanks, I have been using learnopengl.com because of the 3.3 support. That said, I have been reading the superbible on the side and it has been an incredibly useful resource for getting in the mindset.
- rf15 9y agoActually disagreeing with the author here: As someone who did a bit of OpenGL/GLSL in their spare time building a game engine, I think it's not that arcane. You will have to come across the basic rendering pipeline pretty quickly if you look around a bit and don't just drone along with the tutorials, and from then on out it's pretty obvious what you load all those buffers for and how the shaders work in which order throughout the pipeline. (that being said, early openGL with separate state machine calls for each vertex were a little weird, and the current implementation is much closer to the underlying functionality)
- ucarion 9y agoFor a beginner, it's a frustrating process. OpenGL's primary way of letting you know you messed up is by giving you a blank screen. This is much alleviated when you use a wrapper around OpenGL (e.g. Rust's `gfx`), but most people start with raw OpenGL.
- vvanders 9y agoThat doesn't change with Vulkan, screw up a transform/shader math/vertex format and you'll also end up with a blank screen. Ironically there's a bunch more debuggers that work with OpenGL as opposed to Vulkan(or know how to debug you're way out of a blank screen by tweaking shaders/api calls to eliminate things).
- and0 9y agoThe DirectX graphics debugger in Visual Studio is a godsend. It lets you analyze ever call and check every buffer for any "snapshot" of a frame you take. Very easy to identify things like misaligned data, etc, that would be impossible to find otherwise. (This feature broke on my desktop, though, and I still can't fix it for the life of me, but I'm past that point in my project development anyway.)
- vvanders 9y agoYup, most mobile GPU vendors have similar things for Android and they're incredibly useful for debugging and profiling.
- Avery3R 9y agoPlease don't use a sticky footer.
- lgas 9y agoI suspect you have little to no hope of changing anyone's behavior by simply asking them to do something without explaining why.
- atemerev 9y agoI can't stand Vulkan for exactly the reason specified: "Vulkan is the government office telling you, you still don't have all the necessary forms to proceed." I wonder how anyone can find this description attractive, but apparently the author does. If there is a personal hell for me somewhere, this is the definition of it. Perhaps as a compiler target, it could be usable. But on its own... not a chance.
- munchbunny 9y agoTo be fair to Vulkan, it was designed to be used by somebody who knew what they were doing, under the philosophy that since developers were using all sorts of hacks to get efficient inner loops in the rendering pipeline anyway, you might as well make the API explicit about those optimization mechanisms. In that vein, OpenGL or DirectX is probably a better starting option specifically because it abstracts more of the sausage-making in a way that is conceptually cleaner, especially for beginners. It won't take long to get to a point where you'll appreciate Vulkan, but it's a shallower learning curve that is still conceptually sound.
- atemerev 9y agoBeing low-level is fine. However, the hallmark of good API design is to provide a good ramp-up and sane defaults. E.g. x86 assembly language is low-level, but I can start learning it quite easily. Writing "Hello world!" (either in BIOS or with system calls) is easy. Simple calculations and loops are easy. Assembly is approachable. On the other hand, Vulkan is as explicit and intimidating as you could imagine in the worst case, and then some. Two pages of code for drawing a triangle!
- munchbunny 9y agoOnly two pages? Honestly, that's pretty good. People who haven't done 3d graphics programming seriously underestimate the number of stages in even a basic rendering pipeline.
- 9y ago
- NotCamelCase 9y agoGreat article though I also have to disagree with the advice that for a beginner learning Vulkan could be a good direction, because Vulkan implementation of anything will require much more code than its OpenGL/D3D11 counterpart which might go wrong and which in turn would cause beginners to give in, thinking "it's too complicated for me". (That's not to say "use an engine/framework/X", that'd be my last advice)
- zokier 9y agoI think it boils down to "top down" vs "bottom up" schools of learning. One starts with high-level stuff and then drills downwards on how they are implemented. Other starts with low-level primitives and builds up more and more complex stuff. Both are equally valid strategies, and I think it depends more on the individual which one is more suited.
- Theodores 9y agoOutside of the hardcore code required for doing stuff in OpenGL there is more that can be done in the general realm of graphics for us programmer types to do. However I find few takers in the programming community once some artistic ability is needed. My advice for people is to not fear art and design but to go there with maths and coding skills. In doing so there are rich rewards and your coding competency has to be so so, not amazing. A lot of images need preparation and classification, there is a whole world of fun algorithms for that. If you can handle raw images in code then you can get that automated. This opens up a whole new world of possibilities that would be tedious to do in Photoshop style tools. Again with SVG in code editors you can write code that makes images in a way that is not so easy with Illustrator. Because you are not constrained to the same possibilities as the classically trained art guy you can see ways of achieving results that are creative solutions as seen by the rest of the team. Code therefore can make you apparently creative. Along the way you can work with the best creative talent with you becoming an asset rather than a cost on the company ledger. Given the narrow definition of graphics programming I would urge others to have a go at 3D in the real world. For instance, 3D for TV might not be what it was but it is relatively easy to be the 3D guy for a client base of a few really good producers, to have great fun doing 3D graphics. Entry into that world is considered hard but isn't if you do have the technical chops. In this scenario you are gold dust, not one of many but if you go reasonable on the salary request the job is yours. At the bottom of the 3D food chain are morally dubious things like fracking, the opportunity for someone interested in real world application of cool graphics is a good one with a low bar. There are many other industries where being able to step out the safe world of tech to embrace a non scientific discipline is the way ahead in graphics, to cut your own career.
- dpkonofa 9y agoThis is frustrating to me as a web developer because I really, really want to get into graphics programming at some point but the article makes it seem like it can be really easy if you just stop comparing yourself to others and just try to improve little by little. The problem is that he casually mentions that it'll take you 4 months of full-time work to even get to where he is and he already seems to have more graphics experience than I do. I have a full time job and a family and other obligations. It would take me 4 years to do this. It's really not as simple as "stop comparing yourself to others and just improve little by little". :(