Frame not clearing? [Linux]

BlitzMax Forums/MiniB3D Module/Frame not clearing? [Linux]

markcw(Posted 2010) [#1]
I can't really explain it in words so here's a picture.



I tried a
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
in different parts of the main loop to no success.

It works with primitives but when I load a model or even just create a surface and add triangles (like in the flag demo) the bug appears.

I am using v0531 with bmx v1.41 in ubuntu 9.04 on a dell 1525.


FBEpyon(Posted 2010) [#2]
that happen to me as well, you need to make sure you are using the renderworld() if your using MINIB3d and also updateworld doesn't hurt as well...

Then just before the loop ends put in the flip


ima747(Posted 2010) [#3]
are you also calling cls() before you being your drawing operations? looks like it's just getting drawn and never cleared to me...


markcw(Posted 2010) [#4]
Oh sorry, I should have said the picture is from examples/anim.bmx and I didn't modify it. I checked it on Windows XP too just to be sure and it worked fine.

Also, remember I'm getting this in nearly every demo and example I tried, only the firepaint3d demo worked which I figured is because it doesn't load a b3d model.


markcw(Posted 2010) [#5]
This is what happens when I try a Cls() on the first line in the main loop of the anim example.



It fixes the text and the uncleared frames but now, as you see, there is a clipping problem.


FBEpyon(Posted 2010) [#6]
Is your camera distance wrong??


markcw(Posted 2010) [#7]
My camera distance is whatever the anim example has it at.

Well I fixed it. I changed the line in minib3d.bmx like so:
Const USE_VBO=False 'True	' true to use vbos if supported by hardware

I must have a crap video card. Here's the output from glxinfo but I don't understand it.



What I'm wondering is how can I auto-detect my crap card's lack of VBO goodness?

Oh, found a nice vbo tutorial here btw. Maybe I just liked it because of the nice iPhone picture.


markcw(Posted 2010) [#8]
From what I can tell and by reading this my card has GL_ARB_vertex_buffer_object but not GLX_ARB_vertex_buffer_object.

After a bit of digging I found GL_ARB_vertex_buffer_object in THardwareInfo.bmx.

So by changing line 45 to the code below it now works without needing to edit USE_VBO in minib3d.bmx.
		?Linux
		THardwareInfo.VBOSupport      = Extensions.Find("GLX_ARB_vertex_buffer_object") > -1
		?Not Linux
		THardwareInfo.VBOSupport      = Extensions.Find("GL_ARB_vertex_buffer_object") > -1
		?

Is this right simon/klepto?

Edit: no this code is wrong, see below.


SLotman(Posted 2010) [#9]
I think this would be the best:

		THardwareInfo.VBOSupport      = Extensions.Find("GL_ARB_vertex_buffer_object") > -1
		If Not THardwareInfo.VBOSupport Then
		   THardwareInfo.VBOSupport      = Extensions.Find("GLX_ARB_vertex_buffer_object") > -1
		End If


This way, you'll test for both, and use whatever you can find.


markcw(Posted 2010) [#10]
Well believe it or not your code actually reintroduces the bug since I do have, gl_arb_vbo but not glx_arb_vbo. The only alternative would be to 'And' them.

If you're running Linux please check this topic here.


SLotman(Posted 2010) [#11]
Well, if your card reports to have GL_ARB_vertex_buffer_object and it's giving you that error, then it's cleary a driver problem. (question: does miniB3D samples present the same error? Are you using the 'small fixes' version?)

And if you're forcing GLX_ARB_vertex_buffer_object and your card don't support it, then you're not using VBOs at all, so miniB3D will be very very slow - so this is not a proper 'fix' for the problem, be it on Linux or any OS.

Can you run other 3D apps in OpenGL without problems? I know in Linux I had several problems until I got a more or less working driver from ATI...


markcw(Posted 2010) [#12]
No it's not a driver problem. To answer your question, yes I get the same bug with the small fixes version.

Yes, my above 'fix' was wrong but my card *does* support VBOs. However, it's only up to a certain limit.

I edited the flag demo segs variable and found the bug happens when I hit 250+ triangles. I can add as many vertices as I like it seems (250000+ and it just slows down) but not triangles.

So the code is right to look for GL_ARB_vbo, but it would be much better to look for this vbo triangle limit as well, and if it's less than a decent amount then switch off vbos. The problem is I don't know which gl limit it is.


markcw(Posted 2010) [#13]
Well I reverted the intel driver using this guide, which made no difference:
https://wiki.ubuntu.com/ReinhardTartler/X/RevertingIntelDriverTo2.4

And then I updated the driver to the jaunty-updates version: xserver-xorg-video-intel_2.6.3

Still no luck so I went back to the jaunty driver as all later drivers have dependency problems.

So if it is a driver bug, which it does seem to be since it's working fine on Win XP, then all I can do now is upgrade to karmic or lucid.