r/GraphicsProgramming • • May 19 '15

How come there is too many things to learn about graphics? Yet there are so many video games out there?

I mean my mind was almost blown by how much terms (multisampling, render units, vertical sync) the graphic designer should learn. Yet there are so many games around us...

11 Upvotes

11 comments sorted by

20

u/Graumm May 19 '15

Most game companies do not write their own game engines, and major game engines hide a lot of these details from the people writing games in them. Game companies that have very specific needs will usually have a graphics engineer to tailor the engine for the game they are making. Even so they usually don't have to touch the deep-down graphics code. Obviously it helps to know what it all means but that is just a matter of time. Stick with it and eventually you will get the hang of it!

I'd be happy to give you a layman's description of anything you don't understand!

2

u/MenaceInc May 19 '15

It's also helpful that the companies that do write the game engines tend to have teams dedicated to the graphical sides of things which means that the coders can delegate certain areas to those in the team with the best experience.

2

u/DashAnimal May 20 '15

May I ask, are you a developer working in game dev or engine dev?

8

u/Graumm May 20 '15

I'm an engine dev at an indie studio, so I get to do a bit of everything!

1

u/agmcleod May 20 '15

Sounds awesome!

Something I've been wondering as I've been working on my own simple 2d renderer. What are multiple textures used for? Is it to try and pass as many images as required to do a single batch draw?

Typically when I've looked at batch drawing, one might do the dumb approach of passing position & texture coord data into an array of vertices. Once a new image is requested, invoke DrawTriangles, and start up again (bind a different texture to GL_TEXTURE0).

2

u/[deleted] May 20 '15

Long answer :)

You do want multiple textures for one draw call. An example is a color texture, a normal texture and a even textures for specular color, specular intensity, other material parameters, ambient occlusion at a higher resolution then per vertex, ....

As for batch drawing, using multiple GL_TEXTUREX's is not ideal. An old skool way would be to use texture atlasses, where you cram the textures of multiple objects into one, and use some simple math on the texcoords to get the correct one. The modern way is to use texture arrays.

2

u/Graumm May 20 '15

Expanding on this answer:

Texture arrays can store multiple textures on one texture unit. If you have an animated 2D character you could store different animation frames in different slices of the array and render all of your characters in one pass, instead of rendering every individual character between binding separate textures for each frame of the animation.

Not all textures are for visual data like color, which I find is one of the coolest parts about advanced graphics programming. You can store data that looks like complete garbage in visual form as long as you understand its meaning. Normal textures are really encoded unit-vector "directions" that point "out" of a texture to be used with lighting to give a texture the illusion of shape/depth. Modern GPU-based particle systems use textures to store per-particle data like velocity/position.

1

u/corruptedPhoenix May 20 '15

Not the OP, but here's one for you (not directly graphics, but you said you do a bit of everything, so I'm taking a chance).

How does one do collision detection? Now, I know about certain basic principles: using an octree to divide the map, I know what bounding boxes are, and I know of GJK (although I still can't really fully understand it, but I'll stick with it).

The thing I'm unclear on is, how is all of this structured. You should obviously find the surrounding objects in the octree first, and then do basic bounding box detection. Then what? Do you run GJK on the geometry of the meshes? How do you know what vertex you're looking for if the mesh is concave? Do you divide the mesh further in another octree and then search what's closest in another one? That would seem costly. I assume you want to keep another low-poly version of the object saved somewhere? Or do you calculate it somehow when needed? Or do you keep another simplification of each object, like an ellipsoid or something.

Sorry for the wall of text, it's just something that's been bothering me for a while now. I do plan to read a book on this that I've purchased, but I feel like it would be much easier if I was to already have general ideas down and then expand on that.

10

u/sakmal May 19 '15
  1. Solid engines with all the latest bells and whistles are never been developed by a single person. Big studios hire a lot of people and spend huge amounts of time and money to incorporate as much as possible and still keep it runnning under 16ms/frame.

  2. In many cases a game developer doesn't roll their own engine. They use something like udk, cryengine, unity, irrlicht, ogre3d and so on.

  3. We all stand on the shoulders of giants. Most of the time the techniques are well documented in books, papers and code samples from major studios, big players in the business and hobbyists alike. And once you've built your own you can often port it between projects. For example I have built shadow mapping only three times once for opengl, once for directx9 and once for directx11. Over close to ten years I've used variations of pretty much the same code in more than fifty projects of all sizes.

1

u/Madsy9 May 20 '15

There aren't that many concepts to learn. Most new techniques you'll learn from say SIGGRAPH papers are based on a few fundamental principles. Nevermind the API-specific stuff. That's not what computer graphics is about. When you know how a graphics API works, such as OpenGL and DirectX, they are all the same.

The number of games on the market is due to developers licensing engines from third-parties, or due to developers making really simple graphics engines from scratch. Minecraft-like graphics is trivial.

1

u/gegoggigog May 27 '15

Isn't that the case in all fields? I can blow your mind with all (some) of the terms in maths as well ;-). I guess the thing is that there are always sub-fields in which you specialize.. but even then there will be a bunch of stuff you won't know of. But that's the charm, isn't it? There is always something new to learn which will improve whatever it is that you're doing. It doesn't take that much to be able to do some basic stuff, and from there you successively expand your knowledge... forever! :-D