blitting 2D shaders - how is ET so fast?


(sniser) #1

I hope it’s okay to ask this here as it’s, strictly speaking, about NOT modding ET :stuck_out_tongue: I played around with making a simple arcade game (2D) for a bit, and now I’m thinking it might be nice to move from ET to SDL (for starters, having to boot up ET after each compile is a huge waste of time)… but I noticed that blitting a graphic (with alpha) is awfully slow. 1000+ particles (= 2000+ shaders drawn) is no problem under ET at 50 FPS - but my SDL attempts so far don’t even come close to that. And you have to consider that ET is drawing a full 3D scene at the same time, too! Currently I’m looking into using OpenGL - but documentation/tuts on that particular application seems sparse and I’m a noob, so that’ll take a while. (And of course it’s likely that that I tried so far was the worst possible way to do it :D)

My question is this: once I figure out what to do (and assuming I don’t fuck up in the process), can I expect to get similar 2D performance as ET by using SDL+OpenGL? Or is there some h4x0r quake engine magic at work? If so, how close can I get with using n00b magic?

I’m not asking for tips or links here, just wanna know wether I’m wasting my time :confused:


(kevinski) #2

Heh. If you figure it out, you should make a knock-off of Barrage Tribe. Top-down shooter on crack, I say.


(Balr14) #3

That’s pretty much why the Q3 engine costs $500k to license.


(sniser) #4

I just saw this:
http://archives.seul.org/linuxgames/Jun-2002/msg00019.html

> I was reading an earlier thread about OpenGL vs SDL for 2D, and it ended in
> saying that OpenGL is considerably faster than SDL in almost all cases simply
> because of hardware optimization.

Yes.

So I hope that will improve the situation. I guess the Quake engine is very efficient, but then again it IS using OpenGL, right?

Speaking of 2D games… I myself am not going to try that, but it should be possible to use the existing netcode, remove the map loading and 3D rendering, change the input/“physics” stuff und do some (any) kind of multiplayer 2D game… is anyone doing something like this?


(SCDS_reyalP) #5

The ‘2d’ stuff in ET (and Q3 of course) is textures. Using the texturing hardware to draw that kind of thing is very quick, and simple to do in OpenGL.

There is a platformer mod for Q3. See http://www.planetquake.com/fatmods/


(jamez) #6

i dont know about sdl but proper opengl without any 3rd party crap is easy

first off load the cg library, compile the shader
then iterate each particle (ofcourse u wud hav already for sdl)
and open with glbegin(GL_POLYGON)
then each vertice in the particle
then end with glend()

many better tutorials at nehe.gamedev.net

btw the q3 engine is 250 grand but u have to be working on a recognised something

and i suspect id will do another one of their beautiful charities to the open source community once doom 3 is out for a while

(noting really special about q3 except for its speed, shaders, networking, curves are all simple and have many tutorials)


(sniser) #7

No worries, I had the SDL/OpenGL working a short while after I posted (but then kinda lost interest haha).

It seems to be at least at fast as ET, so :stuck_out_tongue: to “That’s pretty much why the Q3 engine costs $500k to license.” :smiley: