Sun

So, I bet you’ve been wondering what I’ve been up to lately…  You haven’t?   You selfish bastard.

 

Anyhow, I’ve gotten around to playing with this library I wrote for a bit.  I do so little programming on my own time these days and honestly, I never much cared for Gorgon (I felt it could have been better), that I haven’t bothered to try and write anything with it. That my users actually say it’s useful and well written comes as a complete shock to me. Anyway, this last week I mustered up some spare time and I created this abomination:

https://www.youtube.com/watch?v=PqPGa6P52LM

It’s not much, but it’s just a little thing I threw together to see if I could get a “bloom” type effect with a star.  I did.  And there it is.  Note how the surface of the star moves around and all that.  Neat hey?  No?  Shut up.

 

I’ve limited it to 60 FPS on purpose, but it is fairly swift.  I think at one point I was getting > 1000 FPS.  However, my vidja card is quite beefy, so take that with a grain of salt.  So… yeah…. that’s all I have to say.

Enjoy.

3 thoughts on “Sun

  1. Tape_Worm Post author

    I’d love to, but it’s currently in a very broken state right now. Once I get it back up and running (I am working on it a fair amount these days), I’ll gladly send you a copy.

    Until then here’s what I did: It’s an image (in a sprite) of a sphere with fractal noise (most 3D apps can do this), processed through 2 pixel shaders. The first shader is an “intensity” shader which filters the image based on a threshold to keep the higher intensity areas in the image and either darkens or excludes darker areas. I blit the result of that to a render target 4 times (a 256×256 texture, and each sprite was scaled down to 128×128, so one sprite per quadrant). When I blit those 4 sprites I use various levels of opacity and rotation for each sprite, this will keep it from looking too tiled. Then I blur the bottom two sprites using a Gaussian blur shader. I then blit the source image to the screen with a specified colour, and then using additive blending I blit those four processed images from the render target to the screen, scaled to the size of the source sprite.

  2. Zeraan

    I’ve been wondering what you do in your free time. I don’t check this page often because it’s not updated frequently, so that’s why I didn’t see this post until now. The sun looks real nice! I’d love to have that in space combat for my game. So if you don’t mind, could you provide me with the project so I can look at how you did it?

    On second thoughts, I might even replace all the star art in my game with this since it looks so awesome!

Comments are closed.