Developing a game, need help

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Developing a game, need help

Wibowit
Hi,

I don't know how to name this thread, but I'll here post questions and bugs.

I'm primarily developing on Ubuntu 10.10 64-bit, Radeon HD 5770 and Catalyst 10.12 (I think).

I've downloaded master builds from 12th February and there are some bugs.

1. Newest JOGL builds doesn't fire windowDestroyNotify when closing window. Latest release build works fine.

2. setNumSamples doesn't work in both branches.

3. How to query the available pixel formats? Ie. color precision, depth precision, availability of AA and AF etc?

Here's the code that launches GLWindow: http://code.google.com/p/sokoj/source/browse/src/my/sokoban/configurator/LauncherThread.java?r=4ec420c75daa51dd61ab582eb144aabd8af5bcb2

And here's code that implements GLEventListener: http://code.google.com/p/sokoj/source/browse/src/my/sokoban/engine/MainEventListener.java?r=4ec420c75daa51dd61ab582eb144aabd8af5bcb2
Reply | Threaded
Open this post in threaded view
|

Re: Developing a game, need help

Sven Gothel
Administrator
On Sunday, February 13, 2011 17:05:15 Wibowit [via jogamp] wrote:

>
> Hi,
>
> I don't know how to name this thread, but I'll here post questions and bugs.
>
> I'm primarily developing on Ubuntu 10.10 64-bit, Radeon HD 5770 and Catalyst
> 10.12 (I think).
>
> I've downloaded master builds from 12th February and there are some bugs.
>
> 1. Newest JOGL builds doesn't fire windowDestroyNotify when closing window.
> Latest release build works fine.

yup, I have to fix this one :)

>
> 2. setNumSamples doesn't work in both branches.
?

AA unit tests work fine, they use setNumSamples,
have a look at the unit test source code:

http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleNEWT.java;h=8285a669914787edcf930c671f779af6fa84679d;hb=HEAD#l77

As you see, you have to set the caps _before_ realizing the window/drawable!
But to allow AA to work, you also need to set alpha: 'caps.setAlphaBits(1);'

>
> 3. How to query the available pixel formats? Ie. color precision, depth
> precision, availability of AA and AF etc?

Usually you don't have to do a thing, but to set your minimum required features
like the above, ie alpha to 1.
Then the native selection (or custome GLCapabilitiesChoser) will choose the best available.

However, you now can have a list of all available caps:

http://jogamp.org/git/?p=jogl.git;a=blob;f=src/newt/classes/jogamp/newt/awt/opengl/VersionApplet.java;h=7f234a0f83715416c138093763218fcfa3feb1b5;hb=HEAD#l103

This is already 'online' here:

http://jogamp.org/deployment/webstart-next/applet-version-jnlp.html

Hope this helps (without looking at your code).

Cheers, Sven

>
> Here's the code that launches GLWindow:
> http://code.google.com/p/sokoj/source/browse/src/my/sokoban/configurator/LauncherThread.java?r=4ec420c75daa51dd61ab582eb144aabd8af5bcb2
>
> And here's code that implements GLEventListener:
> http://code.google.com/p/sokoj/source/browse/src/my/sokoban/engine/MainEventListener.java?r=4ec420c75daa51dd61ab582eb144aabd8af5bcb2
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/Developing-a-game-need-help-tp2486309p2486309.html
> To start a new topic under jogl, email [hidden email]
> To unsubscribe from jogl, visit
Reply | Threaded
Open this post in threaded view
|

Re: Developing a game, need help

Wibowit
Thanks. setAlphaBits partially solved the problem. It now chooses right pixel format
Info: X11GLXGraphicsConfiguration[class javax.media.nativewindow.x11.X11GraphicsScreen[class javax.media.nativewindow.x11.X11GraphicsDevice[type X11, connection :0.0, unitID 0, handle 0xe24490], idx 0], visualID 0x49, fbConfigID 0x49,
        requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 1, Opaque: true], GL profile: GLProfile[GL4bc/GL4bc], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 16, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: true, Num samples: 8, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 8, Opaque: true], GL profile: GLProfile[GL4bc/GL4bc], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: true, Num samples: 8, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]]

GLX_SAMPLES 8
GLX_SAMPLE_BUFFERS 1
But it doesn't seem to have any effect, ie lines are still aliased.



I have another question, maybe stupid: how to implement skyboxing using shaders? Ie in RenderMonkey there are some boxes that are using uniform samplerCube. How to manage cubemaps with JOGL?
Reply | Threaded
Open this post in threaded view
|

Re: Developing a game, need help

Sven Gothel
Administrator
On Friday, February 18, 2011 20:20:21 Wibowit [via jogamp] wrote:

>
> Thanks. setAlphaBits partially solved the problem. It now chooses right pixel
> format
> Info: X11GLXGraphicsConfiguration[class
> javax.media.nativewindow.x11.X11GraphicsScreen[class
> javax.media.nativewindow.x11.X11GraphicsDevice[type X11, connection :0.0,
> unitID 0, handle 0x103c930], idx 0], visualID 0x29, fbConfigID 0x29,
>         requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green:
> 8, Blue: 8, Alpha: 0, Opaque: true], GL profile: GLProfile[GL4bc/GL4bc],
> PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated:
> true, DepthBits: 16, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue
> Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0,
> PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false,
> PBuffer-RenderToTextureRectangle: false],
>         chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green:
> 8, Blue: 8, Alpha: 8, Opaque: true], GL profile: GLProfile[GL4bc/GL4bc],
> PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated:
> true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue
> Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0,
> PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false,
> PBuffer-RenderToTextureRectangle: false]]
>

Please use a more recent jogl build, try jogamp-next for example,
it will dump you the X11 visual and fbconfig id in the 'chosen' part.

Read: Multisample: false, Num samples: 0 !!

So - no multisample selected !

When you use the jogamp-next, you will also see a list with all available caps,
if '-Djogl.debug=all' is enabled. Check if you even have multisample.
The newer build may have fixes in ..

BTW you bug report is invalid, read:
  http://jogamp.org/wiki/index.php/Jogl_FAQ#Bugreports_.26_Testing
We prefere the git hash and repository (master here, as you mentioned).

~Sven


>
>
>
> I have another question, maybe stupid: how to implement skyboxing using
> shaders? Ie in RenderMonkey there are some boxes that are using uniform
> samplerCube. How to manage cubemaps with JOGL?

JOGL just supports the GL binding in this regards, 'stupid' answer - same as
native or any other binding :)
Sure, cubemap is supported if available.

~Sven

Reply | Threaded
Open this post in threaded view
|

Re: Developing a game, need help

Wibowit
In reply to this post by Wibowit
I have finished working on my project. The project is still unfinished, lacks 90% of features I've planned but there was hard timeline for submitting project and problems I've encoutered consumed a lot of time.

Project is here: http://www.ii.uj.edu.pl/~tarsa/Sokoban.7z
It works on my system on Ubuntu 64-bit an Windows 7 64-bit, but my friend reported it doesn't work on his Windows 7 64-bit with 32-bit Java and GeForce 310M - there was crash in some dll.

One of the main problems that slowed down the development was freezes of NetBeans IDE (and crashes of NetBeans parser).

I've described the problem here (there is full story about crashes you can read, so I won't post it in this post):
http://netbeans.org/bugzilla/show_bug.cgi?id=196134

It seems that you're using too much interfaces :) I know it's fault on their side but if they fail to deliver a solution then maybe you should reduce interface inheritances. For example you can convert code like this:

interface A
interface B extends A
interface C extends B, A

to this:

interface A
interface B extends A
interface C extends B

I mean maybe you're placing unnecessary interfaces after extends keyword and that inflates the inheritance tree.
Reply | Threaded
Open this post in threaded view
|

Re: Developing a game, need help

Wade Walker
Administrator
I'm not sure that JOGL interfaces are the problem. Your bug report says that you have similar slowdowns in Eclipse, but I build JOGL 2 from source code in Eclipse all the time with no problem, even on very old machines. I've used JOGL 2 (as opposed to building it) in NetBeans and Eclipse just this morning, and it works fine (NetBeans 6.9.1, Eclipse 3.6.2, Win XP 32-bit SP2).