Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Suggestions for a really nice sun effect in OpenGL/Slick2D?  (Read 2734 times)
0 Members and 1 Guest are viewing this topic.
Offline Zarkonnen
« Posted 2013-03-22 19:14:52 »

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:



<a href="http://www.youtube.com/v/Y4RuyKPPaEg?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/Y4RuyKPPaEg?version=3&amp;hl=en_US&amp;start=</a>

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

<a href="http://www.youtube.com/v/jx0MivZge_s?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/jx0MivZge_s?version=3&amp;hl=en_US&amp;start=</a>

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.)
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #1 - Posted 2013-03-22 23:13:01 »

I made some sun effect here:

<a href="http://www.youtube.com/v/RtkNm9STtK4?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/RtkNm9STtK4?version=3&amp;hl=en_US&amp;start=</a>

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 Smiley).
Offline philfrei
« Reply #2 - Posted 2013-03-23 04:57:54 »

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.)



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


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


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.


Well, that was fun!  Smiley

[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]

"It's after the end of the world! Don't you know that yet?"
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Zarkonnen
« Reply #3 - Posted 2013-03-28 16:51:27 »

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!)

Offline Roquen
« Reply #4 - Posted 2013-03-28 20:39:59 »

Don't use ShaderToy, use https://www.shadertoy.com/
Offline Zarkonnen
« Reply #5 - Posted 2013-04-09 10:25:22 »

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. Smiley https://www.shadertoy.com/view/MdX3RM
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #6 - Posted 2013-04-09 10:38:46 »

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.
Offline Zarkonnen
« Reply #7 - Posted 2013-04-09 20:27:37 »

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.
Offline davedes
« Reply #8 - Posted 2013-04-09 21:30:26 »

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... Cool

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (113 views)
2014-11-26 15:22:04

toopeicgaming1999 (100 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!