Announcement

Collapse
No announcement yet.

ModernGL: Improving The OpenGL Bindings For Python

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ModernGL: Improving The OpenGL Bindings For Python

    Phoronix: ModernGL: Improving The OpenGL Bindings For Python

    For those looking to make use of OpenGL from Python, the ModernGL project aims to provide better GL bindings for the language...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Is OpenGL or Vulkan more suited for Python?
    Which is easiest?
    Does the performance advantages of Vulkan matter in a interpreted high-level language such as Python, or is the advantage only present in low-level languages like C an C++?

    Comment


    • #3
      uid313, these are pretty tough questions. For small projects, both OGL and VK should be okay in combination with Python. OGL is most likely easier.

      Python isn't a good language for multithreading, so I assume Vulkan hasn't that much advantages over OpenGL is you use them with Python directly. But of course you can write C/C++ code and use it from Python, which has most of the advantages from both worlds. If you want to dive into Python with OpenGL, I can absolutely recommend Panda3D. It's an fantastic 3D engine with perfect Python bindings, it is fast and has very good examples.

      Comment


      • #4
        Vulkan is extremely low-level. It shifts most of the work to the developers.
        It basically boils down to "You don't like OpenGL ? Then write your own stuff, here are some building blocks" (though most of the time the devs won't be writing another GFX API, they'll be building something really high-level like a graphics engine).

        Except for the very first steps in prototyping something, Vulkan on Python doesn't make much sens (but python *is* good at prototyping, so it's still making sense).

        C/C++ (and other compiled language with lots of low-level optimisation possibilities) are much more likely to be used in the final product in something using Vulkan.

        OpenGL is high-level, it's not about directly controlling the hardware, it's about sending lists of textures, meshes, etc. and their attribute for rendering. It would make more sense to use them in Python. But then again, python might not be precise and tunable and fast enough for it to matter much beyond fast prototyping (though there are things like Cython which are statically typed, compiled to binary and much more useful for time-critical code section).

        The best use of 3D in python would be to have some efficient game engine written in C/C++ (and itself using Vulkan) and using PYthon for the game logic.

        Comment


        • #5
          Does anyone know a few good tutorials on how to build C/C++/fortran applications with say gcc and set up an application in Python that interacts with the compiled binaries?

          Comment


          • #6
            Here is the documentation of ModernGL: https://moderngl.readthedocs.io
            Here is a new link for examples: https://github.com/cprogrammer1994/M...aster/examples

            Comment

            Working...
            X