Meta releases Intermediate Graphics Library
khronos.org
khronos.org
I'm not sure rendering it entitles you to slap your own copyright notice on it while disrespecting the CC-BY. Further, the interface shown is just plain ImGui. That'd be as if I made an image viewer using off-the-shelf parts, displayed some other artist's work in it, then pretended I own the copyright to what my software now displays.
Obviously I don't. The very purpose of this software and image viewers alike is to display other people's work. What Meta owns is software, not the output it may produce.
These corporations are way too eager to slap their copyright notices on everything. It's definitely not a harmless mistake when those same corporations own literal armies of lawyers who protect their employer's "interests" while not necessarily understanding processes happening in other parts of the company.
In general anyhow. In this case it's luckily just Goliath vs. Goliath and not some poor indie developer getting shafted and robbed of credit.
[1] https://developer.nvidia.com/orca/amazon-lumberyard-bistro
[1] https://en.wikipedia.org/wiki/Bridgeman_Art_Library_v._Corel....
[2] https://en.wikipedia.org/wiki/National_Portrait_Gallery_and_...
But, most engineers/PMs/etc don't have a good understanding of copyright law – it wouldn't surprise me if the authors of that blog post just slapped "Copyright Meta" on it by default because they are used to doing that, and aren't thinking at all about technical legal questions of copyrightability. Furthermore, it isn't really their job to think about those questions – that's what companies employ lawyers for – and I imagine the lawyers likely think that asserting copyright over the uncopyrightable has minimal negative consequences, whereas failing to make that assertion can work against them if it ever becomes the basis of a lawsuit, so better just tell the employees to slap a copyright notice on everything.
I once contributed (on my employer's time) to a FAANG open source project (I'll avoid saying which project or FAANG because I don't want to publicly embarrass anybody). I added a brand new file which I'd written from scratch; I copied the copyright/license notice from one of the existing files to the new one, but I changed it from "Copyright [FAANG]" to "Copyright [MyEmployer]". The FAANG employee who ran the open source project objected to that – "why did you change the copyright, everything in this project is copyright by [FAANG]"– the project didn't have a CLA, by the way. I told them they were wrong about the law, and if they didn't believe me, ask their own lawyers – and maybe they did talk to them, because they dropped the objection and ended up merging it, complete with my employer's copyright notice. So even FAANG engineers can fail to grasp the basics of copyright law.
Here is a better explanation from your Wikipedia link:
> Bridgeman Art Library v. Corel Corp. [...] which ruled that exact photographic copies of public domain images could not be protected by copyright in the United States because the copies lack originality.
I wouldn’t speculate on what might fly in court, but while some rendering can require artistic choices, it’s certainly not a requirement for all renderings, and more importantly, the specific renderings in question here are very low on the artistic choices scale; they’re generic screen-captures meant to demonstrate the library’s functionality, not carefully rendered imagery. The Bistro scene is instantly recognizable, and the view is generic and similar to many existing renderings, and lower quality than what you get if you web-search for “bistro scene render”.
I will speculate that it seems likely that Khronos slapped the copyright notice simply because they got the images from Meta, and that Meta made them of this scene specifically because the scene has an open license, and Meta had no particular intent to assert copyrights. I bet this is only a CYA by Khronos, and not even a question of precedent. That said, I guess maybe I think it lands closer to Bridgeman v Corel than you do.
Even if it was a rendering engine, having worked on rendering engines for both games and film, I’m unconvinced by your argument. In fact, the goal is typically to avoid baking artistic choices into the engine. The goal is usually to represent the choices made in the scene and the staging by the actual artists faithfully without bias. Sometimes there are some identifiable styles that emerge out of the technical limitations of an engine, or occasionally from unique technical features. It’d be a stretch to call those artistic choices. There can also be uniquely stylized engines that make unique artistic choices, and they’re pretty niche so I can’t even name one off the top of my head, but this library by Meta definitely isn’t one of those.
And again, if you look at the two specific images in question in the article, there really aren’t any particularly unique artistic choices there, neither in the rendering engine nor in the staging. They look like screenshots of an OpenGL render of the CC licensed Bistro, using a camera view and lighting that is similar to thousands of other shots of this scene.
TM != Copyright, but still interesting.
One reason is that supporters of the public domain are much better organised than in the 1990s, and their cause has become a lot more popular and mainstream. For example, Wikipedia is a household name with a lot of money (the Wikimedia Foundation has over US$200 million of cash and investments), and they would lobby and campaign hard against any such a proposal if it was being seriously pursued.
In the 1990s, you had the film, television, publishing and music industries all supporting copyright term extension, and no serious corporate opposition to it – I doubt most big tech companies would support copyright term extension, because they get no benefit from it (all of their own copyrighted works are much more recent), whereas public domain works are actually a resource they can use for their own purposes (zero copyright risk AI input)
Also: Disney was already unpopular with social conservatives in the 1990s, but they've arguably grown even more anti-Disney in the years since, plus the post-Trump GOP finds itself far beholden to its base than the 1990s GOP did – nobody in the contemporary GOP wants to vote for anything viewed as doing Disney's bidding, because they probably won't be forgiven. In the 1990s, they could be confident they would be.
I'm willing to give the 1998 legislators the benefit of doubt -- they were probably clueless when it comes to internet and technology. But extending copyright further now should be seen as a crime against humanity.
I guess this means that this sample will use OpenGL rather than Metal on macOS? They claim there's a Metal backend, but how would one enable that for the "Tiny" sample? By manually adding a third parallel implementation with "#elif USE_METAL_BACKEND" everywhere?
[1] https://github.com/facebook/igl/blob/main/samples/desktop/Ti...
If you use something like SDL, you'll probably be able to minimize the platform-specific stuff.
But tbf also, I'm just skimming the code base. Maybe they'll publish some better docs later that explain/justify these things.
createRenderPipelines uses the branch to add #version 460 to the beginning of shaders (one would think the platform backend could do that for you, also this won't support GLES2 or GL3), and also makes the programmer build a sampler/uniformblock mapping table.
That's... perhaps needed if you're on GL3 because you don't have access to binding=N in the shading language and you don't want to do any shader parsing in the backend, but also, you're forcing it on GL 4.6, so... huh? Just use explicit binding in the shader and the binding index APIs.
The render function uses USE_OPENGL_BACKEND to adapt for the -1...1 clip space. Sure, again, glClipControl is more modern than your minspec, but you're already forcing GL 4.6, so WTF. Also, it's not hard to write device_->adjustProjectionMatrixForNativeClipSpace(); that does a matrix mul.
It also makes the shadow render target have a color attachment (wtf? depth-only targets are supported just fine in GLES2/GL3 to my knowledge), and it also... doesn't use an index buffer when rendering? (EDIT: This is because it's using a 32-bit index buffer, which GLES2 doesn't support. But it's a much better idea to split it into multiple 16-bit index buffer draws if required than drop the index buffer entirely... also, you know, shaders have 4.6). I give up trying to understand what's going on. Oh, and despite building the uniformblock mapping table from before, you still have to use glPipelineState->getUniformBlockBindingPoint? What on earth?
This does not impress me.
GPU programming is insane and the devs have stockholm syndrome.
I only read the announcement by the time I submitted it, it is quite clunky.
Thr shaders are backend specific but rest is mostly generic?
Graphics people need to face the fact that writing optimised cross platform renderers is not something that can be solved by divide/conquer into layers in this bottom up way anymore, instead you need to architect the data flow of the renderer and implement platform specific/optimal approaches for each sub part of that, which are so specific that this sort of wrapper would not help. This isn't exactly far removed from the pyramids -> gothic cathedral comparison.
Is that right? I have been thinking that wgpu is the best choice available for intermediate cross platform graphics one level below something like Skia and one level above Vulkan, OpenGL, DirectX, and Metal.
Please quote the text that made you believe this. It's a very negative take.
And on the other hand, you get abstractions for the stuff that really is similar, like command buffers, camera control etc.
I think the API is well designed, and nails flexibility together with performance, at the cost of requiring to have, at least, expert knowledge in one library. After that I would get chatgpt to convert my shaders to metal, Vulkan, etc.
HTML clicked for me one day when I mentally decoupled the hypertext from the actual browser rendering. So many of us think HTML and imagine the point is to render a webpage. But HTML describes the semantics, topology, and content of a document. It’s 100% valid to “render” HTML in some other format like a PDF or an mp3.
https://github.com/mozilla/readability/blob/main/Readability...
CSS doing the "rendering," like laying out mobile-responsive versus desktop.
I wonder how we would separate out explicit class names from HTML, unless the tags themselves are <custom-names />. (Micro frontends & web components?)
Then it sort of works out nicely, I think.
> HTML is the semantics ... the element tag to say "what it is"
Maybe this is best framed as a perspective thing.
"Semantic HTML" is about HTML authors using HTML elements in a way that is consistent with the definitions laid out in the specs. These definitions try to specify element semantics because user agents want to be able to do less-dumb things (things that don't work as well if HTML authors are constantly abusing tags for some presentational effect even though the semantics are weird or wrong).
The main consequence of this is that tag semantics (from the UA's perspective) won't always square with what the author assumes it means unless they go study the spec. For example, it's probably not hard to go find cases where the <address> tag is used for the obvious thing from the author's perspective: marking up addresses. The spec, however, explicitly contradicts this surface-level reading: https://html.spec.whatwg.org/multipage/sections.html#the-add... (i.e., it can be "correct" for pages to contain a mix of addresses that do and don't have the address tag.)
1990s web, with flashing tags and just infant monkeys trying to cobble together a webpage?
Your comment brings so many images to mind.
We can still do flashing tags and cobble together webpages; all we need is a text editor.
That's one allure of programming: we can (re)invent primitives of everything, for better or worse.
¹ With CSS and Javascript
(Also if that comment exposes any ignorance I have, please forgive me and point it out so I can learn something!)
https://github.com/floooh/sokol
It doesn't support vulkan though, but if that's important to you you're probably much better off just using vulkan directly since it's supported on all the major platforms.
https://github.com/gfx-rs/wgpu
It is written in Rust
There are other tools you could use out there with IGL, but Sokol's solution streamlines the whole process.
...technically, Vulkan on Windows is also only supported via 3rd-parties (the GPU vendors), so the situation isn't actually all that different. The "Vulkan driver" is just bundled with the application on Mac instead of installed separately.
Sorry but this is simply par for the course for any of the above.
You can certainly wrap a lot of that stuff, but you need to make assumptions, and the person that uses likely is writing demanding app, and they want full control over literally everything - but they also would like to cut time to port to Linux by half (say).
that said, it's not like this scales linearly so that 1,000 triangles is 385,000 lines of code. there's a lot of plumbing to setup the pipeline for your application's specific use case.
again, if your use case does not require the flexibility, look elsewhere.
https://github.com/ocornut/imgui/wiki/Software-using-dear-im...
This seems like another intermediate decoupling layer?
This (IGL) is more a layer sitting on top between your app and the system provides API since pretty much every system has a different blessed API these days: Browser:WebGL/WebGPU, Windows:DirectX/Vulkan, Mac:Metal, Linux/Android:Vulkan, Consoles: Proprietary APIs like NVN/GNM/AGC/DX12 with a lot of extensions.
Just about every major cross platform 3D graphics app/engine has a layer like IGL, this just seems to be an attempt to make Meta's a standard.
Owie
(the whole point of more modern 3D APIs, which move most of the expensive "abstraction-layer translation work" into the initialization phase is to "cut through" all those layers in the frame loop though)
That said, all of this is relatively mundane, at the end of the day. I'm curious to try it out and see how the ergonomics/performance is. It honestly doesn't look too bad and it's kind of a good sign that a large amount of the triangle example is just windowing, because the actual rendering is relatively simple and succinct for a modern graphics API. I'd like to have an adapter for SDL2/3 and support for Wayland on Linux but otherwise it looks promising. Compared to other abstraction layers (like bgfx) it appears a bit more forward-thinking in some superficial regards at the very least. (Seeing a command queue abstraction in hello world makes me hopeful, anyways.)
260 LoC Vulkan / IGL / SFML example: https://github.com/eXpl0it3r/SFML-IGL
The main benefit of DirectX 11 is that it's a lot simpler for the developer. But when you are creating an abstraction layer for multiple APIs, you are not the target audience for a simple to use graphics API.
IIRC Doom Eternal only supports Vulkan (on PC) and that didn't really cause problems. In fact, the game's performance was superb.
We almost had it, with Vulkan. But Apple just had to Think Different.[1] If it were not for Apple, we would not need this intermediate graphics layer. It wasn't a win for Apple; the Mac-only game market is tiny.
Also about OpenGL extension spaghetti making it literaly a bunch of mini-APIs that were only portable in name and basic features?
The iOS game market is huge by the way.
OpenGL has the advantage of being an open standard. Did Meta need custom behavior? If so, OpenGL already has a well-defined extension mechanism.
Meta produced this library not for the benefit of general public. They produced it to make their own development easier and faster, and internally they are unlikely to benefit from OpenGL's ubiquity or backwards compatibility. Then they released the library for the benefit of general public. This is very nice, thanks! But we are not the main target audience.
Since they are honestly open source, they have been inspected a lot, and, if they included any data siphoning, that would be long known, and long since deleted.
I don't share your skepticism.
I've been playing with wgpu-rs, bgfx, and a couple others in the past and they work pretty well for the most part. At this point I think I'd still rather choose just Vulkan for a new project though.
It does seem like kind of a mess. Unlike WebGPU, though, it doesn't sound like Meta's thing is much of an improvement.
Also, there are those who argue that starting new projects in C++ in 2023 is almost always wrong. How about checking out the new C++ library? Do you think your preferred language X would be better than C++ in this situation?
Metal started with a programming model that looks a lot like what a hypothetical "D3D11 next" could have looked like (basically D3D11 minus the warts, and plus PSOs, command queues and render passes, but keeping the traditional and straightforward slot-based resource binding model).
Later versions then gradually added optional lower-level, more explicit features which allow more control over resource management and accessing specific GPU features with less API overhead, but may also be less convenient to use (and it's not actually just "Apple GPUs", Metal supports Apple devices with Intel, AMD and NVIDIA(?) GPUs just fine - since there were Mac laptops which shipped with those GPUs).
Apple also maintains higher level libraries like MetalKit and SceneKit.
Because of this 'layered approach', a Metal application can just start with the higher level API features to get something running quickly, and then gradually switch to more recent and more explicit Metal features only when needed or desired.
One could also simply say that the Metal team applied common sense, "taste" and a balanced approach to their API design, instead of just mechanically collecting hardware feature requirements from all GPU vendors and trying to cram those into a common low-level API at all cost.
DJTEK: The wording of this could be applied to virtually any library out there its so vague. The key features section is like a mixtape of the worlds graphic library descriptions greatest hits. Lol
edit: it's already like 2 gb
Does anyone have any recommendations for an intermediate graphics library that uses Python and supports compiling your code to a WebGL target?
I'm interested in exploring SDF functions in a parametric CAD context, but coming from a Mechanical Engineering background. Not having to learn a new programming language for a side curiosity would be ideal.
Pick up Rust and Bevy. It should be pretty easy to mock up what you want, and you can dip into wgpu when you need extra fine control over the GPU.
Just based on the screenshot, I am not sure that I would even bother to dig too deeply into the library.
This screenshot is far from current AAA games, but there is no way to render such a scene in a game made for 2000 hardware.
https://www.jmeiners.com/pre-rendered-backgrounds/img/ff7.jp...
and the image in the article about Meta's library:
https://www.khronos.org/assets/uploads/blogs/2023-july-blog-...
If FF7 were rendered at the same resolution, I think it would be comparable. Here's an FF7 AI upscale mod for reference:
https://www.resetera.com/threads/a-full-high-res-ai-upscale-...
https://youtu.be/j-Iykz0gb7Q (video uploaded 2006)
I guess, to make a poor analogy, your comment is sort of like looking at a still frame of a poorly shot movie and complaining that the codec is shit.
this is made for people building rendering engines on top of. if you are the software engineer with the knowledge necessary to do that, the screenshot is probably not going to influence you, because you understand what this is for. if you aren't, why should they be marketing to you with eye candy?
The picture looks like they didn't have automatic tonemapping, the rendering equivalent of auto exposure control. So the picture is too dim. I brought it into a photo editor, saw that the top third of the intensity space was empty, used "Levels", and it looked much better.
That's a standard glTF test scene, called "bistro". Here's the same scene, rendered with Rend3/WGPU.[1] Here's the source code for that example.[2] Rend3 is a level above WGPU; it deals with memory management and synchronization, so you just create objects, materials, transforms, and textures, then let the renderer do its thing. Rust handles the object management via RAII - delete the object, and it drops out of the scene.
Looking at Meta's examples, there are too many platform-specific #ifdef lines. More than you need with WGPU. Probably because WGPU is usually used with something like Winit, which abstracts over different window systems.
We'll have to wait for user reports about performance. Meta didn't show any video. Here's a test video of mine using Rend3/WGPU on a town scene comparable to the "bistro" demo.[3] This is a speed run, to test dynamic texture loading and unloading while rendering. The WGPU people are still working through lock conflicts in that area. The idea with Vulkan land is that you should be able to load content while rendering is in progress. For that to be useful, all the layers above Vulkan also have to have their locking problems hammered out. Most open source game engines don't do that yet. Unreal Engine and Unity do, which is why you pay for them for your AAA title.
[1] https://raw.githubusercontent.com/BVE-Reborn/rend3/trunk/exa...
[2] https://github.com/BVE-Reborn/rend3/blob/trunk/examples/scen...
Here's the same scene in Godot.[1] This was modified a bit, and has accurate values for the lamp illumination. So they are totally washed out by the sun.
And here it is in several other renderers, with a video.[2]
The original scene was in .fbx, from Amazon's "Lumberyard" project. [3] That project started as the Crysis engine, was bought by Amazon, spun off as open source, was renamed Open 3D Engine, and is still getting Github changes, so it's not dead.
There are many open source game engines. Most of them get stuck at "mostly works, not ready for prime time". That's where the problems get hard and fixing them stops being fun.
[1] https://github.com/godotengine/godot/issues/74965
[2] https://www.ronenbekerman.com/orca-amazon-lumberyard-bistro/...
[3] https://developer.nvidia.com/orca/amazon-lumberyard-bistro
This just feels like sour grapes about the fact that WGPU excluded Khronos when it was developed, so Khronos wants their own, with maybe a bit of promotion-driven development on Meta's part.
Adding any PBR materials as samples would have been the wrong choice, since those are not hardware or graphics api dependent, and are always for the implementor to implment by themselves.
You don't want a graphics api to look nice at this abstraction level.
You get access to device resources, shader API etc.
Once you get triangles in, it's up to you to make it nice using the shaders you write - materials and GI model of your choice.
That "bistro" image is all PBR materials, represented in glTF. It's supposed to look the same for all standards-compliant glTF renderers, and it pretty much does. I posted the same scene in another renderer above. It's a brightly sunlit scene with no environment shaders, so it looks rather blah. glTF and Vulkan can do more than that, but this is all the test example asked for.
Go watch nvidia’s demo of their lighting and scene modification/remastering tool.
At least it is not a teapot.
Well good news, it's not a 3d engine at all! It's a nice common API to cover all the existing graphics APIs.
Sadly, that's not the case. For game consoles, neither Xbox nor PlayStation support Vulkan. iOS and macOS have their own Metal API (because of course they got to have their own thing).
So, with just a Vulkan backend, you can only target Windows, Linux, Android, and Nintendo Switch natively. Translation layers like MoltenVK may help though.
It's still unclear whether the next iteration of the Switch will continue to support Vulkan.
Unless you were to switch to a homegrown solution that would make use of this
Also, TIL the Meta Quest 2 is running Android 12L??
- Metal 2+
- OpenGL 2.x (requires GL_ARB_framebuffer_object)
- OpenGL 3.1+
- OpenGL ES 2.0+
- Vulkan 1.1 (requires VK_KHR_buffer_device_address and VK_EXT_descriptor_indexing)
- WebGL 2.0“It supports various graphics APIs, such as OpenGL®, OpenGL ES™, WebGL™, and Vulkan®”
Seems strange that’s missing from one and showing in the other.