Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>A lot of video games use libraries like OpenGL.</p> </blockquote> <p>First and foremost: OpenGL is not a library per-se, but an API (specification). The OpenGL API may be implemented in form as a software library, but these days is much more common to implement OpenGL in form of a driver that turns OpenGL function calls into control commands to a graphics processor sitting on a graphics card (GPU).</p> <blockquote> <p>All the tutorials I've seen of such libraries demonstrate how to write code that tells the computer to draw something.</p> </blockquote> <p>Yes. This is because things need to be drawn to make any use of them.</p> <blockquote> <p>Thing is, in games these days everything is modeled using software such as Zbrush, Maya, or 3ds Max.</p> </blockquote> <p>At this point the models just consist of a large list of numbers, and further numbers that tell, how the other numbers form some sort of geometry. Those numbers are not some sort of ready to use image.</p> <blockquote> <p>The models are textured and are good to go.</p> </blockquote> <p>They are a bunch of numbers, and what they have is some additional numbers controlling texturing. The textures themself are in turn just numbers.</p> <blockquote> <p>It seems like all you'd need to do is write an animation loop <strong>that draws the models</strong></p> </blockquote> <p>And how do you think this drawing is going to happen? There's no magic "here you have a model, display it" function. Because for one the way in which the numbers making up a model may have any kind of meaning. So some program must give meaning to those numbers. And that is a renderer.</p> <blockquote> <p>and updates repeatedly rather than actually program the code to draw every little thing. </p> </blockquote> <p>Again, there is no magic "draw it" function. Drawing a model involves going through each of its numbers, it consists of, and turning those into drawing commands to the GPU.</p> <blockquote> <p>That would be both extremely time consuming and would make the models useless.</p> </blockquote> <p>How are the models useless, when they are what is controlling the issuing of commands to OpenGL. Or do you think OpenGL is used to actually "create" models?</p> <blockquote> <p>So where does OpenGL or Direct 3D come in in relation to video games and 3d art?</p> </blockquote> <p>It is used to turn the numbers a 3D model, as it is saved away from a modeller, into something pleasant to look at.</p> <blockquote> <p>What is so crucial about them when all the graphics are already created</p> </blockquote> <p>The graphics is not yet created, when the model is done. What's created is a model, and some auxilliary data in form of textures and shaders, which are then turned into graphics in realtime, at the execution time of the program.</p> <blockquote> <p>and just need to be loaded and drawn?</p> </blockquote> <p>Again, after being loaded, a model is just a bunch of numbers. And drawing means, turning those numbers into something to look at, which requires sending drawing commands to the graphics processor (GPU), which happens using a API like OpenGL or Direct3D</p> <blockquote> <p>Are they used mainly for shaders and effects?</p> </blockquote> <p>They are used to turn the numbers generated by a 3D modelling program (Blender, Maya, ZBrush) into an actual picture.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload