Tips when learning a Graphics API like OGL and DX11?

Started by
11 comments, last by DragonBooster 10 years, 2 months ago

So if i were to learn OpenGL, what would your advice be to avoid getting bitten in the ass by it?

Keep track of everything you bind on your own end. Render targets, framebuffers, textures, VBO’s, IBO’s, etc.
When you finish a bind-to-edit, restore what was supposed to be bound.

Extensively wrap things inside your own wrapper calls.

I won’t go into too much detail here because I am already in the middle of my revised graphics engine and will be posting code that shows how to use OpenGL to simulate Direct3D 11, and it that source code will end up being the most useful resource for studying “proper” and efficient usage of OpenGL.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Advertisement

So if i were to learn OpenGL, what would your advice be to avoid getting bitten in the ass by it?

Keep track of everything you bind on your own end. Render targets, framebuffers, textures, VBO’s, IBO’s, etc.When you finish a bind-to-edit, restore what was supposed to be bound. Extensively wrap things inside your own wrapper calls.I won’t go into too much detail here because I am already in the middle of my revised graphics engine and will be posting code that shows how to use OpenGL to simulate Direct3D 11, and it that source code will end up being the most useful resource for studying “proper” and efficient usage of OpenGL.L. Spiro
Which all brings us back to the first reply on the thread:

OpenGL's design decision is to allow access to all functionality in the core, and allow you access to any functionality you request. That functionality may not be optimal, it may have horrible performance consequences, it may vary between cards, but the choice is to give you EVERYTHING.

Direct3D's design decision is to allow access to a specific family of functionality designed for high performance and broad uniformity. You ask for a family of interfaces and either you get the full set of interfaces or you get nothing.

There are pros and cons to each.

For example, if you want to use D3D9 and get an instance of it you will have a consistent set of functions, but if you later want to use some bit of functionality on newer cards it may be inaccessible even if the card supports it. On the opposite side, with OpenGL you can still push everything through the bus every frame, or you may have slight differences in similar functionality between different families of cards, but you can take advantage of new functionality without rewriting large segments of your code base.

There are many, many, many tradeoffs like that. As broad generalizations nether choice is right or wrong. In a specific situation one might be a better choice than another, and in a different situation the wise choice might be different.

Both of them are fully-featured. Both of them can be used to render beautiful, high performance graphics that take full advantage of the graphics cards.

Either way you choose to go, if you want to take advantage of the latest and greatest graphics technologies you will have a very long journey before reaching mastery. Taking advantage of the incredible power of a modern GPU to its fullest extent is something that can require many years of study.

So if i were to learn OpenGL, what would your advice be to avoid getting bitten in the ass by it?

Keep track of everything you bind on your own end. Render targets, framebuffers, textures, VBO’s, IBO’s, etc.When you finish a bind-to-edit, restore what was supposed to be bound. Extensively wrap things inside your own wrapper calls.I won’t go into too much detail here because I am already in the middle of my revised graphics engine and will be posting code that shows how to use OpenGL to simulate Direct3D 11, and it that source code will end up being the most useful resource for studying “proper” and efficient usage of OpenGL.L. Spiro
Which all brings us back to the first reply on the thread:

OpenGL's design decision is to allow access to all functionality in the core, and allow you access to any functionality you request. That functionality may not be optimal, it may have horrible performance consequences, it may vary between cards, but the choice is to give you EVERYTHING.

Direct3D's design decision is to allow access to a specific family of functionality designed for high performance and broad uniformity. You ask for a family of interfaces and either you get the full set of interfaces or you get nothing.

There are pros and cons to each.

For example, if you want to use D3D9 and get an instance of it you will have a consistent set of functions, but if you later want to use some bit of functionality on newer cards it may be inaccessible even if the card supports it. On the opposite side, with OpenGL you can still push everything through the bus every frame, or you may have slight differences in similar functionality between different families of cards, but you can take advantage of new functionality without rewriting large segments of your code base.

There are many, many, many tradeoffs like that. As broad generalizations nether choice is right or wrong. In a specific situation one might be a better choice than another, and in a different situation the wise choice might be different.

Both of them are fully-featured. Both of them can be used to render beautiful, high performance graphics that take full advantage of the graphics cards.

Either way you choose to go, if you want to take advantage of the latest and greatest graphics technologies you will have a very long journey before reaching mastery. Taking advantage of the incredible power of a modern GPU to its fullest extent is something that can require many years of study.

Beatiful post. I also think that both API's do the same thing and it is a matter of preference over which one you use, i also think that it is up to the developer with what he does with that API. For example despite the PS3 being hard to develop for, Hideo Kojima's team managed to take advantage of the PS3 to create MGS4.

This topic is closed to new replies.

Advertisement