Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (762)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (846)
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  
  anti-aliased graphics.  (Read 1742 times)
0 Members and 1 Guest are viewing this topic.
Offline jorrit5477

Innocent Bystander

Java games rock!

« Posted 2004-11-08 17:24:05 »


I just started with programming games in Java (been playing with Flash and ActionScript2.0 quite a bit, but stumble upon limitations which Java can easily overcome), and got a bit curious about graphics. Skimming my way through a book by David Brackeen (what do you think about it btw, if you know it?).
In his book he is using the AWT to draw graphics on the screen, but unfortunately translucent graphics are not hardware accelerated. So to keep things fast and stable, he suggests to keep the edges of your graphics jagged and take it as it is.

But I think there must be a way to have the graphics anti-aliased (and hardware accelerated). Do I have to use OpenGL bindings to do this? And is it better to use an API like jogl or LWJGL instead of the AWT or should I learn the game programming first and the graphical details later?

Offline Malohkan

Senior Devvie

while (true) System.out.println("WOO!!!!");

« Reply #1 - Posted 2004-11-08 21:29:15 »

try using
when you start up your game.  I don't know exactly what it does, or when all it works, but aparantly it's supposed to hardware accelerate translucent graphics Smiley
I also try another little technique when I can....

If I have an anti-aliased image, like a planet, over a background that tiles, or is in some way relatively unchanging, I make a new BufferedImage that's opaque and draw the tiled background on it FIRST, then draw on the planet.  Since the stuff under it never changes, you never know there's a difference.  

Admin and Game Developer at
Play Rimscape!    |    Play Conquer!
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #2 - Posted 2004-11-09 04:53:14 »

Uhm... for clearing things up a bit. For sprites and the like you can either use opaque, bitmasked or translucent images. Opaque images have no transparency at all. Bitmasked images have pixels which are either fully opaque or fully transparent. Translucent images have a seperate alpha channel... so you have 256 different "shades" of transparency there.

Ok. That's the one part.

And antialiasing is that stuff used for lines/text etc. It's also some kind of fullalpha, but all those pixels are generated at runtime (and setting that transaccel flag doesn't help at all right now). Antialiasing is really slow if you do it on a frame by frame basis.

Well, if you want to use fullalpha you can use that flag, but you won't get consistent performance across different platforms. Using LWJGL (or JOGL) helps. [If you want lots of blending or rotation opengl is the way to go]

However, most games can look perfectly fine with simple bitmasked images. It really depends on the style you want to achieve and the tricks you're able to use. You can for example make a perfect looking breakout game without using full alpha. The trick is simply using a single color background and have the ball image copied over into a small image with the same color as the background (at the beginning).

So, use simple opaque/bitmasked images at the beginning. Learn the concepts etc and move on.

My first game for example (TC 256 color mode) didn't even had any images at all. Needless to say that it really sucked (as everyone's first game heh Wink).

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hauk

Junior Devvie

Guitar, Norse Mythology, java and women=life

« Reply #3 - Posted 2004-11-21 15:08:41 »

Just to answer one of ur small questions. I have David Brackeens book and it COOL. I'm on the part where u use the simple screen manager. I haven't even attempted the 3D stuff yet.



I want to become a hermit and live in the harsh wastelands of Norway. I want to have a cloak made of bearskin and hunt the demons of the night.

I was born for a reason and am not about to lie down and die like the rest of you. Anybody with me?
Pages: [1]
  ignore  |  Print  

EgonOlsen (359 views)
2018-06-10 19:43:48

EgonOlsen (360 views)
2018-06-10 19:43:44

EgonOlsen (298 views)
2018-06-10 19:43:20

DesertCoockie (533 views)
2018-05-13 18:23:11

nelsongames (850 views)
2018-04-24 18:15:36

nelsongames (836 views)
2018-04-24 18:14:32

ivj94 (1283 views)
2018-03-24 14:47:39

ivj94 (408 views)
2018-03-24 14:46:31

ivj94 (1070 views)
2018-03-24 14:43:53

Solater (417 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!