Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (775)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
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  
  Java2D not OpenGL'ed on Win  (Read 3243 times)
0 Members and 1 Guest are viewing this topic.
Offline javazoid

Junior Devvie




Where's Flender?


« Posted 2004-02-24 05:42:11 »

The first thing I want you to know is that I don't know OpenGL (temporary situation Grin), so the things I'm writing may be incorrect.

I did some experiments with Java3D and OpenGL (JOGL) on win. Just simple things. I ever wanted to draw something on a buffer and then grab the resulting pixels and save them as TGA with transparent background.
No way. I always got a fully opaque black background.

I did some investigation in order to get a transparent background. I posted almost everywhere without getting any convincing solution. Someone told me that I was initializing OpenGL in the wrong way. Some other suggested to chroma-key the background (UGLY! say goodbye to speed and antialiasing).

Now I am almost certain that the reason is the implementation of OpenGL on windows: ChoosePixelFormat does not give any background transparence, even if requested. Maybe It's a fault of the Microsoft OpenGL implementation. I don't know.

Now, talking about Java2D on win, I suspect it will be unlikely it will be implemented on top of OpenGL for the reasons above, at least without breaking backwards compatibility with the existing Java2D graphics software.

Offline princec

« JGO Spiffy Duke »


Medals: 1059
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2004-02-24 06:40:11 »

There is no such thing as a transparent background in a window, if that's what you're trying to do.

Cas Smiley

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #2 - Posted 2004-02-24 06:54:55 »

Quote
There is no such thing as a transparent background in a window, if that's what you're trying to do.

Cas Smiley


...unless you use Xwindows / linux. Most of the WM's support transparent backgrounds (although I've not yet seen an app that makes *sensible* use of this feature...)

malloc will be first against the wall when the revolution comes...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mark Thornton

Senior Devvie





« Reply #3 - Posted 2004-02-24 07:48:55 »

Quote
There is no such thing as a transparent background in a window, if that's what you're trying to do.

Cas Smiley


Windows does support bitmask transparency for windows. Most media players use this to implement their non rectangular appearance. Currently you have to use JNI to get this effect in Java.
Offline Abuse

JGO Ninja


Medals: 70


falling into the abyss of reality


« Reply #4 - Posted 2004-02-24 08:01:32 »

2K and XP also support full alpha.
Winamp has an option for it... though its completely useless ^_^
Offline princec

« JGO Spiffy Duke »


Medals: 1059
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2004-02-24 09:09:00 »

I meant in Java.

Cas Smiley

Offline javazoid

Junior Devvie




Where's Flender?


« Reply #6 - Posted 2004-02-24 10:47:56 »

Bitmask transparency is not needed here.

We need full alpha support in order to get high quality and speed from OpenGL.

Bu the question still remains an maybe some officials here can answer: is the lack of full alpha support the cause of the absence of Java2D OpenGL acceleration on win ?

Offline princec

« JGO Spiffy Duke »


Medals: 1059
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2004-02-24 11:20:29 »

OpenGL on Windows has full destination alpha channel support on most drivers these days.

Cas Smiley

Offline campbell

Junior Devvie




Java games rock!


« Reply #8 - Posted 2004-02-24 14:51:53 »

Quote
Bitmask transparency is not needed here.

We need full alpha support in order to get high quality and speed from OpenGL.

Bu the question still remains an maybe some officials here can answer: is the lack of full alpha support the cause of the absence of Java2D OpenGL acceleration on win ?


Could you please explain further why you expect a full hardware alpha channel will give you:
 - high quality, and
 - speed

As Cas mentioned, most modern OpenGL drivers support a full ("stored alpha") channel in hardware on some visuals/pixfmts.  This means that your destination surface is RGBA instead of RGB.  Note that this issue is completely separate from the discussion of whether you can have bitmask or translucent heavyweight windows.  Even if you have an OGL stored alpha channel, it does not mean that you will be able to "see through" the window when the alpha values are not 1.0.

Now, I should mention how this all relates to the OGL-based Java 2D pipeline.  In theory, the OGL pipeline could implement translucent VolatileImages (a new feature in 1.5) in hardware, using the concepts mentioned above (i.e. pbuffer with stored alpha).  However, this is not currently implemented, so if you ask for a translucent VolatileImage with OGL enabled, you will get back a system memory surface.  As I mentioned, it's just a Small Matter Of Programming, so I will file an RFE today and hopefully we'll get to it in an upcoming release.

With that implementation in place, I think javazoid will get the desired effect (hardware accelerated rendering to a translucent offscreen surface).

All that said, it should be clear now that this issue has nothing to do with the fact that the OGL-based Java 2D pipeline is not available on Windows in 1.5.  That issue has already been addressed countless times on this forum, but I can say for sure that we have a prototype working in-house, and we'd like to include it (as an alternate pipeline) in an upcoming release.

Chris
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #9 - Posted 2004-02-24 15:17:46 »

Thanks Chris.. getting accelerated translucent images in the OGL pipeline would be great.

On the other issue - is there anything happening in terms of supporting translucent or irregularly shaped windows?  I know there is an existing RFE for these, and all the major platforms support them now.

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

Junior Devvie




Java games rock!


« Reply #10 - Posted 2004-02-24 18:30:07 »

Quote
Thanks Chris.. getting accelerated translucent images in the OGL pipeline would be great.

On the other issue - is there anything happening in terms of supporting translucent or irregularly shaped windows?  I know there is an existing RFE for these, and all the major platforms support them now.


I just filed a new RFE:
5002129: OGL: translucent VolatileImages should be hardware accelerated

Should show up here eventually:
http://developer.java.sun.com/developer/bugParade/bugs/5002129.html

(Yes, that's right, we've entered a brave new world where bugid's start with the number 5... My eyes haven't yet adjusted.)

As for the non-rectangular window issue, the RFE is:
http://developer.java.sun.com/developer/bugParade/bugs/4479178.html

The AWT team explored adding this feature, but I believe it was too risky for Tiger (difficult to spec and implement consistently across all platforms).  Hopefully they'll get to it in a future release.

Chris
Offline javazoid

Junior Devvie




Where's Flender?


« Reply #11 - Posted 2004-02-24 19:31:28 »

Quote
Could you please explain further why you expect a full hardware alpha channel will give you:
 - high quality, and
 - speed


Nice to hear from you, Chris.

I was referring to the "bitmask" solution. Using a bitmask gives poor quality as you can only have 1 bit alpha channel.

Even more computing the bitmask through a chroma key is not the way to achieve speed because you have to build it by analyzing the grabbed image buffer.

I suppose that OpenGL can give you both aspects when it renders to a "stored alpha" RGBA surface, even with a certain degree of antialiasing and bilinear interpolation.

Quote
With that implementation in place, I think javazoid will get the desired effect (hardware accelerated rendering to a translucent offscreen surface).


At long last  Wink  That's exactly what I expected to hear from you. When you say "hardware accelerated rendering" do you also mean transforms and bilinear/bicubic interpolation ?

Thanks for the RFE and for your reply.

Offline sma

Junior Devvie





« Reply #12 - Posted 2004-02-25 16:14:45 »

Quote

Windows does support bitmask transparency for windows. Most media players use this to implement their non rectangular appearance. Currently you have to use JNI to get this effect in Java.

Or you could use SWT which offers this features on "selected" platforms Smiley  See an example, should work on Windows and Linux.

.: Truth Until Paradox!
Pages: [1]
  ignore  |  Print  
 
 

 
hadezbladez (40 views)
2018-11-16 13:46:03

hadezbladez (42 views)
2018-11-16 13:41:33

hadezbladez (23 views)
2018-11-16 13:35:35

hadezbladez (18 views)
2018-11-16 13:32:03

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

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

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

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

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

nelsongames (2035 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
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!