RenderCapabilities?

Does anyone know (trembovetski?) if there is an existing RFE to detect if certain rendering operations are hardware accelerated? I did a search, but didn’t find anything, but I could be looking for the wrong keywords. If it doesn’t exist, I’d like to file an RFE for it.

Looks like Java 7 is going to have PhotoComposite, which is great. The Direct3D pipeline is exciting, but it’s not enabled in all situations, so the capabilities of Java2D is really starting to diverge.

If you can detect if certain render operations are accelerated - like multiplicative blending with translucent, scaled and rotated sprites - that means you can have more smoke effects, more particle effects, better transitions, etc. If it’s not accelerated, you could “dumb down” the effects a bit.

I also have to agree - such an API is overdue.

Back in 1.4/5.0 almost all Java2D backends had more or less the same capabilities / weaks, but now its really changing.
An api like this would allow developers to deviced wether eyecandy XYZ is really woth the 1/4 fps rate.

lg Clemens

+1

There is BufferCapabilities (http://java.sun.com/javase/6/docs/api/java/awt/BufferCapabilities.html) and ImageCapabilities, but unfortunately they don’t always give correct results, there’s a bug against it somewhere but I don’t think it’s been fixed.

On the plus side, at least things are moving so fast with java2D that there is a reason why we need such an API.

I think that when things cool down then Dmitri T and and Chris C will be able to write more about this stuff and tell us exactly what is and isn’t accelerated (PS: i’d love you to write a blog dmitri 8) ).

I understand your concerns. I don’t think there’s a rfe filed.

Now, I believe that such API will be as useless as the current
capabilities stuff.

Suppose we had an api which can tell you which operations
we consider “accelerated”.

Do you really want to write endless checks for capabilities?
Poor folks who use Direct3D for their projects (prior to DX 10) have to,
and it’s no fun. And it doesn’t really guarantee that your app will
run fast, it will just guarantee that it will run.

Java2D can guarantee you that already - your app will always run.

What you really want to know is not what’s considered
“accelerated” but what’s fast. And we can’t always tell you that -
the same operations on one chip (or OS) may be way slower than
on another. Even on the same chip performance varies
wildly with different drivers. And, some operations may be slower
when combined with others - how can we express that?

I think applications should be self-adaptive. You can detect that
your framerate is low and adjust automatically - no need
for checking caps - most modern games do that.

Or have “high-mid-low” quality settings for user to choose like most
games do. After all, the user is in the best position to judge if
your game is slow or not.

We could also tweak the current caps stuff so that it better
reflects the reality - especially on X11 where we currently
consider that an image is “accelerated” if it’s cached
or resides in a Pixmap. Yeah, it’s accelerated in the 80-s sort of way
(wee, you can cache a sprite, wee! =)

At least on Windows in 6uN ‘accelerated’ will mean that you
get pretty much full acceleration. Same with the opengl pipeline
on all platforms.

Thanks,
Dmitri

P.S. Yeah, I wish I had a blog! But then I’d have to write on it!

Yes, a better word than “accelerated” might be warranted. Basically what we want to know is not “accelerated” but “rendering happens on the GPU, not the CPU”. Technically, is there an easy way to check that?

And you’re right, different graphics chips will have different speeds. But grabbing an image from the graphics card memory, compositing on the CPU, and sending back to the graphics card will always be slower, simply because of all the data traveling back and forth on the bus. (Not a big deal for a Swing app, but for games running at 60fps it can be a problem). That’s what happened back in 1.4 with translucent images, right? And there will be situations in Java 7 where this will happen? If so, I think a capabilities API would be nice.

You’re right, no one should be forced to write checks for capabilities, but I think it should be an option for game developers. I’d rather check for capabilities - an educated guess - rather than make wild guesses on what is slow or not. (Wild guesses would be required if the game auto-adjusts quality settings based on the frame rate)

I second that, if Java 2D wont accelerate certain operations using the GPU, I’d be better off using my custom software routines to do transformations and effects rather than using an AffineTransformation.

The RFE was accepted, and it’s here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6655124
I used some of the language from the comments in this thread. Thanks guys!

Thanks for filing!

Dmitri

Nice, I added my vote.

I was wondering Dmitri, it would be fantastic to have a list of what is or isn’t accelerated/GPU’ed once you’ve finished the work on the d3d pipeline.

Thanks 8)
Keith

Yes, I’m planning to do that. I may even do that in a blog if I get to
creating one.

Dmitri