Jump to content


Volumetric Phear


8 replies to this topic

#1 eyebex

    New Member

  • Members
  • Pip
  • 7 posts

Posted 30 July 2005 - 08:05 AM

Posted Image


Description
While originally striving to archive another effect (the famous "moving light source behind black letters" thing, making them visible by blending over the edges), I came up with this sphere which simulates light emitting from its center through holes on its surface. I was somewhat inspired by The Dome logo (a German Pop Music event) and Phear, a Teris clone.

The effect itself is not that complex, but as it turned out I had to face some unexpected issues. First of all, I had to learn it is not trivial to place equally spaced points (the centers of those discs) on the surface of a sphere. I read quite some web sites and Usenet posts, beginning from "Tesselating Geospheres" to "An Introduction to Generalized Spiral Points" until I came up with a solution that calculates Coulomb energies for a potential field.

Secondly, as you can see, the sphere is basically black and opaque (yeah, with those white discs). As I wanted the user to also see the light contributed by rays that face away from the user, I had to split the sphere into hemispheres, use the stencil buffer to render only the corona of the back-facing hemisphere, and then the whole front-facing hemisphere in a second pass, all with additive blending enabled.

You may download the Windows / OpenGL executable from my website. The C++ source code is included and requires my recently published GALE OpenGL framework to compile (I was using MS VC++ .NET 2003).

Have fun!

#2 Dia

    DevMaster Staff

  • Administrators
  • 1120 posts

Posted 30 July 2005 - 06:35 PM

Looks great! Thanks for sharing it.

#3 Reedbeta

    DevMaster Staff

  • Administrators
  • 5311 posts
  • LocationSanta Clara, CA

Posted 30 July 2005 - 06:54 PM

Nifty. Runs very slow on my machine, though (ATI Radeon 9600)
reedbeta.com - developer blog, OpenGL demos, and other projects

#4 eyebex

    New Member

  • Members
  • Pip
  • 7 posts

Posted 31 July 2005 - 05:12 AM

Yeah, it's not optimized for speed at all ... however, it should run smoothly on a 9600. But then again I remember having some issues on ATI cards (I recently changed my 9800 Pro for a 6800 GT), ATI seems to have some problems with display lists (which I use instead of Vertex Buffer Objects for simplicity). Are you using the latest drivers? I bet it runs smoothly on a comparable NVIDIA card ... :dry:

#5 Blaxill

    Member

  • Members
  • PipPip
  • 66 posts

Posted 31 July 2005 - 09:17 AM

I really like the effect, it looks cool. Run smooth on my machine ( x800xt PE :D )

#6 SpreeTree

    Valued Member

  • Members
  • PipPipPip
  • 265 posts

Posted 31 July 2005 - 06:24 PM

Very nice effect, I havn't had a look through the source code yet, but does it use any kind of shader technology?

Would it be possible to alter the effect slightly? I downloaded your solar system demo, and wondered maybe if the effect could be used to render some kind of glow effect around the sun, without resorting to shaders?

Reason I ask is that my current project deals with rendering sun's and various planet systems, and I am hoping to aim it as pre-shader technology. This might give it a little bit of a visual kick...

Spree

#7 eyebex

    New Member

  • Members
  • Pip
  • 7 posts

Posted 01 August 2005 - 04:24 AM

SpreeTree said:

Very nice effect, I havn't had a look through the source code yet, but does it use any kind of shader technology?
It's all done using texturing and additive blending, so no shaders.

SpreeTree said:

Would it be possible to alter the effect slightly? I downloaded your solar system demo, and wondered maybe if the effect could be used to render some kind of glow effect around the sun, without resorting to shaders?
Thanks for looking at my other stuff, too! Of course is possible to use this technique to simulate the sun's corona. However, I think I would use a different geometry for that. In the above effect, each disc is a light source and is modeled as a cone. As the sun emits light all over its surface, one maybe should use a whole different approach and render several screen aligned concentric discs with a fan-like pattern over the sun.

#8 bladder

    DevMaster Staff

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 01 August 2005 - 08:00 AM

Sweet effect - looks great. Ran perfetly.

#9 Steven Hansen

    Member

  • Members
  • PipPip
  • 86 posts

Posted 01 August 2005 - 07:08 PM

That is pretty sweet. Runs great on my development machine (X800 Pro AGP).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users