Questions tagged [graphics-programming]

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

Filter by
Sorted by
Tagged with
63
votes
9answers
13k 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 ...
49
votes
7answers
65k 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:
12
votes
1answer
5k 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 ...
70
votes
5answers
52k 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?
29
votes
2answers
15k 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 ...
8
votes
2answers
496 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 ...
5
votes
3answers
3k views

In a 2D top-down game, how can I create projectiles that have a height?

A 2D game called Deer Hunter has projectiles like this: Are the projectiles 2D or 3D models? How could I implement something similar?
6
votes
2answers
3k views

Low quality bilinear sampling in WebGL/OpenGL/DirectX

I'm seeing low quality bilinear texture sampling in WebGL, OpenGL and Directx, and was wondering if anyone knew how to make it higher quality? The picture below should help show what I mean. The ...
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 ...
49
votes
9answers
32k 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'...
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 ...
14
votes
3answers
8k 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 ...
3
votes
1answer
6k views

Rescale pixel art scenery before rendering in SDL2

I looked at this page that mentions the SDL2_gfx library for rescaling SDL_Surfaces without the image getting blurry: SDL zooming/upscaling without images becoming blurry? I wanted to know if it was ...
5
votes
2answers
2k views

How do I get a new license for gDEBugger after the 1 free year?

I downloaded the gDEBugger from gremedy over a year ago, with their one year free license. The license has since expired and their site says that I'll be presented with the option for 1 year free ...
1
vote
1answer
1k views

Color grading, shaders and 3d textures

I'm trying to implement color correction with the 3d lookup table. The lookup table is actually just a 2d texture 256x16 and consists of 16 squares which one is 16x16. When it comes to rendering, I ...
-5
votes
4answers
6k views

How to implement a 2d collision detection for Android

I am making a 2d space shooter using opengl ES. Can someone please show me how to implement a collision detection between the enemy ship and player ship. The code for the two classes are below: ...
29
votes
3answers
15k 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 ...
44
votes
2answers
14k 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: ...
14
votes
6answers
17k 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 ...
17
votes
2answers
11k 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?
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 ...
7
votes
2answers
9k views

How to implement color changing fragment shader?

I have a background of a given size and filled with a given color. I want to change it with an animation effect, starting from the center and spread out until it extends the whole background. The new ...
16
votes
4answers
6k 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: ...
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'...
8
votes
3answers
2k views

What's a good data structure solution for a scene manager in XNA?

I'm playing with XNA for a game project of myself, I had previous exposure to OpenGL and worked a bit with Ogre, so I'm trying to get the same concepts working on XNA. Specifically I'm trying to add ...
5
votes
1answer
3k views

How can glass breaking effect from Smash Hit be achieved? [duplicate]

I saw Smash Hit the other day and was amazed by the physics of the game, specially the shattered glass effect: I've read other posts about this subject but I still feel that they don't share enough ...
7
votes
2answers
3k views

OpenGL 2 and back vs 3 and forward: What are the key differences for 2D graphics? [closed]

OpenGL contexts before and after OpenGL 3.0 are rather different. So far I've really only worked with buffers on either side anyway, I do know the most notable difference is lack of Immediate Mode. ...
5
votes
1answer
2k views

Understanding normal maps on terrain

I'm having trouble understanding some of the math behind normal map textures even though I've got it to work using borrowed code, I want to understand it. I have a terrain based on a heightmap. I'm ...
6
votes
4answers
1k views

Why are 3d projections on a 2d screen not like what the human eye sees?

Firstly, I'm sorry if this question doesn't make much sense or is poorly written - I have almost no experience with programming, and none at all with game development. I'm also not sure it's an ...
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 ...
5
votes
4answers
7k views

How to do this sprite motion blur?

Some of you may know fraxy... Basically, I was watching this video: http://www.youtube.com/watch?v=uL7zWdDCtOE And there are some times where some sprites spin really fast (4:00 mark for example), ...
4
votes
1answer
173 views

How can I approximate an “opening fan”-transformation?

Is there a way to—with matrices—transform something as if opening the image on a Japanese folding fan? Image from Wikimedia Commons. I'm at a loss of what to call it, so pointers towards avenues of ...
1
vote
1answer
811 views

Rendering clouds similar to Sky: Light Awaits?

I'm interested in adding clouds to my game, with a style similar to those in Sky: Light Awaits You can see them in motion in these videos: (Starts at 26:00) https://www.youtube.com/watch?v=...
2
votes
1answer
755 views

Math major as a viable degree [closed]

While I realize there are many topics about CS vs software engineering vs game school programs, I haven't found anything relating to whether pure math degrees (with CS minor and electives) would also ...
1
vote
1answer
2k views

How can I draw many objects on screen instead of just one?

Like many beginner graphics programmers I followed a tutorial which showed me how to set up buffer descriptions and fill out the vertex buffer etc... - the steps involved in drawing a simple indexed ...
1
vote
1answer
1k views

Problem calculating normals for heightmaps

So far I have been using normal avering to calculate the normals for my vertices in my heightmap, with good graphical result (see picture), however it is terribly slow. With a incresing image size the ...
0
votes
1answer
144 views

Is it possible to display no white images/sprites when using the latest Android OS?

Was it okay to use Texture.setEnforcePotImages(false) in order to disable conditional width and height pixel size that requires power of 2? I'm planning to sell the ...
0
votes
1answer
193 views

Tile Draw Order

I started working on a tile engine recently and have been trying to get this depth sorting for the tiles right. I am using XNA and the SpriteSortMode.Deferred to get the tiles to sort correctly in the ...
0
votes
1answer
653 views

Associating materials and primitive

I'm trying to find a way of setting any kind of material class on any kind of primitive class (all the material classes have a base material class, same goes for the primitive classes). What I mean ...
0
votes
2answers
737 views

What's the difference between Gameplay Programming and Graphic Programming?

I know the answers are obvious, someone told me this: Graphics Programming: DirectX(or Direct3d), OpenGL, Vulkan, Metal.. Gameplay Programming: Bringing everything together. From design, music, ...