Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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  
  2D Glowing Effects  (Read 3405 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 123
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2003-07-20 20:09:05 »

I'm writing a multiplayer asteroids style game, demo at:

http://www.cokeandcode.com/astroprime

I want to add shield, explosions, lasers and general effects. All of this things should really have that glowing style. Now I've seen Cas' Alien Flux, and that looks increadible. I realise thats done by using OpenGL and some sorta 3d stuff to get the style.

I'd rather stick to pure 2D but I'd like to get some similar effects. Has anyone got any tips on how to get the glowing style graphics and/or examples (with or without source).

Cheers for any feedback, help, heckling

Kev

Offline JuddMan

Senior Member


Medals: 1


Your Ad Here


« Reply #1 - Posted 2003-07-20 21:34:27 »

you may need to use translucency which kills the performance immediately as i discovered. eg. make some bright circle gradient... apart from that or dithering, not much luck when it comes to java2d.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #2 - Posted 2003-07-21 00:10:42 »

Quote
you may need to use translucency which kills the performance immediately as i discovered. eg. make some bright circle gradient... apart from that or dithering, not much luck when it comes to java2d.


Nah. Since the background is mostly black, you can precalculate the alpha in a paint program like GIMP. This would make it *look* like we're seeing "glowing" or partially transparent effects, but in reality we're not. BTW, GIMP has some nice lighting effects in its filter section. You might want to check them out.

Java Game Console Project
Last Journal Entry: 12/17/04
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline vydias

Senior Newbie




Welcome to my world!


« Reply #3 - Posted 2003-07-21 02:50:39 »

He might be using a color background in the future and its really best to take advantage of translucent images that won't slow your game down.

System.setProperty("sun.java2d.translaccel", "true");
System.setProperty("sun.java2d.ddforcevram", "true");

This allows you to create translucent effects on the fly. I'd start by adding a ALPHA variable to for each of your effects that can be dynamically changed based on the current effect state.

Then in your drawing do something like:
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, SHIELD_ALPHA));
                 g.drawImage(shieldImg,x,y,null);
                 g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));

then modify SHIELD_ALPHA based upon the glowing effect your after.

You will need at least java1.4.03 or greater to enable accelerated transparancy.
Offline kevglass

JGO Kernel


Medals: 123
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2003-07-21 04:52:22 »

I wasn't really intending to use a different background really, space is black Smiley

Thanks for the replies so far, I'll experiment and post back.

Kev

Offline krypto

Junior Member




while(true) { self.caffeinate (); }


« Reply #5 - Posted 2003-07-21 10:53:53 »

Kevin;
I would like to do something very similar to you, (but I will have a non-black background) for magic effects in my rpg. I think that the alpa/translucent images may work if I keep them small. Please do keep us posted.

P.S. This sparked my interest in things like transition effects which I started a new topic On.

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline vydias

Senior Newbie




Welcome to my world!


« Reply #6 - Posted 2003-07-21 16:19:41 »

Well ya but you could have planets or stars in the background and you lose nothing with alpha blended images using directdraw (windows anyway).

Kryto the alpha blending works great for magic effects and actually saves you video memory because you have fewer images loaded into memory and it looks a ton better.
Offline krypto

Junior Member




while(true) { self.caffeinate (); }


« Reply #7 - Posted 2003-07-21 16:37:50 »

Quote

Kryto the alpha blending works great for magic effects and actually saves you video memory because you have fewer images loaded into memory and it looks a ton better.


Great do you have any examples anywhere  Grin

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline MickeyB

Senior Member




my game will work, my game will work!


« Reply #8 - Posted 2004-03-30 17:25:16 »

hey Kev, what did you end up doing, and are you going to use anything similar in MiniAd?  I am looking to make starship weapons with a little more pizzaz then drawpoint, or drawLine, etc...

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline kevglass

JGO Kernel


Medals: 123
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2004-03-30 17:38:45 »

I found (during Astroprime) that the only way I could really get the type of effects I was looking for was by using alphaing and combining layers to give that intense "glowing" look.

Essentially, I just had sprites with alpha channels which were blitted over and over each other. In OpenGL this looks and works really really well.

However, for MiniAd since I want to stick to pure Java2D I might be a bit stuck for cool effects. However, I'm aiming full release at Java 1.5 and hence I might get some decent acceleration for alpha.

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline MickeyB

Senior Member




my game will work, my game will work!


« Reply #10 - Posted 2004-03-31 00:51:43 »

cool, thanks and good luck.

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline trembovetski

Senior Member




If only I knew what I'm talking about!


« Reply #11 - Posted 2004-03-31 02:03:42 »

Check out this article, it may give you some ideas:
 http://java.sun.com/products/jfc/tsc/articles/swing2d/index.html
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.

CogWheelz (12 views)
2014-08-01 22:53:16

CogWheelz (14 views)
2014-08-01 22:51:43

CopyableCougar4 (15 views)
2014-08-01 19:37:19

CogWheelz (19 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

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

List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
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!