Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / DBGL: A replacement, OpenGL based 3D engine for DarkBASIC Professional

Author
Message
DSG
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Hampshire, England
Posted: 24th Jul 2003 06:23
Introduction – What is DBGL?
DBGL is third party plug-in for DarkBASIC Professional. It is both a replacement 3D engine and an OpenGL wrapper for calling OpenGL API functions natively from within DarkBASIC Professional. DBGL is also a hub for future, more game-genre specific engines and third-party add-ons.


Why use DBGL?
DBGL is a package aimed at intermediate to advanced 3D graphics and game programmers that use DarkBASIC Professional. It overcomes many problems of the existing DarkBASIC Professional 3D engine by giving the programmer as much or as little control over the graphics pipeline as is desired. At the lowest level, the programmer may take complete control and program entirely using OpenGL API calls. At the highest level the programmer can use the included scene graph and utility functions to have 3D data managed and rendered automatically for them.


DBGL Features
The main DBGL features include:
- Wrapper for the most common OpenGL API functions
- LOD terrain system
- Advanced, flexible particle system
- Full set of 2D commands + compact 2D game engine
- Utility library for common functionality (e.g. setting up OpenGL, loading and rendering meshes)
- Complete set of collision functions
- All the usual trimmings!

The package comes complete with documentation that seamlessly integrates with your existing DarkBASIC Professional installation to provide full syntax highlighting, tool tips and context sensitive help for every command in the library. There is two comprehensive sets of tutorials; one that teaches OpenGL and the other, DBGL.

The DBGL system makes full use of the TPC SDK to obtain a handle to the program window and initialise OpenGL. DBGL works side-by-side of Direct3D and thus can operate just as fast as or even faster than the actual DarkBASIC Professional 3D engine.


The complete package is still several months from completion. In the mean time, here are a couple of screenies of DBGL in action!


LOD Terrain


The terrain system utilises GeoMipMapping for LOD and octree frustum culling to cull off-screen terrain segments (the middle terrain of the images on the right shows the bounding boxes of the octree used in the main image). Each terrain can have up to 4 textures overlaid (although the terrains in this shot only use two). Multi-texturing is used where supported with multi-pass rendering fallbacks for hardware with less texture units.



DBGL Montage


The main image here shows the source code to a small program and the resulting application running in a small window. In this instance the program is from one of the OpenGL tutorials that demonstrate rendering a single triangle in OpenGL immediate mode. Notice the syntax highlighting and tool tip on the new functions.

The image in the top right shows the 'Miko' model with the DBGL cartoon shader applied. There are several special effects that may be attributed to objects easily in DBGL and an infinite number that can be added using native OpenGL calls.

The final image is that of a complete 3D minesweeper clone built during early development of DBGL. It was released to the RGT moderating team a while ago for testing. It demonstrates some of the cool things you can do with OpenGL including object picking using the selection buffer and vertex colour animation.
Xsniper
21
Years of Service
User Offline
Joined: 29th Dec 2002
Location:
Posted: 24th Jul 2003 07:57
Blivvy:
This looks really sweet! I'm looking forward to it. Will it be freely available or must we purchase it?

Wiggett
20
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
Posted: 24th Jul 2003 08:09
damn, if its free i'd be spewin i only have dbc :/

working on the game undead nazi pirates of the kungfoorabean. this game is random to the max.
http://www.angelfire.com/wizard2/unpotkf/
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Jul 2003 08:40
looks interesting

Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 24th Jul 2003 10:03
I was going to do this myself but one important thing came to my mind: DarkBASIC loads Direct3D when it runs any compiled EXE so making an OpenGL version would eliminate the advantage of running on every system so you'd be better off just programming a standalone 3D engine in OpenGL yourself.

"Computers are useless they can only give you answers."
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Jul 2003 11:22
depends on how he's achieve the OpenGL really ... you can make function superceed those of others, so if you say load the OpenGL DLL with a command like say

Enable DBGL

it could then run a function that disables the access to the DirectX Based DLLs - the advantage of an OpenGL system even with DirectX is faster graphics, but only on certain cards (GeForce Family for example) ... the Radeons wouldn't get much of a performance increase from it.
Of course no doubt he's using alot of OpenGL things directly LOD would be a good example, as OpenGL has this tied into hardware allowing it to be faster than something that could be programmed.

problem is unless he has low level access there is going to be a performance hit acessing data - unless ofcourse he loads as a second instance for GL.
The way i saw it (and still do) is unless you completely rewrite the engine code, in other words 100% replace all of the DirectX functions with the OpenGL equivilants - then really the upgrade is a little bit of a waste of time.

Well unless the OpenGL interfaces are fully accessable, then it would be alot of use to the more experienced DB users ... as there is alot you can do in OGL which DirectX just isn't really made for yet.

But this would require alot of graphics card specifics, which means alot of maintainanc, or making wrapper drivers for the Gfx card.

----------------------

as i said, this is interesting. I think he should probably charge for it as it would've been on hell of alot of work thats gone into it... but i'm going to keep my reservations about its uses
Will be interesting to see the entire function list though, it sure doesn't look as if its much a difference from the Ogl setup itself

Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 24th Jul 2003 12:07
wow !
look really cool

when will it be released ?
Will it be a freeware ? shareware product ?

Puffy
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 24th Jul 2003 12:28
=\ Nifty...

EVERYONE LOVES THE PUFF!... =\
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 24th Jul 2003 13:56 Edited at: 24th Jul 2003 13:57
Yeah, I know what you're saying Raven but there are a lot of 'ifs' so I guess we'll just have to wait and see

"Computers are useless they can only give you answers."
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 24th Jul 2003 14:04
Wow! - I'm VERY impressed Blivvy.

I'm not sure how much use I will have for DBGL, but it could be useful if it allows very low-level stuff to be achieved. That has always been a fault of DBPro, very little low-level DX stuff.

The LOD terrain system will be much appreciated by all. Needless to say, it looks fantastic, and as I haven't seen any more of the terrain system from the DBPro team, this is a much needed feature. The 4 textures limit is a bit of a pain - but presumably we will be able to use vertex colouring as well so that won't be a problem?

lcfcfan
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 24th Jul 2003 16:17
cool, will we be able to use bsp's?

Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 24th Jul 2003 17:05
That looks excellent cant wait to test it out, will it support gl shaders?

Once you start down the Dark Path, forever will it dominate your destiny...
lcfcfan
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 24th Jul 2003 17:08
should have thought so inferno

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 24th Jul 2003 18:14 Edited at: 24th Jul 2003 18:14
As Raven as said before - how will you get rid of the DirectX initialisation section, unless you manually close DX ?

The other question is : can the two be used at the same time ?


Its better than a poke in the eye...
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 24th Jul 2003 21:24
Looks nice.



Yellow:Wanna publish my game microsoft, cuz i no u rich so...Can I have my bag of money now?
Microsoft: *snicker* Tip of the month-Microsoft will never(probebly) publish your game.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 27th Jul 2003 02:58
are we gonna get anymore feedback or was this just a random post to let us here at apollo just have knowlage of this?

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Jul 2003 04:04
Geri: The jury is still out on that one - even Carmack admits that there is very little speed difference between them now.

Blivvy: How does this integrate with the object system in DBPro? From what I understand, you cannot combine GL and DX on the same surface in any meaningful way. Are you planning on writing a GL version of all 3D output?
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 27th Jul 2003 04:12
Gah, I hate it when the thread starter doesn't reply. Well, it's only been 3 days though, so I suppose I can wait a little longer.

This is a very interesting project though.



Yellow:Wanna publish my game microsoft, cuz i no u rich so...Can I have my bag of money now?
Microsoft: *snicker* Tip of the month-Microsoft will never(probebly) publish your game.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 27th Jul 2003 04:31
guys go over to RGT, Blivvy seems more open to responding there ... unfortunately its the one place here my questions would go unanswered.

as for the differences between OpenGL and DirectX9 ... speed wise they're almost identical now, some operatings OGL does faster, some DirectX does - but even then the differences are minimal.

there are now really only 2 reasons to use OpenGL over DirectX.
a) Coding structure. OpenGL has a more open and simpler coding front to DirectX. Partly because it is a C not C++ APi, but also because it has a much more 'BASIC' feel to it, although for learning this makes it simpler ... for more complex tasks it actually makes it a nightmare.
b) MultiPlatforming. OpenGL is still really the only supported Graphics APi which is crossplatforming between all current GUIOSs.

this said, multiplatforming really doesn't come into play for DarkBASIC Pro considering it only exports Win32 Executables. So you need to have Windows support in your other OS anyways.

unfortunately support for OpenGL atleast for games is slipping alot lately, as both the major companies nVidia & ATi are determined to outperform each other on the DirectX APi (which is why the speed gap between OpenGL and DirectX has closed so much)...
the 44.03 Detonator Drivers are less OpenGL compatible than thier 28.12 drivers 2years ago, anyone who uses packages like 3DStudio Max and Maya will have noticed a drop in performance when using them in OGL mode - also the buffers tend not to be cleaned properly anymore. Causeing an effect known as "Dirty Pixelation" - which causes very nasty behaviour similar to when you don't set the backdrop on or cls with text in DBP.

checkout the little "agreement" made over at RGT about Microsoft and APi's too ... i'm sure something could be said to them about it, but i doubt anyone would actually listen.

one thing that could be said about Mircosoft is they don't make user-friendly development libraries, they make very thourough & practical ones. Add to that they make them with thier OWN language in mind.
(why should they freely support other peoples languages and Operating System?)


well we'll just have to wait and see what comes out of this anyways.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Jul 2003 14:43
Hmmm, filtering out all the 'looks great' posts, the blitz comparisons, the in-fighting and the proclamations about it being better than the current DBPro graphics renderer (despite them not having seen it run!), then the RGT post has as much feedback as this one does.

Three times the number of posts, and the same amount of information ... and people wonder why I don't spend a lot of time there anymore
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 27th Jul 2003 16:45
Yeah, I noticed that too Ian lol, the only thing I got out of the RGT post was that it would probably be free but that's not even certain yet.

"Computers are useless they can only give you answers."
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Jul 2003 17:41 Edited at: 5th Feb 2022 12:40
Ian:

I first saw an early version of DBGL some time back (runs nice here ), the surfaces are not integrated though, so GL output runs on it's own surface..

PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 27th Jul 2003 17:58
Quote: "Three times the number of posts, and the same amount of information ... and people wonder why I don't spend a lot of time there anymore "


Thats the annoying thing about RGT, people go "yeah- that's great - best DB game ever" even when people post Sphere-On-Matrix demos.

As for it looking better than the current renderer, that's probably because some people are STILL to stupid to realise that the display is by default 640x480 stretched to fit their desktop res, so the graphics look horribly blurry.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Jul 2003 18:52
So I guess that means you have to hide the DBPro window - no biggee.

I look forward to seeing it in action, but just think ... we'll be able to have our own 'DX is better than GL' arguments like the rest of the graphics communities
Andy Igoe
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 27th Jul 2003 19:16
So if I am understanding this correctly the GL output window is seperate to the DX output window?

Pneumatic Dryll
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 28th Jul 2003 06:00
No, if it uses its own surface it means you can have 2 suface layers in he same window...
Both OpenGL & DirectX essentially use a single plane for rendering, which is what the backbuffer & frontbuffer are combined and passed to.

In essence if its been setup right, you should be able to swap standard rendering informations between the two and actually render on the prodominant one. Not sure if Blivvy has set it up so they can both interact on the same level - but its possible for them to.
DirectX usually has the higher render depth, so it'd make sense to try and hide its Surface and just pass the Rect information to the OpenGL one.

Though a question i'm baffled about is, does it use the built in functions, hijack them or completely use his own?

but in Karma i've found the latency of using the builtin functions is well above something comfortable, around 200ms reaction time - for a rendering engine not something too bad, but for a dynamics one it could be a killer.
If he's hijacked them, i'd love to know how he's done it because i've been trying to for a good month and a half now with not success other than to crash my computer more times than i'd care to recall.
If he's using his own, it'd be interesting to see how people will adapt to it.

something that especially interests me is what are his pipelines like, wonder if they're setup faster. Would also be interesting to know if he's using the OpenGL Proprioty 3D format, because that sucker is LARGE and memory demanding.

Login to post a reply

Server time is: 2024-04-19 05:14:30
Your offset time is: 2024-04-19 05:14:30