• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
staticVoid2

Java and JOGL for serious Game development?

6 posts in this topic

Hi,

 

I've recently being having a lot of headaches with C++ and OpenGL, I upgraded my OS to Ubuntu 14.04 and a few of my applications have stopped working and are throwing GLSL compilation errors. This is obviously due to the differences in opengl versions, is there anyway to enforce a particular version of opengl consistently throughout the development of a project in C++? I recently developed an opengl app on android and all the opengl methods were encapsulated in a GL10 class which made things so much easier... going back to C++ just makes me feel dizzy :(

 

I've always used GLEW, an extension library, which I believe (could be wrong here) is required to actually use any opengl API above 1.0 ? but I don't know if there is any way to throw a compiler error if the opengl version is incorrect. Also, I'm not entirely sure how I would install a previous version of opengl on my machine, it use to be that it was fully backwards compatible so that wasn't really an issue but they've removed a lot of methods in later versions of opengl.

 

I'm thinking about switching to using Java and JOGL for any future applications I develop because of this but I'm concerned about performance, has anyone here developed any graphically demanding games in Java/JOGL?

 

Thanks.

0

Share this post


Link to post
Share on other sites

Ok, so I'm running OpenGL 3.0, one of the first things I do in code is check my GL version number to make sure it is compatible through GLEW:

	if(!GLEW_VERSION_2_1)
	{
		cerr << "OpenGL version 2.1 or higher required" << endl;
		return false;
	}

When I compile my shaders I get the error:

 

error: 'in' qualifier in declaration of 'position' only valid for function parameters in GLSL 1.10.

 

> in vec3 position;

 

Even though the GLSL version should be at least 1.20.8 according to this: (for OpenGL 2.1)

 

http://en.wikipedia.org/wiki/OpenGL_Shading_Language#Versions

 

This is what is causing my headaches, I'm not sure if this is an error on my part or an error with GLEW.

0

Share this post


Link to post
Share on other sites

 

Ok, so I'm running OpenGL 3.0, one of the first things I do in code is check my GL version number to make sure it is compatible through GLEW:

	if(!GLEW_VERSION_2_1)
	{
		cerr << "OpenGL version 2.1 or higher required" << endl;
		return false;
	}
When I compile my shaders I get the error:
 
error: 'in' qualifier in declaration of 'position' only valid for function parameters in GLSL 1.10.
 
> in vec3 position;
 
Even though the GLSL version should be at least 1.20.8 according to this: (for OpenGL 2.1)
 
http://en.wikipedia.org/wiki/OpenGL_Shading_Language#Versions
 
This is what is causing my headaches, I'm not sure if this is an error on my part or an error with GLEW.

 


It is most likely an error on your part, the in qualifier is only valid in the global scope (with some restrictions) and in function parameters, i would guess that the error is caused by you using the in qualifier in a local scope. (Allthough its just a guess, i havn't seen your code so ...)

 

 

It was defined in global scope, although I updated my drivers and it seemed to fix the problem. It was using an incorrect version of GLSL.

1

Share this post


Link to post
Share on other sites

Always specify the GLSL version you want to use by using:

 

#version 150

 

In your shader files. Replace 150 by whatever version you want to use (120, 330, etc)

2

Share this post


Link to post
Share on other sites

 


I'm thinking about switching to using Java and JOGL for any future applications I develop because of this but I'm concerned about performance, has anyone here developed any graphically demanding games in Java/JOGL?

 

If you do this you will soon say "I was having trouble with my OpenGL, so I switched to JOGL, and now I have two problems."

 

If you look at the documentation for the different JOGL versions you'll see that it isn't going to fix anything (scroll to the picture at the bottom).

 

http://jogamp.org/jogl/doc/Overview-OpenGL-Evolution-And-JOGL.html

 

 

The graph illustrates that JOGL gives you an object oriented representation of all possible OpenGL profiles _all_ supported using the latest version of JOGL.

 

This is a good thing because you can then use a Common OpenGL Profile Subsets of OpenGL that is then at compiletime guaranteed to work on both mobile and desktop systems!

  • GL2ES2 Interface containing the common subset of GL3, GL2 and GLES2. <- this is a good choice if you want to target as many devices as possible, the GLSL syntax compiled by the GPU driver can differ thus you need to think of what you send to the GPU.
  • GL3ES3 Interface containing the common subset of core GL3 (OpenGL 3.1+) and GLES3 (OpenGL ES 3.0).
  • GL4ES3 Interface containing the common subset of core GL4 (OpenGL 4.0+) and GLES3 (OpenGL ES 3.0). <- this is a good choice if you want to target the latest hardware, the GLSL syntax between mobile and desktop opengl drivers are now identical

 

I recently developed an opengl app on android and all the opengl methods were encapsulated in a GL10 class which made things so much easier

 

Thus yes by switching to JOGL you will get this interface class behaviour on both mobile and desktop,

you can sure at compiletime that you only use OpenGL function calls that belong to the OpenGL profile you want to use!

 

 

I upgraded my OS to Ubuntu 14.04 and a few of my applications have stopped working and are throwing GLSL compilation errors

 

You can ask JOGL to give you a specific profile that support the "old" GLSL shaders.

GPU drivers will refuse to compile "old" GLSL shaders if you have requested a "default" profile and then recived say a GL4 profile with backward compatible code removed.

 

Here are some guidelines how to write GLSL shaders that work on both mobile and desktop opengl profiles

http://jogamp.org/wiki/index.php/How_to_write_cross_GLProfile_compatible_shader_using_JOGL

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0