Hello fellow jMonkeys,
I’m having trouble to understand the renderer and capabilities.
The AppSettings class provides constants for various versions of LWJGL OpenGL renderer as well as 2 options for JOGL renderer.
LWJGL only works when i select LWJGL_OpenGL2 or LWJGL_OpenGL3, all other options result in UnsupportedOperationException, which is quite obvious looking at the lines
if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL2)
|| settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) {
....
} else {
throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer());
}
in com.jme3.system.lwjgl.LwjglContext.initContextFirstTime()
so first question: whats the point in the other constants that you can choose from?
Also, when i set the renderer to AppSettings.LWJGL_OPENGL2 my app runs with no problem, however when i use AppSettings.LWJGL_OPENGL3 my app crashes with
UnsupportedOperationException: No technique 'Default' on material 'VegetationShader' is supported by the video hardware. The capabilities [GLSL400, GeometryShader, TesselationShader] are required
so second question: Since the app runs fine using AppSettings.LWJGL_OPENGL2 my GPU obviously supports the neccessary capabilities, why does the OPENGL3 renderer not realize that?
and a last question: since i specify the OpenGL versions for each shader that i need in the matDef file, do i have to make sure i only use versions that are equal or lower than the renderer selected?
like i can select OpenGL2 renderer (as mentioned, actually HAVE TO select that one) and still set GLSL400 in the material Definition file and that would always work, as long as i check the renderers capabilities and show a custom error message or in my case if GLSL400 is not supported just disable the vegetation?
Edit: Or to sum it up: whats the recommended way to handle this in the application? like i would assume using a “newer” renderer could result in better performance, i dont see how i would check if that newer renderer supports the capabilities needed though. if it does not, check if an older renderer supports it (as in my case), and if thats true use the older renderer, otherwise use the newer one and disable the features that need the capabilities, or if its not possible to disable them, show some error message.
that does not feel like the way to go
I’m using a Notebook with an Intel HD and a Nvidia Geforce 840m (which i select to be used for the JVM) in case the GPU makes a difference
As always thanks a lot in advance and many greetings from the shire,
Samwise