94

Even with an engine, getting something to display on the screen the way you want it is not always trivial. There will be many instances where someone with programming knowledge is required to make the graphics display correctly. These people may be called graphics programmers in the credits (graphics programmer is not a certified or protected title, and the ...


91

GIF drawbacks: very limited color palette, typically 256 colors with ugly dithering (yes, you can have more than 256 colors in animated GIF, but this is uncommon) GPUs don't support GIF compression in hardware (means you will have to unpack them on CPU anyway) you only get to pick ONE color for transparency (unless implementing custom processing) no random ...


72

There are two types of normal maps commonly used in game development. The way you are thinking they should work is the way one type works (model-space normal maps), but most games use another type (tangent-space normal maps) which is why you associate mostly-blue textures with normal maps. With model-space normal maps, each channel encodes the precise ...


65

Game engines are like kitchens, and developers (i.e. programers) are like cooks. Game engines offer possibilities, while the programmers exploit these possibilities to the needs of the game. Thus, game companies need graphics programmers to tailor the engine's graphics possibilities to the game's needs. If the game engine were to manage everything, ...


51

Shadow mapping and stencil shadows (shadow volumes) are definitely the big two, as you've mentioned, so I'll stick to comparing the two. And since you've pointed out the most obvious shortcomings of shadow mapping and advantages of stencil shadows, I'll do the opposite. Stencil shadow shortcomings Shadows match the shape of the casting mesh. This is very ...


48

Here's a rough idea using image processing transformations to isolate the features of interest: Apply a flood fill from an ocean cell to make a mask of all ocean cells. Depending on how your rivers are set up, you might need an extra elevation or clearance criterion to keep the ocean mask from flowing inland. ;) Apply a local smoothing to the edge of this ...


43

First of all, consider if it is actually worth it to support more than one graphics API. Just using OpenGL will cover most platforms and will be "good enough" for all but the most graphically ambitious projects. Unless you work for a very large game studio which can afford to sink several thousand person-hours into implementing and testing multiple rendering ...


41

It's not just about speed of execution, but also about simplicity. Although the software rendering used in this example would be a lot slower than using hardware acceleration (i.e. a GPU), drawing a few bitmaps on screen is such a trivial task that you would not notice the performance drop. However, low-level activity like triangle rasterisation, depth sort ...


35

I don't think any of the other answers here will achieve the effect in Pokémon X/Y. I can't know exactly how it's done, but I figured out a way which seems like pretty much what they do in the game. In Pokémon X/Y, outlines are drawn both around the silhouette edges and on other non-silhouette edges (like where Raichu's ears meet his head in the following ...


34

This is a facet of the math of affine transformations crammed into a single matrix. In an affine transformation you have the equation: x' = Ax + b, where x is the original vector, A is the transformation matrix, and b is the translation vector. To combine A and b into a single matrix requires some extra work. Namely, we must be sure that we can "turn off" ...


32

In order to use any image file as a texture in a game, there must be a texture created on the GPU and the pixel data in the image file must be loaded to that texture. GPUs do not support many of the features that image files on CPUs support. They don't support JPG compression, they don't support PNG compression, and with particular reference to GIFs, they ...


29

The way Dragons Abound identifies bays is to walk along the coastline and find two spots on the coastline where the straight-line distance between the spots is less than the distance along the coastline between the spots. This is the sinuosity of the coastline between the two spots. By selecting a sinuosity limit and limits for the straight-line distance ...


25

My question is: why even bother using something like open gl, sfml, sdl when all you have to do is simply allocate some buffer, pass a bitmap and draw it to the screen? Short: Because its fast (OpenGL, DirectX). Long: You may think you can do this all yourself. Draw pixels to a screen. You might write a small library to draw shapes, like quads or ...


20

Broadly, the answer is "it depends." The way one would send particle updates is quite a bit different than the way you would send a series of GPU-skinned models. Vertex/Index Buffers In the general sense, though, everything these days is done with a VBO (vertex buffer object). The old immediate-mode API (glBegin/glEnd) is probably just implemented as a ...


17

That does not appear to be using any kind of specific flat-shading approach, at all. The shading is smooth, though the projected shadows are hard-edged, and the objects are not rounded. The specific lighting effect appears to be a combination of ambient occlusion (probably SSAO, "screen space ambient occlusion") which is what gives it that soft shadowing ...


17

First, it helps to know that GPUs always evaluate fragment/pixel shaders on 2x2 blocks of pixels at a time. (Even if only some of those pixels ultimately need to be drawn, while others are outside the polygon or occluded - the unneeded fragments are masked out instead of being written at the end). The screenspace derivative of a variable (or expression) v ...


16

In all the games I've worked on, the the Asset Creation Pipeline goes something like this: the concept artist (for levels/backgrounds/level models) or character artist (for models) will generate sketches for characters/levels/etc. usually multiple options are given to the creative director / lead art to decide which one they like better. The concept / ...


13

GIF has a limited color palette. (255) You have to implement parsing and animating the GIF too. So there is not a advancement in time nor in format's technical aspects.


13

If we're willing to approximate the viewer as a cyclops whose single eye has a pinhole pupil (and this turns out to be a much better approximation than it sounds like - more on that later), then I'd argue that both projection methods you describe are correct. For different shapes of screen. Thinking of the problem angularly gives the correct result if the ...


11

I tried to duplicate the effect by using shader. Shader00 Center : https://www.shadertoy.com/view/XsXSz2 Shader01 Sides : https://www.shadertoy.com/view/4sXSz2 :) you could, as Byte56 said, set up three planes. A plane facing camera directly forward with Shader00, and then two plane with Shader01, perhapss as RandyGaul mentioned, top/bottom non uniformly ...


11

Here's how I would do this. First, make sure you have the object's UVs or world coords (which you can pass through from your vertex shader) available to you. If it's just a background, you could also just use fragment coords (gl_FragCoord). For instance, let's say we're using UV coords. A fragment shader with only: gl_FragColor = vec4(vec3(uv.x),1.0); will ...


11

It's a peak in a function defined in polar or spherical coordinates. If we look at the function y = cos(x) in rectangular coordinates, it looks like a wave, with peaks at 0 and 2pi: If we look at the function r = cos(theta) + 1 in polar coordinates, it looks like a bulge, or "lobe" that's greatest at 0: (Images above via Wolfram MathWorld) The same thing ...


11

As Josh Petrie already pointed out, the most important concern is performance. Not only can't you know how powerful the end-users hardware is, when you are building an engine you don't even know how people are going to use it. Maybe the game developers want to build a game which puts so many polygons on the screen that even the best hardware can't render it ...


11

What he does is called software rendering, what OpenGL does is called GPU rendering What's the difference between them? Speed and memory. Rasterization (filling out triangles on screen) takes some time. If you do it on the CPU, you essentially take that time away from game logic, especially if it's not optimized well. And doesn't matter, how small the ...


9

For smooth models (very important), this effect is fairly simple. In your fragment/pixel shader you will need the normal of the fragment being shaded. If it is very close to perpendicular (dot(surface_normal,view_vector) <= .01 - you might need to play with that threshold) then color the fragment black instead of its usual color. This approach "...


Only top voted, non community-wiki answers of a minimum length are eligible