Questions tagged [graphics-programming]

Programming related to the visual representation of information on computer screens.

Filter by
Sorted by
Tagged with
73
votes
5answers
56k views

Which image format is more memory-efficient: PNG, JPEG, or GIF?

Which image format is more efficient to save memory? PNG, JPEG, or GIF?
65
votes
9answers
15k views

2D graphics - why use spritesheets?

I have seen many examples of how to render sprites from a spritesheet but I havent grasped why it is the most common way of dealing with sprites in 2d games. I have started out with 2d sprite ...
57
votes
7answers
27k views

Why do game studios need graphics programmers if they're using game engines?

In the credits section of the games I play, there are names of graphics programmers. If they used a game engine, why do they need a graphics programmer? Isn't the game engine doing their job?
56
votes
7answers
74k views

How can I draw outlines around 3D models?

How can I draw outlines around 3D models? I'm referring to something like the effects in a recent Pokemon game, which appear to have a single-pixel outline around them:
50
votes
9answers
39k views

Why do game engines convert models to triangles instead of using quads?

I've worked using Maya for animation and more film orientated projects however I am also focusing on my studies on video game development. Anyways, I was talking with one of my professor and we couldn'...
45
votes
2answers
16k views

Why are normal maps predominantly blue?

Why normal maps are predominantly blue instead of a random color? I guess normal vectors of a 3D object can point in every direction, like: ...
45
votes
1answer
11k views

Why is shadow mapping the standard?

Though I am a programmer by trade, I have barely touched game development at all. I've had this question for some time, and now that I'm looking into game development I thought it would be a good time ...
40
votes
3answers
6k views

How can bays and straits be determined in a procedurally generated map?

I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map. So far, I've been successful in labelling certain geographic features: land, ocean, ...
30
votes
3answers
16k views

How can I make this style of 2D "glowing" graphics?

I'm comfortable with the basics of building a 2d sprite based game in XNA, where all my objects are simply .png images that I move around. What things do I need to learn next to be able to develop a ...
29
votes
3answers
15k views

Why don't most major game engines use gifs for animated textures?

What is better to use Animation Sheets or Gifs? One advantage Gifs have over Animation Sheets is that you don't have to think about frames going too fast or too slow because of your code and updating ...
29
votes
2answers
16k views

How do I create a wide-angle / fisheye lens with HLSL?

What are the concepts that need to be implemented in order to achieve the effect of a wide angle lens of varying extremities? Pseudocode and specific explanation referring to the various stages of ...
27
votes
5answers
20k views

Given a RGB color x, how to find the most contrasting color y? [duplicate]

Possible Duplicate: Making a symbol appear on any colour I have to mark a certain item in a way that will make it stick-out in the background. I need it to be surrounded with the color that ...
26
votes
8answers
12k views

What advantage do OpenGL, SFML and SDL have over software rendering?

I started watching the Handmade Hero stream, where Casey Muratori creates a game engine without using frameworks or such. Yesterday I got to the part where he showed how an image is drawn onto the ...
26
votes
2answers
40k views

How many textures can usually I bind at once?

I'm developing a game engine, and it's only going to work on modern (Shader model 4+) hardware. I figure that, by the time I'm done with it, that won't be such an unreasonable requirement. My ...
23
votes
3answers
5k views

How do I know if I'm abstracting graphics APIs too tightly?

When making a renderer that supports multiple graphics APIs, you would typically want to abstract your code in some sort of low level library that is tied with some graphics API like OpenGL, Vulkan, ...
23
votes
1answer
3k views

Why do transformation matrices always have an extra dimension? [duplicate]

In 3D math I always see matrices with one additional dimension. For example, in 3D graphics, matrices are always 4x4 and in 2d they are 3x3 matrices. Can anyone explain why?
22
votes
6answers
5k views

Is there a reason to add options to not use advanced technologies in a game engine?

I have been developing a game engine, and have been discovering and reading up on game technologies such as anisotropic filtering, ambient occlusion, anti-aliasing, etc. Usually in games, you can ...
18
votes
4answers
3k views

What should every graphics programmer write [closed]

I've seen this question on SO, but here i want it to focus on GFX. So in your opinion what applications/features should every aspiring GFX programmer write/change to get better? Community wiki since ...
18
votes
4answers
3k views

Effects for Programmers [closed]

Does anyone have any good resources for creating special effects, aimed at programmers. I'm not specifically interested in particle effects, but broader things like: Fullscreen effects, blur, depth ...
17
votes
2answers
13k views

What are the advantages of tangent space normals over object space normals?

What are the advantages of normals in tangent space to normals in object space for calculation of bump mapping?
17
votes
1answer
7k views

What are screen space derivatives and when would I use them?

I see the ddx and ddy glsl functions and the hlsl equivalents come up in shader code every now and then. I'm currently using ...
16
votes
4answers
7k views

Fixed-Function vs Shaders: Which for beginner?

I'm currently going to college for computer science. Although I do plan on utilizing an existing engine at some point to create a small game, my aim right now is towards learning the fundamentals: ...
16
votes
5answers
12k views

boolean operations on meshes

given a set of vertices and triangles for each mesh. Does anyone know of an algorithm, or a place to start looking( I tried google first but haven't found a good place to get started) to perform ...
16
votes
1answer
9k views

How do I render a mirror or other reflective surfaces?

I just wondered how to create a mirror within a 3D game? My suggestion is/was to trace rays, hitting the "mirror" object then drawing a picture of a second cam onto the "mirror" object which is ...
15
votes
4answers
24k views

How are 3D models created in video games?

How are 3D models in games designed and displayed? Is it all code? Drawn on paper, then on a 3D graphics software, then... what? Of course, game programmers won't define every vertex of every shape(/...
15
votes
6answers
19k views

LOD in modern games [closed]

I'm currently working on my master's thesis about LOD and mesh simplification, and I've been reading many academic papers and articles about the subject. However, I can't find enough information about ...
15
votes
2answers
21k views

OpenGL ES 2.0: Setting up 2D Projection

This article describes in general, how to draw sharp OpenGL 2D graphics, using fixed function pipeline. http://basic4gl.wikispaces.com/2D+Drawing+in+OpenGL Because OpenGL ES 2.0 has some ES 1.x ...
15
votes
2answers
4k views

Creating an electricity/lighting/tesla coil effect in a 2D XNA game?

I'd like to create beams of electricity between two points very similar to this video: http://www.youtube.com/watch?v=eMJ8-56L3Lc. The effect is so dynamic, with varying lengths and pseudo-random ...
15
votes
3answers
719 views

Solids as high viscocity Liquids

A friend of mine and I were discussing different idea for allow materials in a world to be destroyed in a very piecemeal fashion and he proposed the idea of representing solids as very viscious fluids....
15
votes
4answers
7k views

Real time shadow casting in a 2D isometric game

I'm writing a small 2d isometric engine in C++ and I'm trying to implement real time shadow casting. I followed a simple approach described on this page and here is the result (light is located at the ...
14
votes
5answers
14k views

Complete Math Library for use in OpenGL ES 2.0 Game? [closed]

Are you aware of a complete (or almost complete) cross platform math library for use in OpenGL ES 2.0 games? The library should contain: Matrix2x2, Matrix 3x3, Matrix4x4 classes Quaternions Vector2,...
14
votes
3answers
9k views

How do I scale down pixel art?

There are plenty of algorithms to scale up pixel art. (I prefer hqx, personally.) But are there any notable algorithms to scale it down? My game is designed to run at a resolution of ...
14
votes
1answer
1k views

Is there any performance benefit to sharing shaders between programs?

OpenGL allows you to share the same shader between multiple programs. Aside from saving small amounts of memory and a shader handle, are there any GPU-side performance benefits to doing this?
13
votes
3answers
2k views

Recreating this flat-shaded look

I'll keep it short. How does one achieve the effect depicted in the image below? Is it feasible to do in realtime? It looks deceptively simple, but it probably isn't. Are there any keywords I can ...
13
votes
4answers
9k views

Debugging Shader Code?

I'm writing a game engine, and when I use a perspective camera I get a black screen. I am not going to ask exactly why this is because there would be a lot of code to share and, frankly, I think that'...
12
votes
7answers
5k views

Fastest way to create a simple particle effect

I am looking to the fastest way to create really simple particle effect that will be spammed like hell on the game... Basically, my game looks like a vectrex game, made mostly of lines... I want to ...
12
votes
2answers
6k views

How can I tell a fragment shader to not write a particular pixel?

In a WebGL I'd like to send a screen space quad through that gets processed by a fragment shader, but have the fragment shader only write out a pixel under certain conditions (say... that it was ...
12
votes
3answers
1k views

Drawing particles as a smooth blob

I'm new to game/graphics development and I'm playing around with particles (in 2D). I want to draw particles close to each other as a blob, just as liquid/water. I do not want to draw big circles ...
12
votes
1answer
2k views

How to represent cliff faces in terrain?

I'm trying to figure out the best way to programmatically represent terrain in my game. I've been considering using a heightmap (or grid of evenly spaced vertices) to represent the surface of the ...
12
votes
1answer
355 views

Good resources for learning about graphics hardware [closed]

I'm looking for some good learning resources for graphics hardware (and associated low level software). Basically I want to learn more about what goes on underneath the opengl/direcx API layers in ...
12
votes
1answer
2k views

Shader to see silhouette through alpha blended sprites

I want to achieve in Unity a see through effect like the one in these examples: In my specific scenario there are a couple of requirements: Sprites are using alpha blending, and sprites have ...
11
votes
2answers
9k views

Decal implementation

I had issues finding information about decals, so maybe this question will help others. The implementation is for a forward renderer. Could somebody confirm if i got decal implementation right? You ...
10
votes
1answer
875 views

In OpenGL, what is "zero state" rendering?

Recently at a job interview, I mentioned that I taught myself modern OpenGL and rendering with vertex buffer objects because my university only taught the fixed function pipeline with immediate mode ...
10
votes
2answers
7k views

Sorting objects before rendering

I'm trying to implement a scene graph and in all the articles i've come across there is talk about object sorting. So you'd sort your objects by "material" for example. Now untill i sat down and ...
9
votes
1answer
7k views

Most efficient way to draw vertex with OpenGL

I am writing an OpenGL 3D game. There will be tons of triangles for terrain and objects in use. I am studying from the OpenGL official guide and the first presented method is to call a function <...
9
votes
1answer
906 views

Graphics programming replicating the transition from Chrono Trigger inside the gate

I started playing this game for the first time lately and this really peaked my interest You can see the transition in motion starting at ~12:08 There seems to be some interesting maths taking place ...
9
votes
1answer
2k views

Any good books on graphics programming?

I've been looking for a book that takes a bottom-up approach for graphics programming. So something that starts with 2d filtering, maybe moving into normal mapping, then ambient occlusion, etc. I ask ...
8
votes
5answers
2k views

Drawing very large slowly rotating planets

I'd like to draw very large (~500 px) graphics of planets slowly rotating. These graphics are meant to impress. What's the best way of doing this? I don't have experience with any particular 3D engine,...
8
votes
1answer
1k views

How can I implement a renderer that can draw many kinds of primitives?

This is somewhat linked to a question I previously asked concerning the drawing of indexed primitives. My problem was that I was only drawing one cube when I wanted to draw many. I was told that the ...
8
votes
2answers
518 views

What techniques could I use to give players the ability to control certain features, e.g. fatness?

I'm working on a tool for character customization (e.g. starting from a base model, a player can control his fatness), so I'm looking for ideas, techniques or other regarding this topic. After some ...

1
2 3 4 5
8