bOGL - OGL based open source 3D engine

Miscellaneous Forums/Blitz Showcase/bOGL - OGL based open source 3D engine

bOGL is an OpenGL based open source 3D engine for BlitzBasic (Tested on BlitzPlus).
No OpenGL knowledge required. It's easy as Blitz3D even most of the function names are identical.



Download bOGL 1.01 beta or a simple demo created with bOGL

Currently are available the following functions:

Graphics3D(title$, width%, height%, depth%, mode%)
CreateCanvas3D(x%, y%, width%,height%, group)
CreateCamera()
CreateLight(red#, green#, blue#, flag%)
CreateCube()
CreateSprite()
CameraRange(handler%, near#, far#)
CameraFieldOfView(handler%, angle#)
CameraFogMode(handler%, mode%[, near#[, far#]])
CameraFogColor(handler%, red%, green%, blue%[, alpha#])
PositionEntity(handler%, x#, y#, z#)
RotateEntity(handler%, x#, y#, z#)
ScaleEntity(handler%, x#, y#, z#)
PaintEntity(handler%, red%, green%, blue%)
EntityAlpha(handler%, alpha#)
EntityTexture(handler%, texture%[, flag%])
ShowEntity(handler%, state%)
FreeEntity(handler%)
FlipPolygons(handler%)
EntityX#(handler%), EntityY#(handler%), EntityZ#(handler%)
EntityXAngle#(handler%), EntityYAngle#(handler%), EntityZAngle#(handler%)
LoadTexture(file$[, quality%]) valid quality - 2, 4, 8, 16
TextureWidth(handler%), TextureHeight(handler%)
RenderWorld()
Distance(x1#, y1#, z1#, x2#, y2#, z2#)

Downloading demo...

Seems great :) A simple (right now) 3D engine for BlitzPlus

EDIT: This is great, exactly what I was looking for in a 3d engine (all I want is camera control, and textures :p) I hope you keep working on this :)

Ahem,

I think you missed this - it is OPenGL for any Blitz (tested on Blitz Plus).

IPete2.

Yea, OpenGL might be for any Blitz, but the engine might not. The engine has been tested only on BlitzPlus.

oh Okay

Can someone with Opengl knowledge please test this with B3d?

IPete2.

There is no OpenGL knowledge required. The only thing with Blitz3D is that you have to change the occurred function names. I used the same function names because i thought there would be no use of bOGL in Blitz3D. It already supports 3D and has even more functions than bOGL.

Some more functions have been added and some of them have been fixed too.

I measured the speed of bOGL and it's approximately 350000tris/s

I have P4 3GHz, 512MB RAM, ATI radeon 9600SE

Cool, I missed this completely!

Can someone test bOGL speed vs Blitz3D speed?

I'm at work, cant test it now, but this seems great :D

Would be cool if it worked with BMax...
would buy it at once....

I don't think 350'000 is a big lot, this would be about 5'000 at 70 FPS. Are you sure it's only 350'000/s ? I'd expect more like 350'000 at 60Hz or something.

BTW does this require Hardware 3D, or is it capable of switching to Softrender Mode when no 3D Hardware is detected? This would be very useful - although slow, but noneless useful.

Can OpenGL be "switched" to software mode? I'm pretty sure that it's 350k tris/s. Probably I'll need to optimize my code. But it's written in BB so IMO it can't be as fast the other 3D engines, such as Crystal Space and stuff.

Currently I'm drawing faces behind the camera too so to gain more speed i should skip them.

I'm still a noob at OGL and I almost didn't know anything about it when i started with this project.

Doesn't bOGL work on BMAX? I think you don't even need to copy the userlibs.

AFAIK OGL offers a softrender mode. I don't think it's your code that makes it slow (well maybe the camera fustrum culling), the hardware don't care too much if the commands come from BB or from something else. It just has to render the Tris. BTW Crystal Space has a Softrender Mode too.

i would really like to see this working for blitz3d/bb and not just b+ :)

you did a great job. my open gl engine is crap...

yeah 350k tris per second is pretty slow.

but it might be that your just thrashing the T&l cache with the low poly primatives (cubes) its just not enough triangle data to keep it loaded.

if you could add spheres to it...you would probably a much greate poly trhoughput at the same speed.

also you may need to unlock your vertical retrace if you are only rendering say 5000 tris to a screen. to see what it can really do.

looks like good stuff tho :) thanks for sharing
if I only had b+ heh

Sam