OpenGL

can someone explain this shit to me ?

Other urls found in this thread:

en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Load_OBJ
codinglabs.net/article_world_view_projection_matrix.aspx
twitter.com/NSFWRedditImage

It's an open specification for a low-level graphics library.
Every GPU manufacturer has their own implementation but they're all standards compliant.
If you write GL code that runs on intel integrated graphics, it will work on AMD or Nvidia as well.

Every GPU manufacturer has to implement the OpenGL interface ? That is.. interesting.

The biggest problem I'm having now is trying to understand the responsibilities of something like OpenGL vs the OS Driver vs the GPU itself.

Like one thing I don't understand is which layer is doing the actual math to understand how to project something in 3D space ? I assume there must be some formula to take 3D coordinates and "squash" them into a 2D projection.

Hopefully that makes sense. This probably sounds very amateurish. I'm just now learning about 3D graphics.

I like to think about it like a piece of paper when your writing or drawing. The paper acts as a base.
You can add many layers, techniques, and original elements to it, but at the end of the day the common element all those drawings share is the base of paper.

I think I'm having trouble distilling the wisdom from this analogy.

Are you saying that each layers (OpenGL, the OS driver, and the GPU) only know how to think about an image in terms of pixels ?

The thing I guess that comes to mind immediately is vertex shaders. They fundamentally understand 3D space, and at some point "something" is rasterizing these coordinates into a 2D image. So which layer is actually performing this operation ? Does the GPU understand what 3D space means and how to convert that to a 2D image ? It must, right ? Aren't shaders run by the GPU itself ?

Any OpenGL wizards lurking here tonight ?

My understanding of it is that OpenGL contains a series of tried and true protocols every GPU manufacturer follows in order to make a functional, and efficient, processor for programs. This set standard ensures that calculating 3D space conversion crosses over from one brand to another without uncertainty, providing a groundwork for programmers to us.

the GPU understands the functions OpenGL, and the OS driver, give it to convert that 3D space to a 2D image, but unless it was coded specifically for that GPU, it couldn't understand it on it's own.

With modern OpenGL (as in programmable pipeline), I would say vertex shaders actually don't fundamentally understand 3D space. You are the one who provides the matrices for transformation. It's really just taking the vertices you pass in and running the shader program on them. Generally, a well-formed vertex shader will have at least a uniform for a projection matrix, and the user will instruct for the input vertex to be multiplied by that matrix (and often a world/view matrix as well, for example). The actual "math" of the projection simply lies in that matrix multiplication. However, if you want, you can also have a vertex shader that operates on vertices in normalized device coordinate space (-1 to 1 on the x and y axes), with no projection matrix/transformation at all.

>If you write GL code that runs on intel integrated graphics, it will work on AMD or Nvidia as well.
There will always be a stupid difference that is really hard to catch but extremely easy to fix. At least that's what happened to me when I tried to run something in AMD which was developed with an NVIDIA chip. It's my inexperience, but still happens.

I'm not the guy who was responding but basically:

- OpenGL is a library of functions that make it easier to interact with the GPU. The routines, functions included in the API are well defined, so any manufacturer tries to be compliant with it.
- The actual interaction with the GPU is done by the driver.
- Unlike what everyone believes, GPUs are pretty stupid, they're just very good at multiplying in parallel. So OpenGL provides a way for programmer to define things in a human readable format, and converts it into matrix multiplications to be sent to GPU through drivers. All the GPU does is basically matrix transformations and stuff. OpenGL makes it possible to give instructions to GPU while keeping the programmer sane.

Damit user you beat me to it

Wow. This is actually super helpful. Thanks three anonymous peoples. So GPU = dumb parallelizing multiplier. OpenGL is the one doing the matrix multiplication that I was referring to incorrectly as "taking 3D coordinates and squashing them into a 2D projection". Clearly I have a lot more to learn about this, but this is really useful in helping me start to understand where the separation of concerns lies.

You should actually have a proper question rather than "explain this shit to me" because I can give you a 12 hour discourse on computer graphics in general.

>OpenGL is the one doing the matrix multiplication
OpenGL is not doing that, it's just a way to program the GPU to do all of that.

>taking 3D coordinates and squashing them into a 2D projection
This is not entirely wrong, as it is actually something done by GPU again with the help of OpenGL. The definitions of objects are done using OpenGL but CPU does not really do the multiplication and transform. I'd suggest you to try to create an object using OpenGL. Then you'll see that the object is just a large array of vertices and the final transformed version is what you see on screen.

Actually I plenty of "proper questions" below the initial post if you cared to read, but if you want to give a discourse about computer graphics then be my guest. However I doubt you could. Note the knowledgeable people actually answering questions rather than shit posting like you're doing. /shrug

What exactly do you define as an "object" ? Do you mean triangles ?

What I'm saying is follow a tutorial, it'll be easier to understand.

After a quick search, I found what I was exactly trying to say:
en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Load_OBJ

If you look at the model files you can include, they're basically list of vectors.

I think user has better things to do than give a 12h long course to an user than can't even use google.

Cool story. It doesn't at all answer my questions infact it only serves to confuse the issue even more. Yes. We are passing OpenGL a list of vectors. That doesn't resolve the issue of which layer of stack is converting these (3D) vectors into a 2D image to be displayed on the user's screen. So. Fail.

Does he? How do we know? Apparently he has no better things to do than to shitpost.

I only asked a simple question in the pursuit of trying to learn more. This -technology- forum exists for the very reason I am using it for here. Or would you prefer more shitty Richard Stallman memes in place of legitimate technical discourse ?

What? If you follow that it explains.

>Vector object, parsed by CPU, in a function called "load_obj"
>Loaded object sent to GPU using OpenGL functions from the library (I think it's glew library but I'm not sure)

GPU does not have access to your files, you can't expect it to parse a file from your hard drive, but once you send it to its buffers it's GPU's job from there on.

In short, File in hard drive>CPU>file in RAM>OpenGL routine>file in GPU buffer or RAM>OpenGL routine>object drawn

Whenever there's an OpenGL function, GPU is employed. OpenGL is just there so that you don't have to redefine how to do the object loading to GPU everytime you need to do it. And it is standardized so that you don't have to do it again for different GPUs.

Which in turn, gets picked up by the eye that is your viewport

Pls don't quote me on this, afterall I really don't have a clue, but I always thought that the transition from a 3D model to a 2D one was done in the aplication layer already. Like in a game for example it's the job of the games engine.

Games engines are written on top of OpenGL and direct x

>Apparently he has no better things to do than to shitpost.

Still better thing to do than spoonfeed an idiot.

There's a stupid question general for all your needs.

yea i know? how is this contradicting to my post?

Cool story. You are still adding no value to this post. Maybe you're the true idiot ? Do you need attention or something ?

Your attitude towards people who started out as kindly helping you for no reason at all is really disturbing.

3D -> 2D transition is done with the help of projection Matrix (defined in OpenGL).
codinglabs.net/article_world_view_projection_matrix.aspx

Excuse me. You're the disturbed one that started with the hostility. So go fuck yourself.

It's exactly like ClosedGL, except open.

How about I suck you off?

Can someone explain the chain of OpenGL and how the files are linked? What is the default OpenGL32.dll that ships with Windows, and how do drivers interact with it?

Dude, OpenGL is an API thing, think of it similar to Linux systemcalls. You can implement the systemcalls in whatever way using whatever resources but the API remains the same, you still have the same commands and stuff.

OpenGL is similar to this, API is the same, manufacturers design their stuff around it, not necessarily the drivers. You can create an OpenGL compatible library using whatever drivers.

I think you should do a bit of more reading or follow a tutorial, because what you don't understand may even be an XY problem.

my opengl version is so old that i can't play supertuxcard :(

That's a fair point. Thanks for your insight.

Now, how about I suck you off?

I'm not him but sure, if you're thirsty for it then go ahead sen pai. :)

Me too, you gonna take care of us both slut

Are you as ignorant as him? I don't want to suck some highly educated guy off.

I am a high school dropout bb ;)

Low level API? What's there to explain, retard?

because just saying "it's a low level api" is enough to explain it's mechanism and the details of it's interaction with the hardware, right user? you're so clever ;)

Google it, retard.

Graphics drivers just implement the functions that are in OpenGL API. Most windows programs use some OGL loader since Windows ships with an old and deprecated version of OpenGL (they want you to use DirectX).

OpenGL is the language (or rather symbol set i.e. API) you speak to your slave (your Kernel) to fiddle with a bunch of knobs and levers (GPU card) which flip a bunch of flash cards in various permutations (Display).

The simplest way to say it is: it writes allocating pixels to memory (one frame at a time) utilizing the OpenGL driver built into the firmware of your graphics card which is then bridged to your OS driver.

That's the gist of it, anything else will go over your head; I probably fucked something up in that explanation, but fuck you, Google it.

or come here and ask someone wise for a shorter and more objective look at it, there you go displaying your cleverness again user. I'm astounded!

The issue is that when you use google it gives a simplistic and dumb article by a poo2loo for 5 rupees saying "a low level API is something that bridges an engine and hardware" yeah I know that but give an in-depth explanation you dumb unflushed turd, this is not about using you for answers user, this is just about finding a decent explanation

Jesus, want me to write you a book?
Either ask specific questions about what you need or fuck off.

>4chins
>wise
>objective

I'm not even OP, I was just explaining what OP is asking for, take some prozac and calm your tits bro
>cynicism
>2016

>being retarded
>2016

Yea, well there's no reason for the people asking questions to be rude little shits.

If I wanted to browse questions/tech support all day I'd go to stack exchange, I get enough of that shit at my job.

that's true man, it's good to tell em to fuck off when they act entitled, what I think is that OP just wanted was slightly more in-depth explanation, for example I did a small opengl implementation for my ARM64 OS project, and it was like opengl library -> pci -> commands to graphics card -> graphics card reads something in it's own assembly language -> output
>resorting to using smug anime faces and namecalling
kek, this was too easy, work on your arguments and trolling skills next time bby

>not resorting to using smug anime faces and namecalling
kek, this was too easy, work on your arguments and trolling skills next time bby

don't be a sore loser and give daddy a kiss bby

OP, in short, a low level library is a standard set of functions to interact with hardware no matter what brand or design it has, the messages it sends to the graphics driver are translated in the graphics driver from opengl calls like draw_texture to commands the graphics processor understand in it's assembly, it's a way to program once and run it everywhere

Vulkan
vulkan
VULKAN
VulKan

Just for those faggots who'll search this thread for something vulkan related.

>low level api
lel