PDA

View Full Version : Jedi-SDL based 3d engines



godbeast
09-03-2007, 04:33 PM
I know that there is a possibility of using sdl with opengl, but as far as i'm concerned you have to abbandon sdl's surface managing (video) functions. Thus, the question is, does any 3d model animation engine exists that is compatible with jedi-sdl and freepascal? By compatibility, I mean stable surface mixing or drawing on pSDLsurfaces etc.

I'm asking, because I need both sdl 2d api and some 3d api (models) for my project. Since I have some serious artists in my family, I came up with an idea of mixing prerendered, maybe hand painted 2d backgrounds with 3d models. For me it sounds perfect for an oldstyled action adventure game. The point is that models have to fit to background (cell shading?). Ecstatica 2 by Psygnosis looks just awesome, I'd like to do get similar effects (screenshots here: http://www.gamespot.com/pc/action/ecstatica2/screenindex.html?om_act=convert&om_clk=gsimage)

I belive that everything could be accuired with OpenGL, but still I'd rather use plain JediSDL. So is something what you see at screenshots above is doable with sdl?

WILL
09-03-2007, 05:22 PM
I belive that everything could be accuired with OpenGL, but still I'd rather use plain JediSDL. So is something what you see at screenshots above is doable with sdl?

Actually you don't. Trust me. ;)

I made the transition from SDL 2D to OpenGL 2D just last year. I converted all my 2D stuff that used SDL surface routines to use only OpenGL. Why? Hardware acceleration.

SDL does not make use of your hardware for any of the effects you will eventually want to partake in; rotation, blending, alpha test or scaling. Sad, but true. SDL surface functions and OpenGL do not play nice together.

All is not lost though. :) OpenGL is GREAT for 2D. And everything runs so smooth you'll wonder why you didn't use it before. :thumbup:

You can keep the rest of your stuff with SDL, which is great for input controls and all the window management, which is what I do. Plus if you want to take advantage of sdl_image, for loading PNG or another format you are able to do this as well.

If you would rather have a simplified set of draw commands it is possible to make your own set and optimize according to your needs.

godbeast
09-03-2007, 06:09 PM
Okay. I suppose I restart again.

Any good wrappers or rather plain OpengGL?

WILL
09-03-2007, 08:27 PM
Use the ones that come with JEDI-SDL. :)

SDL supports OpenGL, you just can't use the SDL graphics functions with it.

The good thing about this is that OpenGL doesn't do window management for you (at least it's kind of a pain from what I've read) so you will be able to have SDL take care of it for you.

You're basically not changing anything, but the graphics code. So it's not that bad.

jdarling
09-03-2007, 09:01 PM
GLScene is a VERY good OpenGL wrapper for Delphi. Though its implementation in Lazarus is still a bit lacking. Its useable in Lazarus, just not to the level it is in Delphi.

http://glscene.sourceforge.net/wikka/HomePage

savage
10-03-2007, 12:20 AM
DeathTrucktion - http://deathtrucktion.online.fr/ a 3D car driving game, was written using JEDI-SDL with OpenGL and I believe compiles with FreePascal. Assuming you have the v1.0 from CVS it should compile without too many complaints on just about all platforms where SDL and OpenGL run.

Traveler
10-03-2007, 11:25 AM
You should take a look at the phoenix lib (http://www.pascalgamedevelopment.com/viewtopic.php?t=3345&postdays=0&postorder=asc&highlight=phoenix&start=195), Andreaz (and a few others iirc) developed some time ago. I believe the general idea was to make it a wrapper for opengl. I'm not sure about it's current state, but I have seen the demos and they were quite impressive.

jdarling
12-03-2007, 01:13 PM
Actually project phoenix is more about 2D games in OpenGL via SDL. Nothing to do with 3D games at all. As far as I know its still being developed on, though while the compo is going I think alot of us are more focused on our entries then on Phoenix :).

Traveler
12-03-2007, 03:23 PM
Ah, you're right, my bad.

godbeast
12-03-2007, 05:19 PM
Thanks for your answers so far. Phoenix still looks promising anyway. Demos indeed look great for 2d, if there is a possibility of mixing it with OpenGL routines then Phoenix is what I need.

Here is strictly what I wanna achive:

* mostly (around 80% of gameplay) 2d view (sprites as enviroment) plus 3ds models as characters and some parts of enviroment (like trees) on top of them;

* for rest of gameplay, 2d prerendered (painted) background and 3ds models viewed from apropraite camera. That's way I don't want to prerender character movements as sprites.

So does any library for pure FPC (not Lazarus) fit these conditions? I belive that it's probably OpenGL :D

savage
14-03-2007, 10:16 PM
Btw, another FreePascal 3D OpenGL engine which was quite impressive, but no one seemed to pick up on was the Linderdaum engine. They have since re-written the engine in C++ but the FreePascal version can be downloaded from http://www.linderdaum.com/downloads.html. It also include the flight demo they did with it. It may be worth checking it out.

jasonf
15-03-2007, 09:52 AM
I've just done a search and come accross a site which seems useful, it explains a few OpenGL issues that the SDL developer might come accross

http://osdl.sourceforge.net/OSDL/OSDL-0.3/src/doc/web/main/documentation/rendering/SDL-openGL.html

Once I've got my basic game engine sorted out and I'm happy with it, I'll work on an OpenGL version (Technomage, are you busy one weekend?)

I'll have some problems though, none of my textures are powers of 2.. I'll have to write some sort of GL Texture loader which breaks textures into chunks... (getting a migraine just thinking about this) or pads out to the correct size.