r/GraphicsProgramming • • Aug 08 '20

Question intro to graphics programming info?

hello, I am trying to start doing some graphics programming. Someone suggested https://www.3dgep.com/learning-directx-12-1/#DirectX_12_Demo. I have been working with this today.

Have anyone seen this? Is this a good way to get started? also learn open GL site was recommended but I will be learning openGL in a class later so I though I would get started with something different.

The thing is the guide seems to be very specific, like certain things didn’t compile unless I changed from unicode to byte in visual studio. Which I don’t really understand.

If I understand correctly that guide is introducing me to DX 12 which is basically an API to talk to the GPU correct? So is this the best way to start for your advance my career options? or this still too high level.

I have been using tkinter in python and basically created a window kinda like that 1st lesson I linked but less code. In that case way some of the code seems familiar in intent. And this is why I question whether or not this is actually a good starting point.

What can I achieve with DX 12 im new to the idea of graphics programming and would like to have an Idea of what graphics programming really means. Sorry if this doesn’t make sense. I am trying to educate myself in the topic.

Thanks

1 Upvotes

5 comments sorted by

1

u/zilchzero1 Aug 08 '20

follow up question, I see most of you are recommending openGL , and also DX11

my question is career wise if I’m serious about getting a job as graphics programmer would DX 12 be better to learn? Also if i learn DX11 will that stuff be applicable to DX12 or would is it completely different somehow? For a long term project, I would like it to be the most relevant.

Not saying I didn’t hear you previous suggestions, just want to know how learning each of these would be useful professionally.

3

u/serEatAlot Aug 08 '20 edited Aug 08 '20

What you should know is that no matter what API you use, they all follow the same 'flow', IE the same pipeline. What is different is how it is abstracted.

Newer API's like Vulkan, DirectX12 and Metal have very little abstraction which makes them hard to learn for people who are just getting into graphics programming.

This is why I don't recommend you start with DX12, I recommend either OpenGL or DX11. If you learn OpenGL now it would probably be different than what you learn in class. Because school normally teaches you outdated ways of using OpenGL (like immediate rendering stuff). So you will still learn something.

If you really wana save OpenGL for school, start with DX11. It is sightly harder to setup compared to OpenGl but it offers much better debugging and has really clear error messages.

You can find lots of tutorials on DX11, just Google "DirectX11 tutorial". I would also recommend a YouTube channel called ChillieTomatoNoodle, it has the best DX11 tutorial that I know of.

Good luck!

EDIT: I reread your post and noticed your question on "is DirectX12 just a way of talking to the GPU?"

Well yeah but in a very specific way. It is not general control over the GPU, there are other stuff that do that like Cuda and OpenCL. DX12 lets you tell the GPU how you want it to show pixels on the screen. Although DX12 does offer general compute shaders, it is not the primary use of the API. Same goes for other graphic API's.

2

u/IDatedSuccubi Aug 08 '20 edited Aug 08 '20

DX12 is one of those "advanced" APIs, like Vulkan. You should go with OpenGL, it's the easiest one, it's multiplatform (DirectX works natively only on Windows and Xbox).

Quick intro:

OpenGL is a system library provided by your system's GPU driver. It allows you to make calls to the driver, which will either prepare something or send/receive the GPU data.

Modern OpenGL works like this: load vertex buffer into the GPU, load index buffer in the GPU, then write a vertex shader in GLSL which with interpret your data and make vertex from it, compile it, make a fragment shader in GLSL that will give you an output color, combine those two into a program, and when you're ready you'll attach the program and vertex/index together and send the draw call to the GPU. Congrats you got a frame. More on LearnOpenGL.

Edit: Vertex buffer = information to build vertex from (or sometimes contains the model); index buffer says in which order to interpret the vertex; vertex shader interprets the info in the vertex buffer and gives out coordinates of new vertex (basically, your "model"). Sometimes it just outputs the buffer's contents.

1

u/CodyDuncan1260 Aug 08 '20

To whoever reported this post for violating Rule 1, this post has been approved under the guideline listed under the rule:
"Other kinds of allowed posts discuss graphics programming as a community and career:- Query Posts: Posts intended to draw discussion of graphics programming are allowed."

Asking for advice or info draws discussion about the introductory breadth of the field. Approved.

0

u/gallick-gunner Aug 08 '20

I'd also recommend you to go for OpenGL. Try coding some basic programs, most of them are shown on learnOpengl.com. But if you really want to get into it, I'd say get a good book on Graphics like Fundamentals of Computer Graphics by Peter Shireley or something like that and start with the theory/maths. This way you'll have a pretty good headstart, if you are looking for one, before taking the classes.