Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Java2D and Image-drawing speed  (Read 1465 times)
0 Members and 1 Guest are viewing this topic.
Offline NexusOne

Jr. Member
**

Posts: 92


Java games rock!


« on: 2003-07-18 23:15:16 »

In a single-player java2d game i'm making (first time) im getting disgusting rates of 5 frames per second when the current view is graphics-intensive, which slows the character to a crawl... I thought that the Images I had were ManagedImages since they were created through Component's createImage() but apparently these aren't fast enough. How can I *squeeze better performance* out of my java2d-based engine?
Offline kevglass
« League of Dukes »

JGO Kernel
*****

Posts: 5214
Medals: 49


Mentally unstable, best avoided.


« Reply #1 on: 2003-07-19 01:28:09 »

Arn't you meant to use createCompatibleImage() to get managed images?

Kev

Offline trembovetski

JGO Strike Force
***

Posts: 926


If only I knew what I'm talking about!


« Reply #2 on: 2003-07-26 01:19:42 »

You may be using some operation which is not accelerated, like translucency, compositing, antialiasing. Do a search on Java2D forum, there's plenty of threads covering this topic.
Games published by our own members! Go get 'em!
Offline Mark Thornton

Sr. Member
**

Posts: 473
Medals: 2



« Reply #3 on: 2003-07-26 02:58:16 »

Quote
You may be using some operation which is not accelerated, like translucency, compositing, antialiasing. Do a search on Java2D forum, there's plenty of threads covering this topic.


Finding out what is or isn't accelerated (or in the case of printing what causes the system to revert to using a big bitmap for the whole page) is something like playing a MUD. At least we get to cooperate, but it is way too hard to track down the details.
Offline DrBizzar0

Full Member
**

Posts: 175


Raj raj!


« Reply #4 on: 2003-07-26 03:04:43 »

Maybe should create a wiki for detailing that?
Offline AndersDahlberg

Full Member
**

Posts: 196



« Reply #5 on: 2003-07-26 13:38:53 »

Please fill out the information (provided by Abuse) that I started adding at "java2d" wiki page - someone good at wiki's should probably categorise it a bit better than I did too Grin
Offline NexusOne

Jr. Member
**

Posts: 92


Java games rock!


« Reply #6 on: 2003-07-28 00:07:23 »

i AM using translucency.... isn't there any accelerated translucency i can switch to?
Offline AndersDahlberg

Full Member
**

Posts: 196



« Reply #7 on: 2003-07-28 12:46:34 »

from http://wiki.java.net/bin/view/Games/Java2D

Quote

Currently accelerated Transparency is only possible using ManagedImages. (not with VolatileImages)

Also, currently only bitmask transparency is by default accelerated. However, there are flags to enabled hardware acceleration for images with a full alpha channel (Translucent). These flags also make AlphaComposite operations hardware accelerated.

The code to set the flags is :-

Code:

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

This Thread covers the flags in more detail http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=2D;action=display;num=1048663269;start=0#0
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.18 seconds with 20 queries.