Suggestions for a really nice sun effect in OpenGL/Slick2D?

So I’m working on the star map for a space-based game, and I’d like really beautiful animated sun graphics. This is what I have so far, which makes heavy use of particles:

Y4RuyKPPaEg

This is pretty, but as people have remarked, not that much like an actual sun, which looks more like

jx0MivZge_s

Can you think of some method of generating a similar visual effect? (I’m using Slick2D, but can happily drop down into the raw OpenGL if needed.)

I made some sun effect here:

RtkNm9STtK4

If you like it, i could post some shader code to achive this (note this can be expensive, i would not render to many of these stars :)).

I’ve been experimenting with Perlin noise (Simplex noise, actually), and came up with these images using a tool that I have in development. I’m having a little trouble getting my 2D output to map to a nice sphere. However, they should animate pretty readily. Perhaps there is a way to blend an animation of something like one of these with another graphic to get something really sweet.

(The graphics data is generated and used as a source for a BufferedImage. Nothing else from Java2D was used.)

http://hexara.com/Images/solar.JPG

For this one, it works well if you put a well-aliased black disc in front to make an eclipse-type of effect. 8)

http://hexara.com/Images/solar2.JPG

I don’t know what this is, just messing with the settings of the tool.

http://hexara.com/Images/fieryfuzzball.JPG

Playing around with the radial gradient setting, it is possible to compress the color transitions to a point that is rounder, but the body of the sun looks kind of flat to me. But it might look nice with the edges animating. Yes, easy to scale to a smaller size.

http://hexara.com/Images/solar3.JPG

Well, that was fun! :slight_smile:

[EDIT: Simplex noise algorithms can be used for 3D, and animated via a 4th dimension. It has been used to make some outstanding planets, as can be seen in Ken Perlin’s slide presentation:
http://www.noisemachine.com/talk1/19.html]

Yeah, perlin noise seems to be the way to go. I’ve been playing with ShaderToy and following the advice from the slick forum and managed to create a fairly nice shader for making planets. (Haven’t actually looked into suns yet, but that should be easier!)

https://pbs.twimg.com/media/BGdWRCvCUAA2bBQ.png:large

Don’t use ShaderToy, use https://www.shadertoy.com/

Oh, wow! It even has a pretty neat sun effect: https://www.shadertoy.com/view/4dXGR4

Here’s my planet in action. :slight_smile: https://www.shadertoy.com/view/MdX3RM

As your planet looks static, you should render it only one time (to an texture or something), and use an VBO.
3D noise is just slow, so you will not be able to render many planets at the same time this way.
Generating an texture will be much much faster in the long run.

Agreed. Unfortunately, I’m having horrible problems with shader texture binding interfering with Slick. As it stands, this shader can basically render 400x400 pixels of planet at 60 FPS, and it doesn’t really matter if that’s one big 400x400 planet or 100 40x40 planets.

Can you explain your horrible problems? Maybe make a little standalone application that demonstrates the bug/issue.

Obviously the best choice is to use LibGDX or plain LWJGL/JOGL, since Slick wasn’t designed to use shaders… 8)