Slashdot Mirror


Creating a Black Hole With OpenGL

There's a cool article on O'Reilly Net concerning using 3D graphic software to emulate black holes. Interesting article - with a lot of information about OpenGL and what you can do.

44 of 124 comments (clear)

  1. Black Hole EMULATOR? by Tassach · · Score: 4
    Simulate, OK. Emulate? I think not.

    This brings up an interesting idea of applying the horsepower of video cards to other purposes. A modern 3D accellerator is basically a dedicated co-processor with it's own RAM that's optimized to do specific math tasks really, really fast.

    I wonder if there are any serious scientific applications that could use this. If you are running a Beowulf cluster, you could possibly improve the performance of the entire cluster very easily. Of course, it would require custom software, but then Beowulf already needs that anyway.


    "The axiom 'An honest man has nothing to fear from the police'

    --
    Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    1. Re:Black Hole EMULATOR? by Dr.+Manhattan · · Score: 3
      I dunno about "serious scientific applications", but you can run cellular automota such as Conway's Life awfully fast with an OpenGL card...

      http://www.geocities.com/simesgreen/gllife/

      --
      PHEM - party like it's 1997-2003!
  2. Re:Black Hole in 3D eh? by SuiteSisterMary · · Score: 2
    Doesn't that hurt?
    Yeah...but it's such a GOOD hurt...
    --
    Vintage computer games and RPG books available. Email me if you're interested.
  3. It's incorrect by SIGFPE · · Score: 3
    It uses Newtonian gravity and the inverse square law with a lame hack to simulate an event horizon. This is no black hole simulator but a cheesy my-first-opengl program (no offence to the author intended - we all wrote our first OpenGL program). It'd be fun if it were a real black hole simulator - you get some interesting orbits in the presence of a black hole that can't be simulated using F=GMm/r^2. It's even more fun to render in the presence of a black hole bending light rays - there are some example images on the web and in Scientific American from some time in the last few years.

    Why is it a story on Slashdot?

    --
    --
    -- SIGFPE
  4. Re:This is lame by mozkill · · Score: 2

    this sounds dangerous to me... i will have to report this to the authorities... they will want to know what is going on over there. the last thing i want is to get sucked up in a black hole right after i buy a new house. that would really www.suck.com .

    --

    -- Betting on the survival of the media industry is a serious risk. I advise investing elsewhere.
  5. Creating a Black Hole with ASCII by seanmeister · · Score: 3


    Sean

  6. Re:ARG!!! by jmp100 · · Score: 2
    That's right. Don't take any guff from these fucking swine.

    These rabid Linux enthusiasts who responded to your posts are never going to be able to see the forest for the trees. The postulate "Linux good && Windows bad" dominates every thought they conceive with regards to computing, and they will never be able to expand beyond it and see that if you're happy programming under DirectX, then more power to you.

    It's sort of like the missionaries of old. They thought they were "helping" the natives of the cultures they visited, because they were too narrow-minded to conceive that anyone could be happy without living as people in their own culture lived.

  7. What nerve! by NuclearArchaeologist · · Score: 3
    I'm not going to settle for anything less than gammas bursting from my imploding monitor! The nerve of some people to give away substandard software. I'll bet they even think this OpenGL, Mesa thingy is educational.

    Maw! Get me that NT CD, I want implosions now, damnit.

    cperciva, have you been giving yourself mod points?

  8. Re:Cool, s/accelerators/accelerated 3D cards by DagSverre · · Score: 3

    Basically, you create particle accelerators to prove that the nature actually acts the way our mathematical models presume it does...running simulations on a 3D card really doesn't prove anything as it will always work after our mathematical models...after all humans program it!

    We have no way of knowing for absolutely sure that black holdes works the way the 3D cards say...I once read that you could travel through dimensions/time through a black hole. I'm not saying you can, I'm saying thatyou certainly can't prove it (or the opposite) by programming in OpenGL.

  9. Re:Here is an early demo by Enoch+Root · · Score: 2

    You're welcome!

  10. A much more accurate simulation by mike260 · · Score: 3

    // Clear the background to black to simulate the emptiness of space
    glClearColor( 0, 0, 0, 0 );
    glClear( GL_COLOR_BUFFER_BIT );

    // This accurately models the black-hole not emitting any light
    glColor3f( 0, 0, 0 );

    // Draws the boundary of the black hole
    glutSolidSphere( 1, 10, 10 );

    1. Re:A much more accurate simulation by JohnnyCannuk · · Score: 2

      Of course you mean:

      glColor3f( 0.0, 0.0, 0.0 );

      and not

      glColor3f( 0, 0, 0 );

      After all the 'f' does stand for float... (he he he ..just being a nit picker - it's still a humerous post)

      --
      Never by hatred has hatred been appeased, only by kindness - the Buddha
    2. Re:A much more accurate simulation by JohnnyCannuk · · Score: 2

      Touche

      --
      Never by hatred has hatred been appeased, only by kindness - the Buddha
  11. Re:DirectX version by g_mcbay · · Score: 2
    However, I'll take the ease-of-use of OpenGL over D3D anyday. Carmack does too, among a few developers. I wonder why? ;-)

    Nobody really chooses OpenGL over D3D for 'ease-of-use' anymore. This might have been true during the days of DirectX 3. Ever since DX5 (and especially 6 & 7), D3D is as easy to use as OpenGL.

    Of course, I'm not really advocating D3D use here. I'm a graphics programmer myself and choose OpenGL, but for portability reasons.

    If the DX APIs were cross platform, I'd use them.

    Its really nice to have integrated sound/3D and 2D framebuffer APIs...As is now, I tend to use SDL (which more or less mimics a lot of DirectX functionality, but has a cross-platform core and supports OpenGL)

  12. Re:An amusing note regarding Mesa... by Performer+Guy · · Score: 2

    Your observation is a little bit dated, things have changes. Brian has a good relationship with SGI and has AFAIK was given the conformance tests to run a long time ago under a special agreement to ensure Mesa is high quality.

    Also the license for OpenGL has changed recently, the SI is now Open Source and you can pretty much use the OpenGL trademark if it runs of a free operating system and passes the appropriate tests. The conformance tests are also more freely available as announced recently.

    The big issue for OpenGL is quality, you can't call any old thing OpenGL. It requires testing, and everyone who has ever shipped OpenGL has been required under license to pass those tests. Basing a driver on Mesa is not sufficient, you must test the driver implementation to be allowed to call it OpenGL. So saying a particular implementation on a specific set of hardware is OpenGL has a very specific meaning. If this wasn't the case OpenGL would be of much less value as a standard.

  13. Re:why this story? by Omnifarious · · Score: 2

    Actually, the real value is not so much in the stories themselves. Almost invariably, when someone posts a stupid story, somebody who knows what they're talking about comes up and corrects them. It's neat actually.

    In fact, your post made me realize that my graphics knowledge from 5-6 years ago is horribly out of date, and that I need to read up on it a lot before I say anything about it again. :-)

  14. Now all we need.... by RJ11 · · Score: 2

    Great, now all we need are pocket fusion-generators and a better display technology and every datacenter can have its own universe!

  15. News? by mike260 · · Score: 2

    I don't mean to be all negative, it's a nice demo an all, but there are more OpenGL particle-systems demos out there than there are particles in this one.

  16. Recreating the Big Bang with Maxigamer Phoenix by zpengo · · Score: 2
    I was fiddling with my computer once and forgot to do something, and blew up my Maxigamer Phoenix card. Does that count? :o)

    --


    Got Rhinos?
  17. This is lame by cperciva · · Score: 5

    Come on, this is just a classical gravitational model piped into an OpenGL model. There are no visual distortion caused by the black hole, and no relativistic physics anywhere.

    If you're going to call it a black hole simulation, do it right. Otherwise, call it a solar system simulation.

    1. Re:This is lame by ackthpt · · Score: 2

      It sorely tempts me to sit down and finally code a a java version of some old, old game I once played where players launched missiles among gravitational bodies of varying size and density. Do it in 3D and toss in some black holes and the occasional supernova and it just might be worth the time. ;)

      --

      A feeling of having made the same mistake before: Deja Foobar
  18. Now if only Linux had standardized OpenGL. by AFCArchvile · · Score: 2
    Microsoft put OpenGL on systems in 1996, well before 3d accelerators became popular, and way before Linux was even heard outside of suspendered bearded road-apple sessions. Sure, it was a software emulation driver, but at least it was something. I've seen the MesaGL drivers for the Voodoo 2 on Linux, and Quake 2 looks like crap! There's color abberations all over the place, inconsistent performance, etc. Just imagine what it would be like on the Linux equivalent of 3DSMAX!

    I'll have to give Microsoft credit for standardizing OpenGL on Windows. Because it sure isn't anywhere near organized on Linux!

    --
    "Ancillary does not mean you get to rule the world." --U.S. Circuit Judge Harry Edwards, speaking to the FCC's lawyer
  19. Direct X a Standard!?!?!?!?! NOT! by MikeV · · Score: 2

    Let's see, I think even my watch can run OpenGL/MesaGL code. Come on, if you want to use DickX, you have to use Microsoft Windows. There's no standard to it other than Microsoft's agenda. OpenGL ran fine on Win32, but no, MS couldn't have someone else succeeding on their platform. It's the same with Netscape. MS wants to dominate everything that runs on MS and will go to all ends to kill competition. OpenGL/MesaGL runs on more platforms than I can spit at - it's as close to a Standard as you'll come in 3D development. DirectX is just another Microsoft trap. Once you've developed in that, you'll be trapped in Microsoft and porting to another platform is sheer hell. IE - Lokisoft expended much effort porting Heavy Gear from DickX to OpenGL. Now it just needs to be tweaked a little to run on any of a number of platforms, including Microsoft.

    But then, you know all this and are just stoking the flames, right?

    -- I think, therefore I...Uhm, what was I saying?

    1. Re:Direct X a Standard!?!?!?!?! NOT! by Fervent · · Score: 2
      It's kinda like driving a Ferrari in a school zone when the highway is right over there...

      Not really. I don't know if it's due to a lack of X window optimization or what, but OpenGL demos I create in Linux seem to run far slower than the same ones I create in Windows 2000. And I'm not using some exotic video card (Voodoo 3).

      Isn't C++ a little bit of an overkill just for a measly text program?

      Not if I'm working with a lot of objects. Granted, I could use structs, but I like to use new technology when I can help it. For a quick text program, shelling out some lines in gcc is adequate.

      if in the future you ever want to introduce portability into your applications, using DirectX is like shooting yourself in the foot...

      Not really. A lot of the commands are functionally the same, and it doesn't take much to run a "replace" in the text editor of your choice. OpenGL may have slightly more portability, but you pay for it in performance. Besides, if you're porting an application there will always be portability issues. You can't just port an OpenGL title from one platform to another and not expect to do a considerable amount of optimisation (as Carmack saw with Quake 3).

      --

      - I don't care if they globalize against free speech. All my best free thoughts are done in my head.

    2. Re:Direct X a Standard!?!?!?!?! NOT! by Fervent · · Score: 2

      But I solely writing 3D apps on the Windows side. I'm serious. I rarely use Linux (except for writing quick C++ text programs).

      --

      - I don't care if they globalize against free speech. All my best free thoughts are done in my head.

  20. Black Holes on the desktop... by ackthpt · · Score: 5

    I already have a black hole simulator on my desktop. It's called a computer, defined as a black hole in the desktop which continually sucks money out of my wallet, at the speed of light, and is never seen again. I assume done there is a mass of pennies so dense that very few practical value rays fail to escape. Such is a hobby...

    The logical path for this is to: Laptop, palm and then some pocket computer which could directly interface to the wallet and shorten the path the money has to move.

    --

    A feeling of having made the same mistake before: Deja Foobar
    1. Re:Black Holes on the desktop... by ackthpt · · Score: 2

      I still consider my SparcIPX a nice fast compuer 8)

      Games? Who's got time for games when there's code to write? ;)

      --

      A feeling of having made the same mistake before: Deja Foobar
  21. Re:ARG!!! by treke · · Score: 2

    It's sort of like the missionaries of old. They thought they were "helping" the natives of the cultures they visited, because they were too narrow-minded to conceive that anyone could be happy without living as people in their own culture lived.

    It's not that they can't be happier in their own culture, but that they can be happier living life differently. Sometimes it's just that people are better off living life differently. It's the same thing with Linux Advocacy. The most advocates (not trolls) think that Windows users would be happier better off in the long run if they weren't using Windows. This may or may not be true, but it is not discounting that Windows is getting the job done, and the users may actually be happy with the current system.
    treke

  22. Small OpenGL demo's by BlackHat · · Score: 2

    More fun like that at the OpenGL Challenge.
    Most entries are GLUT or near enough to compile on Linux, Mac etc. Lots of cool ideas.

  23. Speaking of Hawking and Digital Music... by mr.ska · · Score: 2
    If you like Hawking, and are a proponent of digital music, you owe it to yourself to check out the 3 MP3's that are currently available at MC Hawking:

    While there are dozens of other sites on the web devoted
    to Stephen Hawking's scientific achievements, I am unaware of a single
    site (aside from this one) devoted to his career as a lyrical terrorist.

    --

    Mr. Ska

  24. why this story? by [verse]Eskil · · Score: 5

    Why do Slashdot keep posting stuff like this on computer graphics? Any one how reads openGL.org knows that there are about a zillion particle demos out there.

    Some time ago there was a story about AGP 8X and who ever wrote the story asked why we would need it since we already got firewire.... Don't even know were to start complaining about that one.

    And its not like there hasn't been any graphics storys to cover. The advancements in hardware accelerated programmable shades has fundamentally changed the way people think of graphics hardware, softimageXSI for Linux, Linux on onyx3, the alternative to openGL SMASH, rendering whit natural light, new 3D displays....the list goes on and on.

    I think that slashdot is one of the greatest sites on the net but every time i read some thing regarding my area of expertise that is wrong I start to question the credibility of slashdot on areas i don't know much about.

    Please, if you what to cover graphics please do so, but get some one who works whit graphics to do it. A "ask slashdot" on how to improve the site may also be a good idea.

    Sorry about the rant, i just could not get my fingers of the keyboard.

  25. Re:Here is an early demo by Anonymous Coward · · Score: 2

    I just have to say thank you, Enoch Root. By getting a goatse.cx link modded up as informative, you have destroyed my last scraps of faith in humanity. I can't decide whether to go on a multi-state murder and robbery spree, or just shoot myself.

  26. Re:DirectX version by UnknownSoldier · · Score: 2

    > Is there a DirectX version?

    Why? Doesn't the OpenGL version work?

    Lets end this now before it erupts into a lame flamefest about "OpenGL roxs.. Direct3D blows" ... remember, BOTH API's are functionally equivalent.

    > I'd prefer to work in that API.

    Which one? DirectX or D3D ? Yeah, DirectX is ok.

    However, I'll take the ease-of-use of OpenGL over D3D anyday. Carmack does too, among a few developers. I wonder why? ;-)

    A nice clean, orthogonal, and portable rendering API, what more do you want?

    Cheers

  27. Re:OpenGL is a red herring here by Jimmy_B · · Score: 2

    Having done some development with HL mods, I agree with your statement that a very small percentage of the source code consists of 3D-API related things (probably even less than 2-5%). However, while the percentage of the source code is small, the percentage of the processor load is very high. The geometry transform and lighting (handled by the API, in systems without coprocessors for that) make up about half the CPU load, all of it doing simple and redundant geometry transformations.


    ------------------

  28. Java3D by harmonica · · Score: 2

    Do it! Use Java3D, it even gets hardware-accelerated on some platforms...

  29. Black Hole in 3D eh? by Ribo99 · · Score: 2

    My computer simulates a black hole well enough by sucking all my money in to it, thank you very much.
    That or my girlfriend. Do you know how expensive movies are nowadays?

    ---

    --
    I wear pants.
  30. Emulating black holes... by neutron42 · · Score: 3

    ...I didn't think OpenGL sucked _that_ much.

  31. black holes & linux by Elby+23 · · Score: 2
    This is just another example of Linux playing catch-up with Microsoft. Microsoft already sucks.

    *rimshot*

    -lb

  32. An amusing note regarding Mesa... by phlake · · Score: 3
    An amusing note regarding Mesa and the use of the license trademark "OpenGL": Mesa does not claim to be an implementation of OpenGL (and it can't, not without Brian Paul paying much money to claim this). The Mesa website specifically requests that Mesa 3D NOT be referred to as "Mesa OpenGL". Great. That's cool. They provide an excellent "workalike". Mesa is extremely useful.

    The humor comes from noting that opengl.org, the official OpenGL website, refers to the Mesa 3D library as "Mesa OpenGL". Which, according to their own rules, they're not supposed to do...

  33. Microsoft Reply... by Electric+Angst · · Score: 3

    Upon hearing this news at Redmond, a Microsoft PR person had this to say...

    "It's good to hear that technology had gone so far forward, but we should remind you that Mircrosoft is still at the head of innovation. So OpenGL can simulate a black hole, DirectX has sucked that hard for quite some time."

    (Obligitory, I know.)
    --

    --
    Feminism is the wild notion that women are human beings.
  34. What about Mandelbrot? by FascDot+Killed+My+Pr · · Score: 3

    I would argue that Hawking IS an explorer--more so than a non-theoretician. If you believe (as I do) that the laws of physics (and especially of mathematics) are REAL in the platonic, idealistic sense then what Hawking does is exploration. He's certainly not an inventor...
    --
    Linux MAPI Server!
    http://www.openone.com/software/MailOne/

    --
    Linux MAPI Server!
    http://www.openone.com/software/MailOne/
    (Exchange Migration HOWTO coming soon)
  35. OpenGL is a red herring here by Junks+Jerzey · · Score: 3

    3D APIs get talked about as if they're doing all the work. OpenGL and Direct3D are just that--APIs--and there's nothing magical about them. It's not like OpenGL is doing the "creating" here. It's just being used for the back-end polygon rendering. That's it. The rest of the code has nothing to do with OpenGL.

    One other thing I'd like to add while I'm here is that in a typical 3D game, only about 2-5% of the code involves 3D API calls. Two to five percent. There's a consistent myth that OpenGL rendering is the bulk of most 3D games and such, which is certainly not even close to true.

  36. Re:DirectX version by NaughtyEddie · · Score: 2
    Direct3D is part of DirectX so I fail to see your distinction.

    Anyway, the two APIs are not functionally equivalent, unless they've added 3D textures to DirectX while I wasn't looking.

    --

    --
    It's a .88 magnum -- it goes through schools.
    -- Danny Vermin
  37. Technically ... by NaughtyEddie · · Score: 2
    This isn't a black hole emulation done using OpenGL, it's a black hole emulation done using a standard Newtonian physics engine and then rendered using OpenGL.

    Shame, really, because there is potential to use OpenGL's image processing hardware to actually calculate large 2D fluid dynamics problems, and doing that would definitely count as news. You'd blow a Cray out of the water with a Voodoo3.

    --

    --
    It's a .88 magnum -- it goes through schools.
    -- Danny Vermin