Hi all,
I’m fighting a crash for a couple of days now and I can’t find it.
I really beg your help as I don’t see how to find its cause(s).
This is the only output I get from the crash :
=== OpenGL FBO State ===
May 27, 2015 9:58:21 PM com.jme3.renderer.lwjgl.LwjglRenderer setFrameBuffer
Context doublebuffered? false
FBO ID: 70
Is proper? true
Is bound to draw? true
SEVERE: === jMonkeyEngine FBO State ===
Is bound to read? true
FrameBuffer[format=1280x960x1, drawBuf=0]
Draw buffer: GL_COLOR_ATTACHMENT0
Depth => BufferTarget[format=Depth]
Read buffer: GL_COLOR_ATTACHMENT0
== Renderbuffer Depth ==
Color(0) => TextureTarget[format=RGBA8]
RB ID: 263
Is proper? true
Type: Buffer
RB ID: 263
== Renderbuffer Color0 ==
RB ID: -1
Is proper? false
Type: Texture
May 27, 2015 9:58:21 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalStateException: Framebuffer has erronous attachment.
at com.jme3.renderer.lwjgl.LwjglRenderer.checkFrameBufferError(LwjglRenderer.java:1327)
at com.jme3.renderer.lwjgl.LwjglRenderer.setFrameBuffer(LwjglRenderer.java:1606)
at com.jme3.post.FilterPostProcessor.renderProcessing(FilterPostProcessor.java:200)
at com.jme3.post.FilterPostProcessor.renderFilterChain(FilterPostProcessor.java:281)
at com.jme3.post.FilterPostProcessor.postFrame(FilterPostProcessor.java:294)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:987)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1029)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:252)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:745)
It happens after a couple of minutes (2 to 5) of “stress testing” my game. (“stress testing” means I do my best to make my game do the most it can make in a minimum amount of time)
The crash only happens when I use that stupid overlay shader I wrote :
uniform sampler2D m_Texture;
varying vec2 texCoord;
uniform sampler2D m_OverlayTexture;
uniform float m_Alpha;
uniform float m_AspectRatio;
void main() {
vec4 texOverlay = texture2D(
m_OverlayTexture,
vec2(texCoord.x,((texCoord.y-0.5)/m_AspectRatio)+0.5)
);
gl_FragColor = (m_Alpha*texOverlay.a*texOverlay)
+
(1.0-(texOverlay.a*m_Alpha))*texture2D(m_Texture,texCoord);
}
It is used by a class extending com.jme3.post.Filter. I can add/remove up to 10 instances of this class to my “main” FilterPostProcessor.
What I wanted to achieve is to add multiple overlays with different alpha values.
It’s achieving exactly that and it’s beautiful to look for a couple of minutes. Then it crashes.
It’s happening “randomly” (= not linked to any particular part of the code I use in the update loop) and only after 2-5 minutes of “stress testing”.
Please help the clueless man I am. How/Where may I find more information about this crash ?