Direct Access to Opengl

I am part of a group of programmers that are in the beginning phases of working on an open source game. We’ve had a lot of dicussion about what opengl wrapper/api to use for our game.

The only consensus so far is that I think we all prefer JOGL over LWJGL. The other choice was whether or not we wanted to use a scenegraph API (Xith or jME) or just do everything ourselves using JOGL. Since jME doesn’t support JOGL yet the decision of which to use, if any, was easily made.

The questions arising now are whether or not Xith allows direct access through it’s API to JOGL so if need be we can manupilate opengl directly or if we have do to some hacking to make this work. Does everything have to be done through the xith engine or can you use parts of it?

I better explination for this might be, say Xith doesn’t support Fog. And we need Fog. What is the best way to implement this feature. Should create a Fog object that extends some Xith class and access opengl that way? Is there a more elegent way? Is it worse than that?

I think you can do fog with xith - you don’t have to do it with jogl then.

I think the fog was just an example. The question is if there is something they need. Whatever it is, is it possible to extend xith without too much hassle.

[quote]I think the fog was just an example. The question is if there is something they need. Whatever it is, is it possible to extend xith without too much hassle.
[/quote]
Yes, Fog was just an example. A few more examples are things like:

  • Mouse-picking one of a million polygons
  • Stenciling (decals, looking out a window)
  • Accum buffer stuff like motion blur

Again, Xith might do these things, but I am just using them as examples. So could someone tell me what is envolved? Is it a matter of extending Xith or is it a matter of bypassing Xith?

Yeah, the thing is, you can do many things with xith already. Picking as an example can get even faster in xith, because you can use the bounds of objects for a selection of triangles so you don’t have to test intersections with all triangles. But what am I talking this stuff anyways - you want to acces jogl directly, for whatever reasons.
Do you have seen the Render to Texture thread? I think the aspect is mentioned there, or there are at least the people who know more about that stuff than I do :slight_smile:

Probably the best way to get features you need is simply to create them and get them added to the core. This way others benifit from your creation, and you benifit from others contributing fixes and maintining your code.

Fog was a third party contribution for example. Several months ago, I added Background and Foreground nodes.

It is a good idea to raise the topic in the forums, with the feature you are creating so that others can have a chance to make any suggestions on how you implement it before it goes in.

I created this diagram to help explain how the Xith3D renderer works when you are going though the com.xith3d.renderer and com.xith3d.scenegraph packages: http://xith.org/RenderPipeline

I don’t think there is really a clean way to add a feature such as (hypothetically since it’s already there) Fog without modifying the code. It would be nice to be able to do this though, some sort of abstract shader which the user could extend perhaps.

Good luck with your game.

Will.

Will, thanks for the information. I will share it with the rest of the team and see how everyone feels about that.