Show Posts
|
|
Pages: [1] 2 3 ... 11
|
|
9
|
Java Game APIs & Engines / Java 2D / Attached windows
|
on: 2005-12-12 16:02:57
|
|
On Swing/AWT, is it possible to create "attached windows" i.e. the WinAmp player/equalizer/playlist windows ?
Well, the docs don't say anything, so I don't think so.. But it could be a nice feature.
|
|
|
|
|
11
|
Java Game APIs & Engines / Java 2D / Re: RFE: push/pop Java2D graphics state - ACCEPTED
|
on: 2005-11-18 10:48:05
|
|
Good point indeed. At least we all can live without push()/pop(), but..
Creating and destroying the Graphics does not come for free. This is expecially true for animation. push()/pop() is expensive too, but less.
Maybe push()/pop() and create()/dispose() could coexist. This would give developers the best from the two approaches.
Some benchmarks could outline the cost of create/destroy. In my experience I get remarkable speed gains when saving/restoring the current Color,transform instead of creating new Graphics objects in a paint loop.
Also, I can imagine that a call to dispose() would get rid of any unmatched push/pop calls.
|
|
|
|
|
15
|
Java Game APIs & Engines / Java 2D / Glyph metrics etc
|
on: 2005-10-19 12:59:08
|
|
Hello,
I have some questions:
1) how to determine the max pixel with of the characters in a font ? Font.getMaxCharBounds() does not return correct values (expecially with some italic fonts). A silly workaround is to find the max size of the chars outlines bounds..
2) why drawString() gives so different visual results from drawing a glyphVector ?
Mik
|
|
|
|
|
16
|
Java Game APIs & Engines / Java 2D / Re: FBO accelerates translucent VolatileImages
|
on: 2005-09-09 15:53:12
|
Chris, reading the bug database comments and evaluations is really interesting. I have a bit off topic Q about the OGL Java2D implementation: how did you emulate the Porter-Duff alpha compositing rules (SRC_OVER mainly) with an ARGB offscreen buffer (i.e. the FBO or the Pbuffer) ? I have no problems if the dest pixels are opaque, but I'm getting black artifacts when the blending takes place on fully translucent dest pixels. It seems that the dest RGB is taken into account when computing the blend result. I did a lot of experiments and I ended up to find only a viable workaroud but nothing more. Please read this post if you have time: http://192.18.37.44/forums/index.php?topic=8800.0Cheers, Mik
|
|
|
|
|
22
|
Java Game APIs & Engines / OpenGL Development / Re: OffScreen rendering with EXT_framebuffer_object
|
on: 2005-08-29 09:12:25
|
|
Many thanks Spasi. You saved me a lot of improductive testing. FBO is indeed a nice feature but I suppose it's still too much early stage. I read somewhere that FBOs cannot be created when Anisotropic Filtering is on. Also NVIDIA says they will support anti-aliasing in FBO in future drivers, but they do not say anything about AF.
Cheers,
Mik
|
|
|
|
|
23
|
Java Game APIs & Engines / OpenGL Development / Re: OffScreen rendering with EXT_framebuffer_object
|
on: 2005-08-27 14:59:33
|
Thanks for the code. I already did that (by reading the specs  ). I also tried to create an 8 bit stencil buffer by implementing similar code but even if it doesn't give any error, it does not work. I've double checked the source and it seems to be ok. First I created the color buffer and attached it, then the depth buffer and last the stencil. All attached to the same FBO.
|
|
|
|
|
25
|
Java Game APIs & Engines / OpenGL Development / Re: OffScreen rendering with EXT_framebuffer_object
|
on: 2005-08-26 09:10:39
|
At last I have the FBO working: init 1 2 3 4 5 6 7 8
| EXTFramebufferObject.glGenFramebuffersEXT(fbIDbuf); EXTFramebufferObject.glGenRenderbuffersEXT(rbIDbuf);
EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, fbIDbuf.get(0)); EXTFramebufferObject.glBindRenderbufferEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, rbIDbuf.get(0));
EXTFramebufferObject.glRenderbufferStorageEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, GL11.GL_RGBA, getPhysicalWidth(), getPhysicalHeight()); EXTFramebufferObject.glFramebufferRenderbufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_COLOR_ATTACHMENT0_EXT, EXTFramebufferObject.GL_RENDERBUFFER_EXT, rbIDbuf.get(0)); |
make current: 1
| EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, fbIDbuf.get(0)); |
dispose 1 2 3 4 5
| EXTFramebufferObject.glDeleteRenderbuffersEXT(rbIDbuf); EXTFramebufferObject.glDeleteFramebuffersEXT(fbIDbuf); EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0); EXTFramebufferObject.glBindRenderbufferEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, 0); |
For a "windowless" application I have to create a shared PBuffer first. The strange thing is that I get a 1280 error after disposing the FBO and making the shared PBuffer current. From the performance point of view, I get 1:1 against the PBuffers version, but the API is much simpler.
|
|
|
|
|
26
|
Java Game APIs & Engines / OpenGL Development / Re: OffScreen rendering with EXT_framebuffer_object
|
on: 2005-08-25 19:13:46
|
|
So you suggest me to read pixels from the texture using glGetTexImage() ? Do you know how it performs compared to glReadPixels() ?
The problem for me is a bit more complex: I use a hierarchy of classes that implement a gl graphics "context". The context is abstract but it defines concrete methods for reading pixels. These methods use glReadPixels(); Ok, I could solve this issue by re-working the classes..
Anyway, I still have initialization problems. I'll do further checks and test. Any help appreciated.
|
|
|
|
|
28
|
Java Game APIs & Engines / OpenGL Development / OffScreen rendering with EXT_framebuffer_object
|
on: 2005-08-25 10:20:35
|
After having successfully used the PBuffers for offscreen rendering with LWJGL I would like to use the FrameBuffer Object for doing offscreen graphics. The docs are unclear (at least for me) and I didn't manage to have something working. My aim is not to use render-to-texture, but only allocate an FBO, bind it to a ARGB 32bit Render Buffer Object and then read the pixels back from it. My init code: 1 2 3 4 5 6 7 8 9 10 11 12 13
| IntBuffer fbID = BufferUtils.createIntBuffer(1); IntBuffer rbID = BufferUtils.createIntBuffer(1);
EXTFramebufferObject.glGenRenderbuffersEXT(rbID); EXTFramebufferObject.glGenFramebuffersEXT(fbID);
EXTFramebufferObject.glRenderbufferStorageEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT,EXTBgra.GL_BGRA_EXT,getPhysicalWidth(), getPhysicalHeight()); EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT,fbID.get(0)); EXTFramebufferObject.glFramebufferRenderbufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_COLOR_ATTACHMENT0_EXT, EXTFramebufferObject.GL_RENDERBUFFER_EXT, fbID.get(0)); EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, fbID.get(0));
.. GL11.gl calls here. |
checkError() signals an error when I call glRenderbufferStorageEXT(). What I'm missing ? Help appreciated (Spasi, are you there ?).
|
|
|
|
|
30
|
Java Game APIs & Engines / Java 2D / Re: RFE: push/pop Java2D graphics state
|
on: 2005-07-23 15:59:18
|
|
The addition of the push/pop Graphics2D methods doesn't mean more complexity of the api. You could still use create/destroy. Code compatibility will be guaranteed anyway.
Far from forcing the re-implementation of Graphics2D as OpenGL-like state machine, the addition of the push/pop methods will enable a certain degree of optimization in the pipeline and will help us to keep code very clean, simple and fast.
Try to translate this pseudo code into current java2d code.
g2d.pushContext(AFFINETRANSFORM|CLIP|PAINT); // save AFFINETRANSFORM, CLIP, PAINT g2d.setTransform(newTransform) g2d.blabla(); .. g2d.pushContext(FONT); // save current font ... g2d.setFont(newfont) g2d.drawString(....); ... g2d.popContext(); // restore previous font .. g2d.drawString(....); .. g2d.popContext(); // restore previous AFFINETRANSFORM, CLIP, PAINT
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|