Sign in to follow this  
eXonius

OpenGL OpenGL or Direct3D, again...

Recommended Posts

eXonius    122
Sorry about asking this again I know it has been discussed several times before. Anyhow, since OpenGL 3.0 turned out to be such a disappointment, does this mean it could be better to start learning Direct3D, when learning one of them from scratch? Which one is better for small home projects, like small games, and which one could be better to learn for the future if you are to work with 3D programming? Now if you think I should learn both, then the question is which one I should learn first. Cross-platform isn't really important for me right now even though it would be nice. I've been reading around at some of the older threads and it seems like a lot have recommended OpenGL so I just want to check if the opinions have changed. Thanks in advance.

Share this post


Link to post
Share on other sites
Daaark    3553
Quote:
Original post by eXonius
Sorry about asking this again I know it has been discussed several times before. Anyhow, since OpenGL 3.0 turned out to be such a disappointment, does this mean it could be better to start learning Direct3D, when learning one of them from scratch?
Either will do fine.

Quote:
Which one is better for small home projects, like small games,
XNA Game Studio.

Quote:
and which one could be better to learn for the future if you are to work with 3D programming? Now if you think I should learn both, then the question is which one I should learn first.
Just pick one.

In the end, 3D programming concepts are the same, it's just 2 different APIs. It's like using printf or cout. They are different, but achieve the same thing. They both have functions that set up data to be fed to the GPU, and most of the advanced stuff is done in shaders anyways.

Share this post


Link to post
Share on other sites
Dunge    405
You should instead decide whether you will learn using the fixed pipeline or using shaders. HLSL and GLSL look nearly the same. The libraries functions of DX/OGL you call from C/C++/"anything else" might seems different, but it ends up sending the same instructions on the video card.

Share this post


Link to post
Share on other sites
eXonius    122
Quote:
Original post by Daaark
XNA Game Studio.

Okay, I'll look into that also, though I just wonder if I'll learn as much from using this? Although my main goal is to learn as much as possible about 3D programming and the results aren't just as interesting.

Quote:
In the end, 3D programming concepts are the same, it's just 2 different APIs. It's like using printf or cout. They are different, but achieve the same thing. They both have functions that set up data to be fed to the GPU, and most of the advanced stuff is done in shaders anyways.

But cout can be smarter than printf somethimes and I just wonder if it's the same with OpenGL and Direct3D.

Quote:
You should instead decide whether you will learn using the fixed pipeline or using shaders.

Sorry but I don't really know what the difference is =/

Share this post


Link to post
Share on other sites
Look at the following list of pros(good things) about each API and then just pick one based on what you think --->

DirectX
-------
- Has many APIs to do many things such as DirectSound for sound and Direct3D for 3D programming (there are many more APIs) but is restricted to just work for Windows.

OpenGL
------
- Is cross-platform but does not focus on anything but 3D programming.

Well this isn't really all of it but...

Share this post


Link to post
Share on other sites
eXonius    122
Quote:
Original post by GuyWithNoAccent
Look at the following list of pros(good things) about each API and then just pick one based on what you think

Though this is more like a comparison between DirectX and OpenGL, for now I'm only interested about the differences of Direct3D and OpenGL (=

Share this post


Link to post
Share on other sites
Dunge    405
One way or another you will end up doing:
1. Creating window/associating gfx adaptor to a device with this window.
2. Filling up rasterizer states.
3. Filling up buffers (vertices, indices, etc).
4. Clearing the screen.
5. Setting up WVP matrices for each objects
6. Render each objects and go back to 2 or 4.

XNA kinda just hide some step that often comes to be set in the exact same way in all projects and give you some helper functions and methods to do your work faster, but allow you to have nearly the same results than you would get with the hard way.

The fixed pipeline (DX8, DX9 and OGL without shaders). Will render the object in the "normal" looking way. You can add lights (directional/points/spots) using libraries functions. The programmable pipeline (DX10 force you to use it) need and HLSL/GLSL/CG file who is a shader program to instruct your video card on HOW to render the primitive you send it. It allow you to do neat effects, you own lighting models, etc. It is becoming a industry standard, and I guess will be there for a while, but demand more work. DX11 will be strongly based on DX10.

Share this post


Link to post
Share on other sites
undead    368
I'm probably biased as I've been disgusted by the insane extension system of OpenGL ages ago (the time when 3dfx was still around). I had to get function pointers for.. uhm.. everything.. including multitexture functions.

I'd go for DirectX for several reasons:
1- you get "extra APIs" like xaudio2 or directsound
2- XNA is closer to DirectX, so if you decide to start with XNA it's probably better to continue later with DirectX. Or viceversa... who knows?
3- I never tried it but there's also SlimDX, a framework that can help you writing DirectX apps. If I'm not mistaken it's mantained by people writing here on gamedev.net.
4- DirectX SDK also includes an helper library, D3DX, which also includes useful math classes that can help you concentrate on the real thing.

On the other hand, OpenGL is simpler, probably the resulting code is cleaner, it's portable and you can learn the basic concepts of graphic programming without the need to worry about the underlying hardware architecture.

My experience is at first Direct3D seemed to me "crazy and bloated". Now I feel confortable with it and I think I'd have some problem writing code for an abstract API like OpenGL.

But again.. it's up to you, neither D3D nor OpenGL can hurt you. :)

Share this post


Link to post
Share on other sites
clb    2147
If this is something you want us to vote on, I'd say Direct3D. PIX and PerfHUD are invaluable for me both in debugging and performance profiling. OpenGL's got gDEBugger, but it's not free and not as functional as PIX.

I like the Direct3D API to be cleaner than OpenGL's, and you don't need to do that much validation on device capabilities. I found the OpenGL extension jungle difficult for me, especially because nVidia and AMD don't really seem to agree on common extensions to support.

I've had more success writing code with better performance on Direct3D than OpenGL, but that's just based on my experience. Certainly you can work quite fast in both.

But anyhow, even if OpenGL 3.0 turned out to be a disappointment by some, that doesn't mean that the previous version of the API all of a sudden became any worse, right? If you're really tied on which one to use, try both for a slight while to see how common tasks work with them and then choose one based on your experience.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By ZeldaFan555
      Hello, My name is Matt. I am a programmer. I mostly use Java, but can use C++ and various other languages. I'm looking for someone to partner up with for random projects, preferably using OpenGL, though I'd be open to just about anything. If you're interested you can contact me on Skype or on here, thank you!
      Skype: Mangodoor408
    • By tyhender
      Hello, my name is Mark. I'm hobby programmer. 
      So recently,I thought that it's good idea to find people to create a full 3D engine. I'm looking for people experienced in scripting 3D shaders and implementing physics into engine(game)(we are going to use the React physics engine). 
      And,ye,no money =D I'm just looking for hobbyists that will be proud of their work. If engine(or game) will have financial succes,well,then maybe =D
      Sorry for late replies.
      I mostly give more information when people PM me,but this post is REALLY short,even for me =D
      So here's few more points:
      Engine will use openGL and SDL for graphics. It will use React3D physics library for physics simulation. Engine(most probably,atleast for the first part) won't have graphical fron-end,it will be a framework . I think final engine should be enough to set up an FPS in a couple of minutes. A bit about my self:
      I've been programming for 7 years total. I learned very slowly it as "secondary interesting thing" for like 3 years, but then began to script more seriously.  My primary language is C++,which we are going to use for the engine. Yes,I did 3D graphics with physics simulation before. No, my portfolio isn't very impressive. I'm working on that No,I wasn't employed officially. If anybody need to know more PM me. 
       
    • By Zaphyk
      I am developing my engine using the OpenGL 3.3 compatibility profile. It runs as expected on my NVIDIA card and on my Intel Card however when I tried it on an AMD setup it ran 3 times worse than on the other setups. Could this be a AMD driver thing or is this probably a problem with my OGL code? Could a different code standard create such bad performance?
    • By Kjell Andersson
      I'm trying to get some legacy OpenGL code to run with a shader pipeline,
      The legacy code uses glVertexPointer(), glColorPointer(), glNormalPointer() and glTexCoordPointer() to supply the vertex information.
      I know that it should be using setVertexAttribPointer() etc to clearly define the layout but that is not an option right now since the legacy code can't be modified to that extent.
      I've got a version 330 vertex shader to somewhat work:
      #version 330 uniform mat4 osg_ModelViewProjectionMatrix; uniform mat4 osg_ModelViewMatrix; layout(location = 0) in vec4 Vertex; layout(location = 2) in vec4 Normal; // Velocity layout(location = 3) in vec3 TexCoord; // TODO: is this the right layout location? out VertexData { vec4 color; vec3 velocity; float size; } VertexOut; void main(void) { vec4 p0 = Vertex; vec4 p1 = Vertex + vec4(Normal.x, Normal.y, Normal.z, 0.0f); vec3 velocity = (osg_ModelViewProjectionMatrix * p1 - osg_ModelViewProjectionMatrix * p0).xyz; VertexOut.velocity = velocity; VertexOut.size = TexCoord.y; gl_Position = osg_ModelViewMatrix * Vertex; } What works is the Vertex and Normal information that the legacy C++ OpenGL code seem to provide in layout location 0 and 2. This is fine.
      What I'm not getting to work is the TexCoord information that is supplied by a glTexCoordPointer() call in C++.
      Question:
      What layout location is the old standard pipeline using for glTexCoordPointer()? Or is this undefined?
       
      Side note: I'm trying to get an OpenSceneGraph 3.4.0 particle system to use custom vertex, geometry and fragment shaders for rendering the particles.
    • 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.
       
  • Popular Now