FBO Exception - Is there a way to disable FBOs in JME?

Thank EmpirePhoenix, but having fallback mechanisms to allow an engine to work on a broader set of machines, the similar way you can watch a video in various quality modes, would be a desirable capability for any game engine.



On a side note, in past versions of JME it appears that some fallback functionality was available:

[java]

INFO: Child (objects) attached to this node (reflectNode)

2007.09.19. 16:06:18 com.jme.scene.Node attachChild

INFO: Child (reflectNode) attached to this node (rootNode)

2007.09.19. 16:06:18 com.jme.renderer.lwjgl.LWJGLTextureRenderer <init>

WARNING: FBO not supported.

2007.09.19. 16:06:18 com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer setMultipleTargets

INFO: Render to Texture Pbuffer supported!

[/java]

But if pBuffers is not the best solution, then Iā€™m open to other suggestions.

Thanks.

http://hub.jmonkeyengine.org/javadoc/com/jme3/renderer/lwjgl/LwjglGL1Renderer.html

Yeah, many people want many things from this engine. Thing is, few people do code for it and since we consider this an engine for high-end game development we will not put a high priority on this.

Whatā€™s the issue with just not using framebuffers? They are used in jME3 only for filters, which are there to improve graphics quality. Just disable filters. Even if jME3 supported pbuffers, the filter effects themselves would still slow down the rendering to a crawl.



Also, we do have a fallback mode for OpenGL1.1, the graphics are really bad, but you said youā€™re fine with it. Have you tried it?

Wow!! Thanks for explanation. Now i get you about post effects.



Can you explain how to switch the renderer to OpenGL 1.1? I did not see anything in docs about it.

Check AppSettings, itā€™s in there somewhere. I donā€™t remember off the top of my head but itā€™s a string you have to pass in one of the methodā€¦ Sorry canā€™t help more as jMP is not opened.

Thanks for the suggestions Momoko_Fan.



Regarding using OpenGL 1.x, it appears the JME phased that out. Looking at the JME Caps.java class, which defines the JME capabilities, there is no mention of OpenGL 1.x. More specifically, when initialize() in JMEā€™s LwjglRender is called, the OpenGL org.lwjgl.opengl.GLContext.getCapabilities() is called to get the Open GL capabilities within initialize(), and the OpenGL properties are set in JMEā€™s Caps.java. Although org.lwjgl.opengl.GLContext.getCapabilities() does return OpenGL 1.x versions, JME only bothers setting Open GL 20, 21 and 30 versions, not the 1.x OpenGL versions. Also, OpenGL v1.x is not mentioned anywhere else in the JME code from what I see. For example, in the main LwjglRenderer depends on several of the OpenGL 2.0 methods.



Regarding disabling filters, in the RenderManager I disabled calling postQueue on the SceneProcessor by commenting out [java]proc.postQueue(vp.getQueue());[/java] (line 660 in renderViewPort() method of RenderManager) ā€“ Iā€™m not sure if that is what you meant by disabling filters since this may be overkill. Now that the FBO exception is gone, the following exception is raised. Unlike FBOā€™s, this appears to be a more critical part, since disabling the following results in a grey screen, and I donā€™t see an OpenGL 1.0 equivalent Open GL 2.0ā€™s glCreateProgram method:



[java]ā€œLWJGL Renderer Threadā€ java.lang.IllegalStateException: Function is not supported

at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:58)

at org.lwjgl.opengl.GL20.glCreateProgram(GL20.java:255)

at com.jme3.renderer.lwjgl.LwjglRenderer.updateShaderData(LwjglRenderer.java:832)

at com.jme3.renderer.lwjgl.LwjglRenderer.setShader(LwjglRenderer.java:918)

at com.jme3.material.Material.renderMultipassLighting(Material.java:531)

at com.jme3.material.Material.render(Material.java:697)

at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:386)[/java]



If you have another suggestion to get around calling Open GL v2.0 glCreateProgram() or another way to avoid calling the LwjglRendererā€™s updateShaderData method altogether that would be appreciated.





Thanks again!

JFYI:



In AppSettings, like I said in my previous post:



[java]



/**

  • Set the graphics renderer to use, one of:<br>
  • <ul>
  • <li>AppSettings.LWJGL_OPENGL1 - Force OpenGL1.1 compatability</li>
  • <li>AppSettings.LWJGL_OPENGL2 - Force OpenGL2 compatability</li>
  • <li>AppSettings.LWJGL_OPENGL3 - Force OpenGL3.3 compatability</li>
  • <li>AppSettings.LWJGL_OPENGL_ANY - Choose an appropriate
  • OpenGL version based on system capabilities</li>
  • <li>null - Disable graphics rendering</li>
  • </ul>
  • @param renderer The renderer to set
  • (Default: AppSettings.LWJGL_OPENGL2)

    */

    public void setRenderer(String renderer) {

    putString("Renderer", renderer);

    }

    [/java]

But if you look at how AppSettingā€™s corresponding getRenderer() is used throughout JME youā€™ll see that LWJGL_OPENGL1 is not used anywhere. It is not used in the RenderManager and the LWJGLRenderer.

Perhaps this was phased out ā€¦

My jme3 src file (jMonkeyEngine3-sources.zip) (downloaded a few months back) does not have that file ā€¦ I only have jme3/renderer/lwgl/LwjglRenderer.java



Perhaps this LwjglGL1Renderer was added recently, or perhaps this file is only available via SVN.



Thanks for letting me know about this file.

You should be using nightly builds if you want the latest stuff. This was added after the alpha 4 release Iā€™m 90% sure.



Otherwise, your source code is stale. :slight_smile:

Thanks for the info :slight_smile: My code was alpha 3.

Wowsersā€¦ thatā€™s old. :slight_smile: That was even getting pretty old when I started coding Mythruna.

After getting the latest from SVN, and then switching the mode to OpenGL v1, and a few other tweaks, my app worked on all my machines, even my Netbook. Thanks all for your assistance/suggestions, and to Momoko_Fan for the OpenGL 1.0 recommendation. JME is a top-notch engine, it has been a real pleasure working with it.

Coool!!! Can you make a tutorial for our documentation about this issue?

Hi,



I have no issue creating a tutorial, however, in this case there are really only a few things that need to happen. Feel free to take the content I wrote below and post in the appropriate place, and modify it as you see fit. There may be other items that should be done as well, but the following is from my experience. Hopefully this will be useful for someone.





How to Enable JME Compatibility for Older Graphics Cards



If your application needs to support machines with older graphics cards, including those that may not support some of the Open GL 2 methods, then the following points should be considered to ensure that your application works on most systems.


  1. Verify that your Java code base has the LwjglGL1Renderer.java file. This file provides support for Open GL 1. If your Java code does not have LwjglGL1Renderer then your version needs to be updated.




  2. Change the mode to OpenGL version 1:
  • Change the AppSettings.java render mode to OpenGL v1 by setting the renderer property to LWJGL_OPENGL1. This can be achieved two ways:



    2 a) One way is to call setRenderer(String) directly on AppSettings.java with the constant set to LWJGL_OPENGL1. Note: If your AppSettings does not have a LWJGL_OPENGL1 constant, then you need to update your version of JME.

    or

    2 b) An alternative is to define an entry equal Renderer(string)=LWJGL-OPENGL1 in the application properties file used initialize your AppSettings. This property file is the one passed in the ā€˜public void load(InputStream in)ā€™ method of AppSettings. AppSettings parses the properties file, and over-rides its default settings with the values specified in the properties file. Please refer to the AppSettings Java Docs for more information about using a properties file to define the application settings.



    The advantage of the former approach is that the application settings can be changed without a re-build of the application since the change can be done outside the Java code.




  1. Change Anti-aliasing mode.

    Some graphics card may have issues with higher samples per pixel. For some cards, the sampling may need to be set to a lower value. This can be achieved by calling setSamples on the AppSettings.java. Like the setRenderer described above, this can be achieved by calling setSamples(int value) directly in the Java code, or this value can be defined in an external properties file (example entry: Samples(int)=0). Note that the edges/lines in your application will not be smooth.




  2. Disable Renderers that are not supported by OpenGL v1.

    Graphics cards that do not support Open GL v2 and above will likely not support some of the renderers / scene processors that JME provides. One example is the PssmShadowRenderer used to display shadows. Hence, if your application does use JMEā€™s scene processors, such as the PssmShadowRenderer, SimpleWaterProcessor, etc., it is recommended to test that these renderers on older graphics cards (if your application needs to support older graphics cards).
3 Likes

For the record, step 2a is the only one required on my system with jme3 beta. To enable OpenGL 1.x simply use AppSettings as detailed here:



https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:intermediate:appsettings?s=opengl1