OpenGL in Commander Genius

All discussion about the Commander Genius project (a Keen interpreter + more).
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

OpenGL in Commander Genius

Post by gerstrong »

I don't know anything about OpenGL, but I have been learning a bit, and I tried to load the screen as one rectangular texture. As most of you know, that this is very slow, but it is the best way to implement it for now. When it works properly, I'm going to optimize that.

To give you a little taste of the upcoming mayor version, here a screenshot: (Version 0.2.9)

Image

This is a normal (linear opengl) hardware scaled screen. It looks worse than the scale2x or 3x filter, but as you can imagine, it uses the advantage of hardware accelerated graphics.

The result is very amazing. CKP is 20 times faster on my machine (approx.) than with software rendering. So what do you think?

Give me some opinions. Maybe you have some ideas to improve the OpenGL feature.

Ahh, I almost forgot. I have optimized the Sound Class again. This next version will also come with better sounds!
User avatar
tulip
Flower Pot
Posts: 2520
Joined: Thu Aug 21, 2008 12:50
Location: Hamburg, Germany
Contact:

Post by tulip »

As of now this just looks blurry. If it's possible to make it sharp and look somewhat like the scale2x filter, I'd go for it. But if it stays looking like this I'd say theres no use for it.
Image You crack me up little buddy!
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

@Tulip: That won't be any problem. It's only a question of performance.

This filter is "Linear". I don't know what other exist in OpenGL. I'm still investigating

"Nearest" works the same, and it's a scale without filter but faster, of course.
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

Okay, here goes the second try!

Image

The left one uses Scale2x, like you know it from CKP, but OGL transforms it to your chosen resolution. In this case it is 1024x768. The right one is the same case except that it is scale3x. Check out the lollipops! The seen difference is smaller now, but Scale2x is much faster!

What do you think? I'm thinking to implement scale4x. I imagine that it is faster than scale3x, because 4 is power of 2. It can simply bitshift everything like in scale2x. However scale4x, will only be available in conjunction with OpenGL.
User avatar
tulip
Flower Pot
Posts: 2520
Joined: Thu Aug 21, 2008 12:50
Location: Hamburg, Germany
Contact:

Post by tulip »

Looks good, let's see what x4 can do, I'll try it on my machine.
Image You crack me up little buddy!
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

Image

Scale4x + OpenGL and 1024x768. Here you go!

The performace is very similar to Scale3x (a bit less). It will run faster on 32-bit Systems, because Scale2x and Scale4x use MMX Instructions. I don't know how to implement that for 64-bit Build (Linux), because this is the ASM-Part of ScaleX, which has to be changed. Windows users won't have that problem. Maybe someone has a good idea.

I'm still working on the new version.

EDIT: Youtube: http://www.youtube.com/watch?v=qmf0mrdNMyY
User avatar
Deltamatic
Vorticon Elite
Posts: 1418
Joined: Sun Apr 26, 2009 12:55
Location: Shreveport, Louisiana

Post by Deltamatic »

I'm rather in the dark here... what is this Commander Genius? It looks like a higher-resolution Keen 1 with a two-player option, but that's all I know. :confused
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

No more Screenshots now, because....

Next version of Commander Genius has been released. Yes! 0.2.9! This time we have OpenGL. Try it out! And you will get the wonderful graphics you have seen here!

@Deltamatic: Commander Genius is CKP (CloneKeenPlus) passed to C++ (Partly), which interprets the original Commander Keen 1-3 Series. It is based on CloneKeen and has been improved by myself since December 2008. There are more features than just Hi-Res or 2-Player Support.

With High Quality Pack (HQP), also for free under "Downloads", you can enjoy the full game with better sounds and even music!

Do you have a gamepad? Fine. You can also map it to any buttons you want. But why to tell you more? Just try it out! http://clonekeenplus.sourceforge.net/
Galaxieretter
Arachnut
Posts: 891
Joined: Thu Nov 01, 2007 2:35
Location: Lancaster PA
Contact:

Post by Galaxieretter »

Okay I've been kind of staying out of these topics for a while... but I want to say this...

Having a 1024 x 768 pixel smoother is nice, especially with the higher resolutions.
But I would rather have the sprites be at the same pixel height and size and simply SHOW
more of the game than is visible with the original 320x200.
For example at 640x400, it would show twice as much of the screen as in the original game.
You know what I'm saying?

Would this be possible to implement in future releases?
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

Having a 1024 x 768 pixel smoother is nice, especially with the higher resolutions.
But I would rather have the sprites be at the same pixel height and size and simply SHOW
more of the game than is visible with the original 320x200.
For example at 640x400, it would show twice as much of the screen as in the original game.
You know what I'm saying?
Sorry, I don't understand what you really mean. Do you want to have the possibility in choosing 320x200 and 640x400? Or do you want to disable the smooth filtering.

I'm planing to change the resolution system. I want to support all resolutions that your video-card can support. There is a function in SDL which allows that. I'm also planning to implement screen ratio.

However, if you only want to disable the filtering but reserve the resolution and you have OpenGL enabled. Just go again into the video config, and you will see OGL Filter : Linear. Just change it to Nearest and the other scaleX, change it to "No Scale"

That will give you the original resolution transformed into your given resolution.

Furthermore, If you disable OpenGL and use "No scale", it won't scale the image neither.

Hope, I was able to answer your question.
User avatar
Commander Spleen
Lord of the Foobs
Posts: 2384
Joined: Wed Oct 31, 2007 22:54
Location: Border Village
Contact:

Post by Commander Spleen »

What he's asking for is to use the extra graphical space to display more of the level instead of just stretching the output to a new resolution. Like what Jazz Jackrabbit 2 did.

I'm not so sure I'd use it, but it wouldn't hurt to have it as an option.
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

That's a good idea. I'll add it to my wishlist tracker.

I have tested CKP on another machine with ATI Radeon. I'm surprised, because nothing is shown at all.

So, I'm sorry for those, who have trouble getting it run with OpenGL. You will have to stick back with Software Rendering, while I seek for the different causes, which provoke those problems and resolve them.
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

The new version is have optimized OGL Routines. Check it out and tell me. However I'm still working on it!
gerstrong
Vorticon Elite
Posts: 1244
Joined: Wed Dec 31, 2008 14:44
Location: Frankfurt - Germany
Contact:

Post by gerstrong »

Hello Guys,

I have been thinking about the OpenGL effects, and I came to the decision to concentrate more on the development of other features. I'm not going to implement special OGL effects for now. Sorry for those bad news. They would give a nice kick to the game, but I'm not good at OGL, and I would take much more time. Besides that, it isn't that important. Maybe someone else wants to help with this. Patches are always welcome.

Commander Genius 0.3 is the next version and I want it stable and nice. Only OGL for acceleration will be used and only for those with NPOT-Textures support,

I will be working more on remaining bugs and missing features like 2-Player Controls. 0.3 should give what it promises.

@Ceilick: I have fixed the pogo-problem. Until 0.3 this should be like in the original game. I'll be sending some pre-versions, but only a few. ;-) 0.3 is coming soon!
User avatar
DaVince
lazy/busy Keener
Posts: 1476
Joined: Thu Nov 01, 2007 15:34
Location: Amsterdam, Netherlands
Contact:

Post by DaVince »

OpenGL mode doesn't work for me; I just get a white screen. I emailed the logfile+description to you.
Wow look at me I'm lurking
Post Reply