Slashdot Mirror


Programmer Unveils OpenGL Bindings for Bash (opensource.com)

Slashdot reader silverdirk writes: Compiled languages have long provided access to the OpenGL API, and even most scripting languages have had OpenGL bindings for a decade or more. But, one significant language missing from the list is our old friend/nemesis Bash. But worry no longer! Now you can create your dazzling 3D visuals right from the comfort of your command line!
"You'll need a system with both Bash and OpenGL support to experience it firsthand," explains software engineer Michael Conrad, who created the first version 13 years ago as "the sixth in a series of 'Abuse of Technology' projects," after "having my technical sensibilities offended that someone had written a real-time video game in Perl.

"Back then, my primary language was C++, and I was studying OpenGL for video game purposes. I declared to my friends that the only thing worse would be if it had been 3D and written in Bash. Having said the idea out loud, it kept prodding me, and I eventually decided to give it a try to one-up the 'awfulness'..."

23 of 47 comments (clear)

  1. Dang it, I was hoping for 3D Accerlerated Bash by rsilvergun · · Score: 4, Funny

    imagine Fortune at 60 fps with 16x SOAA, God rays on Ultra and hair works. It would be glorious.

    --
    Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
  2. Gtk Server, anyone? by K.+S.+Kyosuke · · Score: 2

    I thought that the Gtk Server allowed one to use GtkGlArea in scripts.

    --
    Ezekiel 23:20
    1. Re:Gtk Server, anyone? by silverdirk · · Score: 1

      Hey thanks for that link! I looked around for other similar projects, but was searching for "OpenGL" rather than "gtk".

      --
      Mark of the Coder fades from you. You perform Opening on World of Warcraft. Warcraft crits GPA for 4. GPA dies.
    2. Re:Gtk Server, anyone? by silverdirk · · Score: 1

      Do you have a link? I found https://linux.die.net/man/1/mo... but that is a standalone program and not really part of bash. The manual page is also clear as mud so I'm not sure whether it would have been practical to use. (and looks like I'd need to learn TCL to use it)

      --
      Mark of the Coder fades from you. You perform Opening on World of Warcraft. Warcraft crits GPA for 4. GPA dies.
  3. Maybe by PPH · · Score: 4, Insightful

    In the hands of responsible programmers. But what happens if you need to run a bash script from a character based console?

    Too many simple utilities have morphed from: Here's a command-line tool, and here's an optional graphical UI that runs on top of it. Next, we'll merge the graphics right into the basic tool's codebase. So you need to link every hair-brained graphics lib to build it. Finally, the damned thing will refuse to run (even if you use all the text-only command line switches) if it can't find a bitmapped display.

    --
    Have gnu, will travel.
    1. Re:Maybe by K.+S.+Kyosuke · · Score: 1

      With teratomas, anything is possible!

      --
      Ezekiel 23:20
  4. brace yourself by lucm · · Score: 4, Funny

    Command-line ads are coming

    --
    lucm, indeed.
    1. Re:brace yourself by WallyL · · Score: 1

      Beware 3D
      coming to bash.
      It might cause ads
      Or the system to crash
      Burma-shave.

  5. So finally, something better about Bash than MSDOS by aberglas · · Score: 1

    Just imagine what 3D games would be like if they could be written in CMD batch language!

  6. Which version of OpenGL? by 140Mandak262Jamuna · · Score: 1
    Less than 1.8 with display lists?

    Or greater than 2.0 with shaders?

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    1. Re:Which version of OpenGL? by ArchieBunker · · Score: 2

      Don't AMD and Nvidia both have different OpenGL implementations?

      --
      Only the State obtains its revenue by coercion. - Murray Rothbard
    2. Re:Which version of OpenGL? by K.+S.+Kyosuke · · Score: 1

      At this point, don't settle for anything less than Vulkan!

      --
      Ezekiel 23:20
    3. Re:Which version of OpenGL? by silverdirk · · Score: 1

      1.x, since it's easier to prototype with, and because the codebase is 13 years old. I don't see any convenient way to assemble sets of polygons into buffer objects without a framework or modelling tool... but patches welcome!

      --
      Mark of the Coder fades from you. You perform Opening on World of Warcraft. Warcraft crits GPA for 4. GPA dies.
    4. Re:Which version of OpenGL? by 140Mandak262Jamuna · · Score: 1

      Thanks.

      --
      sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  7. Re:OpenGL in BASH eh? by glitch! · · Score: 1

    Now lets see you do that in COBOL.

    Of course! A PICTURE really should be a 3D picture, In EPCDIC of course.

    --
    A dingo ate my sig...
  8. Just because you can... by trickyb · · Score: 1

    doesn't mean you should.

  9. Is this a joke? by Casandro · · Score: 1

    I mean if I was trying to make a joke about a C++ developer making shell scripts, I'd have used something like that.

    I mean seriously, you don't write built-in commands for that. You create a specialized language and write an interpreter for it. Once you have that, you can easily access it from the shell.

  10. comfort of your command line by mapkinase · · Score: 1

    You know how when you see the phrase for the first time in your life and you immediately realize how you have been missing this from your language for 30 years?

    This is one of such phrases:

    "comfort of my command line".

    --
    I do not believe in karma. "Funny"=-6. Do good and forbid evil. Yours, Oft-Offtopic Flamebaiting Troll.
  11. We've been able to render 3D in command-line by TheOuterLinux · · Score: 1

    Its called Blender, though it's "Python" and not "BASH." Matter of fact, a most of Linux programs have a headless mode. https://docs.blender.org/manua....

  12. Might Have A Use For This by friedmud · · Score: 1

    I might actually have a use for this. I'm part of a team developing scientific simulation software... we work a lot at the command-line and it is handy to be able to visualize solutions/inputs quickly. We have many tools for visualization - but having something built right into the command-line _might_ be useful (huge emphasis on *might*!).

    I'll definitely check it out...

  13. Re:More Angry Americans by Curtman · · Score: 1

    I come here to read angry Americans telling other angry Americans how stupid they are

    It's self evident at this point.

  14. Re:One more reason not to use bash by kammermusik · · Score: 1

    I don't know fish but judging from what I've read here (https://www.slant.co/versus/523/1602/~zsh_vs_fish) I'm not convinced. The only benefit over zsh I really find good is a (supposedly) good default config. But I've configured zsh years ago and I'm still using that very efficient configuration today. That's what I call return of investment. Yes, it is not 100% intuitive to configure zsh but it's got a helpful community. I've even written my own completion extensions, so how hard can it be?

    Calling zsh obsolete garbage implies you have not really used it.