Archived

This topic is now archived and is closed to further replies.

justinwalsh

NEWBIE :: Smooth 2d game engine w/ effects

Recommended Posts

I am going to make my first venture into opengl, and need some help w/ the following. What is a really good book for opengl? My main goals are to be able to make a 2d game, where all the images in the game are blended into each other "no jaggies", and maybe i want to add lighting effects, particle effects, and other 3d type effects into my strctly 2d games, maybe some 3d backgrounds like the street fighters have been doing. But the focus is high quality 2d visuals, with all kinds of crazy effects that will need hardware acceleration. So i looked at nehe a bit. But no one seems to care about 2d games anymore. Please post any links, articles, and books that would help me start of the world of opengl. I will need to get pretty indepth, because i want to create some comercial quality effects, like possible water filling up the 2d arena and haveing the water distort the image etc. I know it sounds like alot, but i have been programming for a whil just never got deeply into graphics programming, i started out games with the CDX library, but it is far too limited for what i want to do. And now after completing more c++ classes i am ready to write my own code from ground up. Using the opengl library of course.

Share this post


Link to post
Share on other sites
Not sure that OpenGL is the best option for 2D

OpenGL is primarily designed for rendering 3D images. It''s main design goal is to provide a portable API to access graphics hardware, so you can use it to draw & do the extremely processer intensive 3D images & transformations as such.

In 3D programing using OpenGL and other similar APIs you try try to leverage the API as much as possible and get IT do the work for you, you don''t go around writing algorithms to rotate objects and smooth edges, you can, but the API can do it much faster using the hardware unlike you using the CPU.

But in 2D programming you pretty much handle all the work on your own. And I''m not convinced that OpenGL is the best option for that. Ideally you would like to draw to the framebuffer in video memory, you can do that in OpenGL, but it''s not very fast.

I think the best bet for 2D is DirectDraw, as that is what its made for. It may not be any faster but atlease it offers a more extensive API for drawing 2D images.

If you really wanna do OpenGL, in my opinion the only book you need is The OpenGL Programming Guide (aka Red Book). I personaly believe that too many books spoil the soup (if they all deal with the same thing). The red book gives you WHAT YOU NEED TO KNOW. No bullshit or needless crap. It can be tough, but if you pay attention you can understand it. After that Guide to OpenGL® on Windows® From Silicon Graphics® should give you the info to plug your OpenGL knowlage into Microsofts world, how to create OpenGL windows plus a few handy optimizations. Also the fact that both these books are available for free is an added bonus.

Share this post


Link to post
Share on other sites
quote:
Original post by shacksl
But in 2D programming you pretty much handle all the work on your own. And I''m not convinced that OpenGL is the best option for that. Ideally you would like to draw to the framebuffer in video memory, you can do that in OpenGL, but it''s not very fast.


Only if you''re a sadist OpenGL works great as both 2d and 3d (using it for 2d myself). By using it you can get the graphics card to do the heavy lifting for you so you can use more intensive operations like blending, rotation, lighting etc. with minimal effect on performance.

If you''re learning OpenGL, about the best resource is the Red Book. You can look up the actual API specs & docs in the OpenGL Blue Book (not avalible online I think, but you can use MSDN if you only need v1.1 which is good for starting with).

Share this post


Link to post
Share on other sites
Just like you where saying, I do want the graphics card to take a load of my 2d application. I want to use all kinds of rotation''s blending anti-aliasing lighting particle, 3D like application effects in a 2d world. I will still be useing sprites and such but we are talking a much higher resolution, I want this to look beautiful and smooth, from the things i have made so far alot of things i make look kinda SNES dated, look what they did on PS with Castlvania Symphony of The Night. I want to find a way to get as close to prerendered photoshop like quaility images in realtime. if that makes any since?

Share this post


Link to post
Share on other sites
I find that openGL is perfect for 2D.. Its fast, very easy to learn and setup and great for making a 2d game totally resolution independent.

After working on Visual Pinball for 2 years under DirectX.. Going to openGL was a lot of fun and I would recondmend it to anybody..


Jumpman - Under Construction


[edited by - Jumpman on October 9, 2003 4:45:14 AM]

Share this post


Link to post
Share on other sites
The answer for having a 2D games be jaggies-free comes in two words: alpha channels.

No matter if you use OpenGL and HW accenelration: if you use a hard, 1-bit mask for your sprites, they will look jagged, or blocky around the edges, when scaled up (even with bilinear filtering).

Using already smooth and antialised 8-bit alpha channels as maks for sprites will give you much better results, no matter if you''re using HW acceleration, or if you''re writting to a memory buffer on your own.

Share this post


Link to post
Share on other sites