[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
OpenGL
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 58
Thread images: 5
can someone explain this shit to me ?
>>
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.
>>
>>54778807
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.
>>
>>54778869
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.
>>
>>54779249
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.
>>
>>54779426
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.
>>
>>54778807
>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.
>>
>>54779426
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.
>>
>>54780053
Damit anon you beat me to it
>>
>>54780053
>>54779782
>>54779870

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.
>>
>>54778782
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.
>>
>>54780158
>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.
>>
>>54780180
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

>>54780205
What exactly do you define as an "object" ? Do you mean triangles ?
>>
>>54780296
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:
https://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.
>>
>>54780296
I think anon has better things to do than give a 12h long course to an anon than can't even use google.
>>
>>54780355
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.
>>
>>54780408
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 ?
>>
>>54780468
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.
>>
>>54779249
Which in turn, gets picked up by the eye that is your viewport
>>
>>54778869
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.
>>
>>54780662
Games engines are written on top of OpenGL and direct x
>>
>>54780483
>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.
>>
>>54780686
yea i know? how is this contradicting to my post?
>>
>>54780789
Cool story. You are still adding no value to this post. Maybe you're the true idiot ? Do you need attention or something ?
>>
>>54780864
>>54780934
Your attitude towards people who started out as kindly helping you for no reason at all is really disturbing.
>>
>>54780662
3D -> 2D transition is done with the help of projection Matrix (defined in OpenGL).
http://www.codinglabs.net/article_world_view_projection_matrix.aspx
>>
>>54781062
Excuse me. You're the disturbed one that started with the hostility. So go fuck yourself.
>>
>>54778782
It's exactly like ClosedGL, except open.
>>
>>54781161
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?
>>
>>54781203
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 :(
>>
>>54781261

That's a fair point. Thanks for your insight.
>>
>>54781356
Now, how about I suck you off?
>>
>>54781394
I'm not him but sure, if you're thirsty for it then go ahead sen pai. :)
>>
>>54781394
Me too, you gonna take care of us both slut
>>
>>54781518
Are you as ignorant as him? I don't want to suck some highly educated guy off.
>>
>>54781570
I am a high school dropout bb ;)
>>
>>54778782
Low level API? What's there to explain, retard?
>>
>>54782101
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 anon? you're so clever ;)
>>
>>54782149
Google it, retard.
>>
>>54781203
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).
>>
>>54779679

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).
>>
>>54782149
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.
>>
>>54782165
or come here and ask someone wise for a shorter and more objective look at it, there you go displaying your cleverness again anon. I'm astounded!
>>
>>54782325
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 anon, this is just about finding a decent explanation
>>
>>54782364
Jesus, want me to write you a book?
Either ask specific questions about what you need or fuck off.
>>
File: 1464396698489.png (176 KB, 433x422) Image search: [Google]
1464396698489.png
176 KB, 433x422
>>54782329
>4chins
>wise
>objective
>>
>>54782397
I'm not even OP, I was just explaining what OP is asking for, take some prozac and calm your tits bro
>>54782443
>cynicism
>2016
>>
File: 1464393429114.jpg (114 KB, 733x697) Image search: [Google]
1464393429114.jpg
114 KB, 733x697
>>54782503
>being retarded
>2016
>>
>>54782503
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.
>>
>>54782542
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
>>54782519
>resorting to using smug anime faces and namecalling
kek, this was too easy, work on your arguments and trolling skills next time bby
>>
File: 1464108521123.png (797 KB, 812x806) Image search: [Google]
1464108521123.png
797 KB, 812x806
>>54782574
>not resorting to using smug anime faces and namecalling
kek, this was too easy, work on your arguments and trolling skills next time bby
>>
>>54782601
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
Thread replies: 58
Thread images: 5

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.