Archived

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

JnZ

OpenGL Is OpenGL good for games?

Recommended Posts

Midnight Coder    122
Really, it is completely a matter of preference. What is right for some, may not be right for you. OpenGL isn't better than Direct3D, and Direct3D isn't better than OpenGL. Both have advantages/disadvantages, strengths and weaknesses. Both would be equally good for a 3D game engine. You should find out some information on both, and decide for yourself which is better.

Edited by - Midnight Coder on August 21, 2001 2:56:38 AM

Share this post


Link to post
Share on other sites
Wavewash    202
Dude! they are totally equall now. With DX8. OpenGl and directx are totally equall APIs it''s just a preference of the programmer now.
~Wave

Share this post


Link to post
Share on other sites
bobatefrei    122
"Well witch is faster?"
- This is totaly driver dependant. My TNT 1 is a bit faster with OpenGL especially in windowed mode... What about the other cards?

"OpenGl and directx are totally equall APIs it''s just a preference of the programmer now."

-Under Windows, it is now true. But for other OS, you don''t have choice: there is only OpenGL.


Share this post


Link to post
Share on other sites
grady    122
Its a matter of preferences as to which is better but whether or not to marry a 600 pound woman is a matter of preference too, so that doesn't mean preferring direct3D can't be considered insane by the rest of us.

So its a matter of preference, but whatever you decide never be seduced away from OpenGL by the shit storm of bad publicity surrounding OGL extensions. Nvidia claims that there texture shader extension for OpenGL is "a bit more powerful" than Direct3D's pixel shaders. why is this? I guess its because Nvidia can write there own standards for their own hardware with OpenGL. Of course when ATI comes out with some hardware that can do texture shading, then OpenGLer's will have to deal with 2 extensions until texture shaders get unified into an EXT or ARB class extension. But OpenGLer's will be able to expose the nuances of both the ATI and NVIDIA texture shaders where as the Direct3Der's are stuck with whatever the 3D graphics geniuses at Microsoft think should be standard. BTW texture shaders are easy to use in OpenGL*. so dealing with the extension, and God forbid 2 extensions for the same thing, is no big deal; getting the most out of the hardware is a good thing and the extension scheme lets you do that . That's just texture shaders though; I guess you should find out as much as possible about both API's. Here's a good site for OGL: www.opengl.org. I'm sure you've seen the DirectX msdn site www.msdn.microsoft.com/directx; if not you can download the documentation and see what that's all about.

* there aren't any new functions, just several new constants that you pass as parameters to some already existing functions so putting together a texture shader is fairly easy you could probably get something going from scrath in one afternoon on your first try. Coming up with something that looks good might be difficult but thats a matter of art not API.

Edited by - grady on August 21, 2001 6:17:52 AM

Share this post


Link to post
Share on other sites
Drizzt DoUrden    100
Allright, this is the fourth time i answered this SAME EXACT question in the last 24 hours. Direct X is better if you are trying to make 2D games because 1)there are barely any tutorials on making 2D games in opengl 2) there no books on making 2D games in openGl. OpenGL is goood because it is multiplatformed. If you want to learn opengl, then read kevi and Daves(members of the GDNet staff) book called OpenGL Game Programming. For direct X, andre lamothes Tpis and Tricks of the Gurus or something like that, so i am told. 2D games can be made with OpenGL, but good luck finding out how, I have been trying for almost 20 days, searching al over the net, but all I can find is NeHe''s 21st tutorial. And yes, direct x does make 3d games, they can do everything the same way, just 2D with openGL is harder to find out how to do, and to do in general. If you are looking to get into the Game Development bussiness, I would suggest learning Direct X first, then OpenGL, knowing both would reallly help.
Good Luck.

"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden

Share this post


Link to post
Share on other sites
sjobergh    122
Hmm, If I was you (which I''m not), I would go for OpenGL.
It''s way easier to use (and faster than D3D on some graphic-cards

But, I would still use some DX components like DInput and DSound.

And the thing that OpenGL can be ported to Linux and Mac is great for a bigger group of users (when you finally release a game).

Good Luck!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Drizzt DoUrden:

Actually DirectGraphics is in the same state of capabillities with OpenGL now, 2D graphics is achieved by simply texturing a quad (essentially billboarding) and holding your camera to a fixed position. And then you use methods like Alpha Blending etc... to achieve your required affect. You move your "sprite" around the world by using the same 3D transformation techniques such as translations and rotations. Why not just use DX7 and use DirectDraw? Well firstly your 2D game now is accelerated meaning you can get away with alot more. Secondly you can still make use of the 3D features and create some nice effects which were hard to do or impossible using just bitmaps. And I wouldn''t say that "OpenGl in 2D is hard to do", it doesn''t take an einstein to work out how you can trick the user into thinking it''s 2D and that''s what it is all about .

Share this post


Link to post
Share on other sites
Bully    144
Drizzt DoUrden:

Actually DirectGraphics is in the same state of capabillities with OpenGL now, 2D graphics is achieved by simply texturing a quad (essentially billboarding) and holding your camera to a fixed position. And then you use methods like Alpha Blending etc... to achieve your required affect. You move your "sprite" around the world by using the same 3D transformation techniques such as translations and rotations. Why not just use DX7 and use DirectDraw? Well firstly your 2D game now is accelerated meaning you can get away with alot more. Secondly you can still make use of the 3D features and create some nice effects which were hard to do or impossible using just bitmaps. And I wouldn''t say that "OpenGl in 2D is hard to do", it doesn''t take an einstein to work out how you can trick the user into thinking it''s 2D and that''s what it is all about .

Share this post


Link to post
Share on other sites
TheRealMAN11    142
Ok I asked this same question a few months back. Some might remember. Since then I have used both OGL, D2D (in dx7), and D3D. I would have to sum it up like this (just like every one else did).

They have the same power and prettymuch the same ease of use. The differences are OpenGL is supported on nearly all operating systems where as DirectX is stuck on windows.

Now let it be clear that DirectX includes input, sound, networking, and graphics where as OpenGL only includes graphics. If you wanted sound you could use OpenAL, and for networking HawkNL (formerly OpenNL), and for input you could use SDL (from what I hear).

So if you plan on making a game that is intended only to run on windows, and you do not mind using microsoft stuff use DirectX.
But if you plan on making game that is intended to run on a bunch of operating systems or you hate MS use OpenGL. Simple.

Or if you are using Dev-C++ and you can''t get DX to work use OGL (like I did).

Matthew
WebMaster
www.Matt-Land.com

Share this post


Link to post
Share on other sites
draqza    122
Wow... an OpenGL vs. DirectX thread that hasn''t turned into an out-and-out flamewar and hasn''t been closed by a mod.

Personally, I prefer DX, but I''m biased because OpenGL programs don''t run right when I compile them on my computer.

Share this post


Link to post
Share on other sites
Drizzt DoUrden    100
You will never learn how to du 2D games with OpenGL(until Shining Knight puts out his tutorial ) because the only tutorials are from Nehe, wihich isnt bad, but the tutorials arent good enough. They teach you a ery slight bit how to use textured quads, but not enough on how to control them, and create multiple bitmaps for games. OpenGL is better anyway in my opinion, if you can figure it out by yourself.

"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden

Share this post


Link to post
Share on other sites
Shag    122
in reply to Drizzt ...

if you can''t use OpenGL to make a 2D game, because you can''t find a tutorial ... then maybe you should concentrate on learning to program first. quite franky, all the information you need if already on the Nehe site.

whichever API you choose ... you''ll still need to learn the same basic skills. unfortuanately this is down to the programmer, not the API. DirectX probably simplifies some tasks for 2D game creation, but it''s still down to you to write the code

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
quote:
Original post by draqza
Wow... an OpenGL vs. DirectX thread that hasn''t turned into an out-and-out flamewar and hasn''t been closed by a mod.

Personally, I prefer DX, but I''m biased because OpenGL programs don''t run right when I compile them on my computer.



It''s because I gave it my blessings ;D

Share this post


Link to post
Share on other sites
Bully    144
quote:
original post from Drizzt DoUrden You will never learn how to du 2D games with OpenGL(until Shining Knight puts out his tutorial


Errr... I''m sure I could manage .

Share this post


Link to post
Share on other sites
xlauvillx    122
"Now let it be clear that DirectX includes input, sound, networking, and graphics where as OpenGL only includes graphics. If you wanted sound you could use OpenAL, and for networking HawkNL (formerly OpenNL), and for input you could use SDL (from what I hear)." - TheRealMAN11

hmm, where can i find info on OpenAL, HawkNL and SDL for use in my games? anyone?

Share this post


Link to post
Share on other sites
Tha_HoodRat    156
quote:
Original post by Drizzt DoUrden
bah. You people arent understandingwhat i mean. here are tutorials on programming rpgs in direct x. There are tutorials by nehe that worked fine for me. But they arent exactly for PROGRAMMING 2D games, there is one on making a 2D game, which is what I am learning from. But, my OPINION IS(geez guys, its just ym opinion) that If you intend on making a 2D game ulearn Direct X becasue you have more references. Thats all!

"I''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''Urden

Edited by - Drizzt DoUrden on August 24, 2001 1:02:38 AM
The techniques required to make an rpg or whatever 2d game is constant , the only differnce is the graphics subsystem . The way I design my games is such that if I want to use DX7 I compile with DX7 subsytem headers , if I want to use OGL , DX8 or my VGA , I just plug in the correct headers and libraries.

About the OGL/D3D , I have to say , I lean more towards OGl. I can do anything I want in OGL or DX , but I find that if I need to implement a new feature, I always get it working perfectly in Ogl . It takes a while to get ''it'' working with D3d .


Share this post


Link to post
Share on other sites
gph-gw    122
quote:
Original post by draqza
Wow... an OpenGL vs. DirectX thread that hasn''t turned into an out-and-out flamewar and hasn''t been closed by a mod.

Personally, I prefer DX, but I''m biased because OpenGL programs don''t run right when I compile them on my computer.


I have the exact opposite problem: OpenGL apps run perfectly but DX apps don''t.

Share this post


Link to post
Share on other sites
Null and Void    1088
quote:
Original post by xlauvillx
hmm, where can i find info on OpenAL, HawkNL and SDL for use in my games? anyone?


SDL, HawkNL, OpenAL (also see this for the OpenAL SDK for Win32). SDL and OpenAL are great libraries (I''m going to be using both in my current project), I haven''t tried HawkNL, but it looked pretty good from what I saw.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
gph-gw    122
quote:
Original post by zedzeek
unfortunatly the future of openal aint looking to good at the mo


Actually, it's pretty good.

Quake III
SDL
Mac OS X
NVidia

And lots of others. Opengl isn't going to die any time soon.

Whoops. The letter a does look a little like the letter g, doesn't it?

Edited by - gph-gw on August 24, 2001 12:43:43 AM

Share this post


Link to post
Share on other sites

  • Similar Content

    • By markshaw001
      Hi i am new to this forum  i wanted to ask for help from all of you i want to generate real time terrain using a 32 bit heightmap i am good at c++ and have started learning Opengl as i am very interested in making landscapes in opengl i have looked around the internet for help about this topic but i am not getting the hang of the concepts and what they are doing can some here suggests me some good resources for making terrain engine please for example like tutorials,books etc so that i can understand the whole concept of terrain generation.
       
    • By KarimIO
      Hey guys. I'm trying to get my application to work on my Nvidia GTX 970 desktop. It currently works on my Intel HD 3000 laptop, but on the desktop, every bind textures specifically from framebuffers, I get half a second of lag. This is done 4 times as I have three RGBA textures and one depth 32F buffer. I tried to use debugging software for the first time - RenderDoc only shows SwapBuffers() and no OGL calls, while Nvidia Nsight crashes upon execution, so neither are helpful. Without binding it runs regularly. This does not happen with non-framebuffer binds.
      GLFramebuffer::GLFramebuffer(FramebufferCreateInfo createInfo) { glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); textures = new GLuint[createInfo.numColorTargets]; glGenTextures(createInfo.numColorTargets, textures); GLenum *DrawBuffers = new GLenum[createInfo.numColorTargets]; for (uint32_t i = 0; i < createInfo.numColorTargets; i++) { glBindTexture(GL_TEXTURE_2D, textures[i]); GLint internalFormat; GLenum format; TranslateFormats(createInfo.colorFormats[i], format, internalFormat); // returns GL_RGBA and GL_RGBA glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, createInfo.width, createInfo.height, 0, format, GL_FLOAT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); DrawBuffers[i] = GL_COLOR_ATTACHMENT0 + i; glBindTexture(GL_TEXTURE_2D, 0); glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, textures[i], 0); } if (createInfo.depthFormat != FORMAT_DEPTH_NONE) { GLenum depthFormat; switch (createInfo.depthFormat) { case FORMAT_DEPTH_16: depthFormat = GL_DEPTH_COMPONENT16; break; case FORMAT_DEPTH_24: depthFormat = GL_DEPTH_COMPONENT24; break; case FORMAT_DEPTH_32: depthFormat = GL_DEPTH_COMPONENT32; break; case FORMAT_DEPTH_24_STENCIL_8: depthFormat = GL_DEPTH24_STENCIL8; break; case FORMAT_DEPTH_32_STENCIL_8: depthFormat = GL_DEPTH32F_STENCIL8; break; } glGenTextures(1, &depthrenderbuffer); glBindTexture(GL_TEXTURE_2D, depthrenderbuffer); glTexImage2D(GL_TEXTURE_2D, 0, depthFormat, createInfo.width, createInfo.height, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glBindTexture(GL_TEXTURE_2D, 0); glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, depthrenderbuffer, 0); } if (createInfo.numColorTargets > 0) glDrawBuffers(createInfo.numColorTargets, DrawBuffers); else glDrawBuffer(GL_NONE); if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) std::cout << "Framebuffer Incomplete\n"; glBindFramebuffer(GL_FRAMEBUFFER, 0); width = createInfo.width; height = createInfo.height; } // ... // FBO Creation FramebufferCreateInfo gbufferCI; gbufferCI.colorFormats = gbufferCFs.data(); gbufferCI.depthFormat = FORMAT_DEPTH_32; gbufferCI.numColorTargets = gbufferCFs.size(); gbufferCI.width = engine.settings.resolutionX; gbufferCI.height = engine.settings.resolutionY; gbufferCI.renderPass = nullptr; gbuffer = graphicsWrapper->CreateFramebuffer(gbufferCI); // Bind glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); // Draw here... // Bind to textures glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, textures[0]); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, textures[1]); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, textures[2]); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, depthrenderbuffer); Here is an extract of my code. I can't think of anything else to include. I've really been butting my head into a wall trying to think of a reason but I can think of none and all my research yields nothing. Thanks in advance!
    • By Adrianensis
      Hi everyone, I've shared my 2D Game Engine source code. It's the result of 4 years working on it (and I still continue improving features ) and I want to share with the community. You can see some videos on youtube and some demo gifs on my twitter account.
      This Engine has been developed as End-of-Degree Project and it is coded in Javascript, WebGL and GLSL. The engine is written from scratch.
      This is not a professional engine but it's for learning purposes, so anyone can review the code an learn basis about graphics, physics or game engine architecture. Source code on this GitHub repository.
      I'm available for a good conversation about Game Engine / Graphics Programming
    • By C0dR
      I would like to introduce the first version of my physically based camera rendering library, written in C++, called PhysiCam.
      Physicam is an open source OpenGL C++ library, which provides physically based camera rendering and parameters. It is based on OpenGL and designed to be used as either static library or dynamic library and can be integrated in existing applications.
       
      The following features are implemented:
      Physically based sensor and focal length calculation Autoexposure Manual exposure Lense distortion Bloom (influenced by ISO, Shutter Speed, Sensor type etc.) Bokeh (influenced by Aperture, Sensor type and focal length) Tonemapping  
      You can find the repository at https://github.com/0x2A/physicam
       
      I would be happy about feedback, suggestions or contributions.

    • By altay
      Hi folks,
      Imagine we have 8 different light sources in our scene and want dynamic shadow map for each of them. The question is how do we generate shadow maps? Do we render the scene for each to get the depth data? If so, how about performance? Do we deal with the performance issues just by applying general methods (e.g. frustum culling)?
      Thanks,
       
  • Popular Now