RenderToTexture Question

hello @all,

i got an strange problem with the fbo’s since a short time,
it was working a long time but yesterday the code stops with an out_of_memory.
the only thing that changed was an update of java.

i dont know if my code was unstable or is there any other method?

much greetings and thanks for any help :slight_smile:

Question: Is it a Java OutOfMemory exception or OpenGL returning an out of memory error? I don’t see how the code you’ve posted could have out of memory errors in Java. Have you tried experimenting with changing the heap size to see if that solves the problem, or measuring how much of the heap is used up?

here some infos:
-Djava.library.path=“lib” -Xmx1024m -Xms1024m

the application break after the
gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, FSO_ENGINE.fbo.get(0));
line and return with error (see below)

i am not very experienced with such error messages in java
and didnt know what to do.
i take a look at some examples,but all i found was written in c++/opengl
and that could net help me ( my code was working , but monday…)

maybe the IntBuffer could be a problem, is there anything to take care?

What happens if you prepend this line:


           FSO_ENGINE.fbo.rewind(); // <---
           gl.glGenFramebuffers(1, FSO_ENGINE.fbo);
           gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, FSO_ENGINE.fbo.get(0));

is the position of your buffer is non-zero, JOGL might (or might not?) use that offset, to write the handle.

if you bind the handle at index zero (fbo.get(0)) it might refer to another handle, or some random region in CPU-memory where it tries to read the width/height, and at a random memory location, that might contain any (bogus) value, tripping your driver.

just guessing…

the rewind sounds good, but didnt work…same error stays. :’(

i also try to use … fbo.reset(); , nothing happend

memory is more that enough…i reduce the number of used textures to
minimum(2 x 256*256) …nothing happend.

and i got no memory killer arrays in the engine…all very simple

but i am very sure that the
static IntBuffer fbo = BufferUtil.newIntBuffer(1);
static IntBuffer depth = BufferUtil.newIntBuffer(1);
static IntBuffer fbo_texture = BufferUtil.newIntBuffer(1);
must be the problem…

You aren’t running out of Java memory, then you’d have a OutOfMemoryError, but you’re seeing the driver reporting a GL_OUT_OF_MEMORY state, which indicates a lack of vRAM.

omg…

i found what the app disturbed.
-the nvidia desktop manager software eats all vram!
(after deaktivating this program all works fine again
(i use 2 screen ,and got no need of any extra screen manager… must be activated in any way)

thanks for all answers! :smiley:

(i program on older geforce go7300 notebook… on other hardware the problem didnt exist)