TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

OpenGL Is Broken

156 点作者 watermel0n将近 11 年前

21 条评论

fixermark将近 11 年前
Quite a few of these issues (especially in the &quot;Too many ways to do the same thing&quot; category) relate to OpenGL&#x27;s age as an API, which is something Direct3D&#x27;s design was able to learn from and improve upon. OpenGL&#x27;s origin was as a vector-based drawing tool for CAD applications which was repurposed to games; D3D was targeted for performant rendering with games as a specific target. This is demonstrated by some key features necessary for performant games (clock synchronization to avoid &#x27;tearing&#x27; comes immediately to mind) that are core to the D3D spec and extensions to the OpenGL spec. There&#x27;s also a bit of a cultural issue; if you learn OpenGL from the &#x27;red book,&#x27; you&#x27;ll learn the function-per-primitive API first, which is precisely the <i>wrong</i> tool for the job in making a performant game. Really, the OpenGL API is almost multiple APIs these days; if you&#x27;re using one flow of how to render your primitives, the other flow is downright toxic to your rendering engine (in that it&#x27;s going to muck about with your GL state in ways that you shouldn&#x27;t burn mental energy predicting).<p>Some of this is ameliorated by the OpenGL ES standard, which throws away a big chunk of the redundancy. But I&#x27;m not yet convinced that OpenGL has gotten away from its philosophical roots as a performance-secondary CAD API, which continues to dog its efforts to grow to serve game development needs. The fact that it&#x27;s functionally the only choice for 3D rendering on non-Windows platforms is more testament to the nature of the hardware-software ecosystem of graphics accelerators (and the creative doggedness of game developers) than the merits of the language.
评论 #7822904 未加载
评论 #7823064 未加载
评论 #7822586 未加载
评论 #7822711 未加载
raverbashing将近 11 年前
I think what&#x27;s broken is not OpenGL, D3D, etc<p>What&#x27;s broken is that the abstraction between graphics card and data (on the screen) is too big<p>We don&#x27;t have troublesome&#x2F;fat drivers as these since the &quot;Softmodem&quot; days and even then (Wifi is also complicated)<p>It&#x27;s too big of a gap.<p>In 2D graphics, you send graphical data and it is displayed. You may even write it directly to memory after some setup.<p>Audio, same thing. Network, it&#x27;s bytes to the wire. Disk drive, &quot;write these bytes to sector X&quot; (yes, it&#x27;s more complicated then that, still)<p>With 3D, we have two APIs that have an awful amount of work to do between the getting the data and displaying it.<p>I&#x27;ll profess my ignorance in the low-level aspects, I only know &quot;GlTriangle&quot; , OpenGL 101 kind of stuff, and I have no idea how: 1 - this is sent to the videocard, 2 - how does it decide to turn that into what we see on the screen.<p>Compared to the other drivers this is a lot of work and a lot of possibilities of getting this wrong.<p>Adding GPGPU stuff makes it easier in one aspect and more complicated in other aspects. We don&#x27;t have a generic way of producing equal results from equal inputs (not even the same programming environment is available)<p>We don&#x27;t have OpenGL, we have &quot;this OpenGL works on nVidia, this other one works on ATI, this one works on iOS, or sometimes it doesn&#x27;t work anywhere even though it might be officially allowed&quot;
评论 #7823103 未加载
评论 #7824429 未加载
评论 #7823083 未加载
评论 #7822975 未加载
druidsbane将近 11 年前
Well-reasoned response: <a href="http://timothylottes.blogspot.com/2014/05/re-joshua-barczaks-opengl-is-broken.html" rel="nofollow">http:&#x2F;&#x2F;timothylottes.blogspot.com&#x2F;2014&#x2F;05&#x2F;re-joshua-barczaks...</a>
评论 #7824110 未加载
espadrine将近 11 年前
The &quot;compiler in the driver&quot; part of this post sounds awfully like the &quot;asm.js vs. NaCl&quot; debate.<p>Sure, building an IR from scratch is fun. But making it truly cross-platform and ready for many usages is really hard. Also, the GLSL source <i>is</i> an IR between the programmer&#x27;s intent and the driver&#x27;s behaviour. Code is just another type of binary. It is just slightly harder to parse, but not by much; without performance comparisons, a complaint about how hard it is to parse code is invalid.<p>Feeding the driver GLSL can also yield much clearer error messages for programmers. I can only imagine what kinds of error messages the IR compiler would produce. Sure, hopefully, our cross-platform IR would be accepted by all GPUs without pain, but that&#x27;s improbable.<p>Regardless, starting from a clean slate is much harder than working our way from the current state to an improved OpenGL. Just like few browsers are on board with NaCl, few GPU makers would be on board with a brand new design.
评论 #7824021 未加载
pyalot2将近 11 年前
This post is factually wrong, and misguided. Here&#x27;s why:<p>#Preamble: Except on Windows you cannot run Direct3D anywhere else. Unless you plan not to publish on Android, iOS, OSX, Linux, Steambox, PS4 etc. you will have to target OpenGL, no matter how much you dislike it.<p>#1: Yes the lowest common denominator issue is annoying. However, in some cases you can make use of varying features by implementing different renderpaths, and in other cases it doesn&#x27;t matter much. But factually wrong is that there would be something like a &quot;restricted subset of GL4&quot;. Such a thing does not exist. You either have GL4 core with all its features, or you don&#x27;t. Perhaps author means that GL4 isn&#x27;t available everywhere, and they have to fall back to GL3?<p>#2: Yes driver quality for OpenGL is bad. It is getting better though, and I&#x27;d suggest rather than complaining about OpenGL, how about you complain about Microsoft, Dell, HP, Nvidia, AMD etc.?<p>#compiler in the driver: Factually this conclusion is completely backwards. First of all the syntactic compile overhead isn&#x27;t what makes compilation slow necessairly. GCC can compile dozens of megabytes of C source code in a very short time (&lt;10ms). Drivers may not implement their lexers etc. quite well, but that&#x27;s not the failing of the specification. Secondly, Direct3D is also moving away from its intermediary bytecode compile target, and is favoring delivery of HLSL source code more.<p>#Threading: As author mentions himself, DX11 didn&#x27;t manage to solve this issue. In fact, the issue isn&#x27;t with OpenGL at all. It&#x27;s in the nature of GPUs and how drivers talk to them. Again author seems to be railing against the wrong machine.<p>#Sampler state: Again factually wrong information. This extension <a href="http://www.opengl.org/registry/specs/ARB/sampler_objects.txt" rel="nofollow">http:&#x2F;&#x2F;www.opengl.org&#x2F;registry&#x2F;specs&#x2F;ARB&#x2F;sampler_objects.txt</a> allows to decouple texture state from sampler state. This has been elevated to core functionality in GL4. The unit issue has not been resolved however, but nvidia did propose a DSA extension, which so far wasn&#x27;t taken up by any other vendor. Suffice to say, most hardware does not support DSA, and underneath, it&#x27;s all texture units, even in Direct3D, so railing against texture units is a complete red herring.<p>#Many ways to do the same thing: Again many factual errors. Most of the &quot;many ways&quot; that author is railing against are legacy functions, that are not available in core profile. It&#x27;s considered extremely bad taste to run a compatibility (to earlier versions) profile and mix&amp;mash various strata of APIs together. That&#x27;d be a bit like using Direct3D 8 and 11 functionality in the same program. Author seems to basically fail in setting up his GL context cleanly, or doesn&#x27;t even know what &quot;core profile&quot; means.<p>#Remainder: Lots of handwaving about various vaguely defined things and objecting to condjmp in the driver, again, author seems to be railing against the wrong machine.<p>Conclusion: Around 90% of the article is garbage. But sure, OpenGL isn&#x27;t perfect, and it&#x27;s got its warts, like everything, and it should be improved. But how about you get the facts right next time?
评论 #7822442 未加载
评论 #7822662 未加载
评论 #7822797 未加载
评论 #7822280 未加载
评论 #7822222 未加载
评论 #7825266 未加载
npsimons将近 11 年前
OpenGL might be broken, but Direct3D and DirectX are <i>not</i> the solution. Otherwise, you might as well just correct yourself and say &quot;Windows gaming&quot; <i>not</i> &quot;PC gaming&quot;. And clinging to a different single vendor&#x27;s proprietary standard doesn&#x27;t seem like a good idea either.
评论 #7823530 未加载
VikingCoder将近 11 年前
Reason #2 is chicken and egg.<p>I&#x27;m not excusing OpenGL for this fact, I&#x27;m just stating that if people cared about the quality of OpenGL drivers and made purchasing decisions based on that, then you bet your ass the manufacturers would make the OpenGL drivers better.
jmpeax将近 11 年前
I&#x27;ve written an in-house visualization program in OpenGL that runs on Mac and Windows. These articles just make me laugh, especially the bit where they talk about cross platform being a myth, then follow on with the virtues of DirectX.
评论 #7825104 未加载
Mikeb85将近 11 年前
So the solution he proposes at the end is to use Mantle? AMD has already proven themselves incompetent (or are they only unwilling?) at implementing OpenGL, unable to compete with either Intel or Nvidia, and now they want to fragment graphics APIs? And this is the &#x27;solution&#x27;?<p>As for OpenGL&#x27;s issues - that&#x27;s what happens when a spec gets old enough. But the fact remains, it&#x27;s the only graphics API that could be called &#x27;universal&#x27;, they have modernized the spec, and despite all its failings, somehow it still delivers better performance than DirectX...
CmonDev将近 11 年前
And it will never be properly fixed due to backwards-compatibility requirements - just hack-patched. Just like web (HTML&#x2F;CSS&#x2F;JS).
icambron将近 11 年前
I don&#x27;t know anything about graphics programming, but I couldn&#x27;t make any sense of this:<p>&gt; While the current GL spec is at feature parity with DX11 (even slightly ahead), the lowest common denominator implementation is not, and this is the thing that I as a developer care about.<p>Isn&#x27;t DX restricted to Windows, meaning its lowest common denominator implementation is nothing at all?
评论 #7824917 未加载
评论 #7824139 未加载
评论 #7825498 未加载
评论 #7824135 未加载
AshleysBrain将近 11 年前
I think the difficult thing about OpenGL is it is hard to learn. The core profile of the latest version might be nice, but in practice there are still a wide range of OpenGL versions in use, so you have to learn the various ways of doing things through the OpenGL versions, or code against a crufty old version which is the lowest common denominator. Then there are various driver issues, platform-specifics around context creation, and so on. Overall it&#x27;s a pretty tough chestnut if you&#x27;re not going to use it directly instead of relying on an engine&#x2F;framework that has figured out lots of that already.<p>Mobile on the other hand seems decent - OpenGL ES 2+ seems to be a well-designed clean and relatively minimal API with widespread support.
ksec将近 11 年前
With the traction of iOS Ecosystem. I think Apple could have created its own API, or even just reuse Mantle or use it as a base for a new API. This certainly wasn&#x27;t possible when Mac was the minority. But now even if Apple gets only 10% of the Phone market there is still a huge userbase.<p>No longer bounded by OpenGL.
alariccole将近 11 年前
Your site is broken. <a href="http://webcache.googleusercontent.com/search?q=cache:http://www.joshbarczak.com/blog/?p=154" rel="nofollow">http:&#x2F;&#x2F;webcache.googleusercontent.com&#x2F;search?q=cache:http:&#x2F;&#x2F;...</a>
shmerl将近 11 年前
What is the current stance of Nvidia and Intel on implementing Mantle support? And what are the chances of mobile GPU makers doing the same? Is it easier to make a better OpenGL 5, or to adopt Mantle across all GPU manufacturers?
评论 #7823007 未加载
评论 #7823016 未加载
zurn将近 11 年前
&gt; The GL model, placing the compiler in the driver, is WRONG<p>How does he figure OpenGL mandates this? OpenGL allows a (caching) GLSL compiler to be part of the OS OpenGL support, leaving drivers to consume bytecode or some other kind of IR.
maaku将近 11 年前
You&#x27;re webserver is broken. Anyone have a cached link?
评论 #7822163 未加载
评论 #7822157 未加载
评论 #7822152 未加载
评论 #7822149 未加载
SteveDeFacto将近 11 年前
I can&#x27;t agree 100% with everything in the article but the part about GLSL is spot on.
feistyio将近 11 年前
As is your server.
Cocodyne1将近 11 年前
OpenGL works fine for me, so it must be user&#x2F;programmer error.
评论 #7823367 未加载
foxhill将近 11 年前
theory: articles of the form: &quot;X is broken&quot;, &quot;X is wrong&quot;, or some other equally dramatic statement, say almost exactly the same thing; nothing.
评论 #7822350 未加载
评论 #7822725 未加载