omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Running pythonista scene based programs (including shader) in mac and PC

    Pythonista
    1
    2
    2811
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • abcabc
      abcabc last edited by

      Here is a utility to run pythonista scene based programs (including shader) in mac and PC using pyglet.
      https://github.com/balachandrana/pythonista_pyglet_simulation
      This is not 100 percent compatible but with slight changes (mainly for loading images) you can run most of the
      pythonista scene based programs.The utility consists of three files, scene.py, shader.py and sound.py.
      and the rest of the files are examples. You need to have python 2.7 and pyglet ("pip install pyglet"). There are no other dependencies.

      The files mandelbrot.py and julia.py are fractal examples using fragment shader. The files slider.py and nqueen.py are simple games implemented using this utility. Rest of them are test examples. I have tried these examples on both mac and windows PC machines and they seem to work fine. Please let me know if there are any problems or questions.

      I started this project to answer the question by @ccc whether his mandelbrot program can be run on Mac machine with
      hardware graphic accelarators (shader support) from Python
      (See the discussion in https://forum.omz-software.com/topic/3171/relative-performance-of-python2-vs-python3
      from @ccc

      Is there a similar way to use to the hardware of a Mac from Python?!? Your speedup is incredible!)

      1 Reply Last reply Reply Quote 1
      • abcabc
        abcabc last edited by

        @ccc, Did you try this tool? If you need an offline tool to run shadertoy examples( all the great fractal examples,
        3D examples), just a six-line code snippet (excluding fragment shader code) in Pythonista (as in mandelbrot.py) would do that.
        May be you can add this to your Ten-lines-or-less repository. There does not seem to be a simple wrapper on pyglet or any other tool to do similar thing on windows PC or Mac. (The current code available on internet directly uses opengl apis and they are not very flexible.)
        Simulating Pythonista scene behavior on pyglet was straightforward but getting fragement shader working needed a lot of experimentation.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors