Questions tagged [graphics-programming]
Programming related to the visual representation of information on computer screens.
412 questions
0
votes
1
answer
534
views
How do I draw long tiled paths in 2D? (Eye of the Beholder style)
I'm using artwork from the following page:
http://opengameart.org/content/first-person-dungeon-crawl-art-pack
As you can see with the first artwork, the grass field is long. The floor also goes into ...
1
vote
1
answer
2k
views
How does an energy-conservative Blinn-Phong-Fresnel model work?
What is a plausible, basic equation/pseudo-code for energy-conservative Blinn-Phong shading, including Fresnel with a coloured light-source?
The net gives so many alternatives that it's hard to ...
1
vote
2
answers
420
views
What is the purpose for drawing vertices and shapes in OpenGL (or DX), if a game is using sprites?
Something I do not understand. All the tutorials on OpenGL, DirectX, or other, always show you how to draw a shape and then change its vertices, move it around and so on. But all the games I know of,...
1
vote
0
answers
99
views
Why does XNA create two GraphicsDeviceManager services?
While working with XNA today, I looked at the debugger information for Game.Services to retrieve the GraphicsDeviceManager so ...
0
votes
1
answer
212
views
How would I go about merging two models together in-game to create a new model? [closed]
Let's say I have two models: model 1 is hilt and model 2 is blade. How would I merge these to models together to create a sword?
46
votes
2
answers
20k
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:
...
4
votes
0
answers
134
views
Tangents face the same direction on opposite sides of mesh
I have noticed that the tangent vectors that I am calculating are not always facing the correct direction. The tangents on the left and right of the mesh both face the same direction. Here is a ...
-1
votes
1
answer
1k
views
How to move object along circumference of another object? [closed]
I have following piece of code, now i want to move the "moon" object in the orbit around "earth". please help!!
...
4
votes
1
answer
2k
views
I want to render some surfaces in GLSL with normal maps, and some without
I have normal mapping working in my game, but I want to only use normal mapping for some surfaces, and not others.
Right now, as far as I can tell, my shader is applying an incorrect normal of (0, 0, ...
5
votes
2
answers
5k
views
Mixing Perspective and Orthographic Projections?
I'm going to start with some background, so jump to my question at the bottom for the TLDR version.
Problem:
In a Japanese 4gamer article (english translation via Chev on Polycount) explaining some ...
1
vote
1
answer
144
views
Quick sprite contouring solutions?
I want to be able to quickly outline sprites(mainly with black, but other colours too) without doing it manually, as pictured. What would be a good program/solution to do so?
Edit: I don't want it to ...
6
votes
1
answer
2k
views
Why bother with a separate normal matrix, if there is never non-uniform scaling on the view matrix?
I am updating one of my shaders to a version of OpenGL/GLSL that doesn't automatically provide gl_NormalMatrix (for educational purposes; I'm not ripping out ...
1
vote
1
answer
1k
views
how much memory does Adreno 320 GPU provide? [closed]
I wanted to know how much memory does Adreno 320 GPU provide ? I am using Nexus 4.
I Googled about it and not able to find any details about it. Can anyone provide the details?
10
votes
1
answer
1k
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 ...
3
votes
2
answers
190
views
In XNA 4, how can I access SpriteBatch's transformMatrix in my shader?
I would like to use a custom effect with a regular XNA SpriteBatch. I have a 2D camera which computes a transform matrix, so I need my shader to take this into ...
0
votes
2
answers
258
views
Is it possible to create accelerated 3D graphics on Windows using one's own API?
Say I want to come up with a way to replace what OpenGL and DirectX specifications do: communicate with GPU to get some functions done that help hardware-acceleration and rapid drawing of screen data. ...
0
votes
1
answer
1k
views
HDR and Alpha Blending
I've been reading a lot about HDR techniques and came across Alpha Blending compatibility. Searched even more and found this snippet from the Ogre Forums:
With source alpha blending, it sometimes ...
2
votes
1
answer
208
views
Real hardware acceleration of vector images?
Basically vector graphics have many advantages, especially that they scale very nicely.
So there are many reasons to use them in 3D and 2D games.
Is there any support for hardware accelerated vector ...
1
vote
2
answers
3k
views
Weird GLM perspective problems with my 2D Game
I am trying to create the graphics system of a 2D game using OpenGL 3.3.
To help me in this task I am using the GLM math libraries.
However I am having some trouble. When my objects (for now they are ...
8
votes
2
answers
14k
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 ...
5
votes
1
answer
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 ...
1
vote
3
answers
303
views
Technique suggestion to render corroded pipes in 3D
We currently have a lot of data relating to cracks/corrosion/deformations in metal pipes which at present, can be viewed in a crude flat/2D application which makes the metal anomalies hard to spot.
...
0
votes
2
answers
2k
views
How to write "Hello World" for N64 purely from scratch?
As an experiment I want to code a "Hello World" program for N64 using only assembly code, using no headers, tools, helper files, etc.
I just want to write the assembly code bare bones from absolute ...
3
votes
3
answers
1k
views
How are red dot/reflex/holographic sights implemented?
In first-person-shooters like Call of Duty, the hologram only appears when it is behind the glass portion of the sight.
In OpenGL, would it be implemented by rendering the glass to the stencil buffer ...
9
votes
1
answer
1k
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 ...
2
votes
1
answer
5k
views
OpenGL - have object follow mouse
I want to have an object follow around my mouse on the screen in OpenGL. (I am also using GLEW, GLFW, and GLM). The best idea I've come up with is:
Get the coordinates within the window with ...
1
vote
3
answers
6k
views
Rotation matrix for a 3D vector
I have a direction vector on which I have to apply some rotation to align it to positive z-axis.
To use Matrix.CreateRotationX(angle) of ...
2
votes
4
answers
1k
views
OpenGL setup on Windows
I have been trying to use OpenGL for two days now. First on Mac, then on Windows. The problem with Mac is that it doesn't support the newer versions of OpenGL. I ran a tutorial that actually did get ...
0
votes
1
answer
301
views
OpenGL ES 1 Pixel Error?
I am developing a game on android using OpenGL ES 1.0 for Android OS. It is a 2d game using a simple Orthographic projection and textures for the sprites. One of these textures has a small line (it ...
0
votes
1
answer
868
views
Create 2D sprites with libGdx using a shape and a texture separately
I am creating a 2D game with LibGdx that will have creatures that are generated from dozens of characteristics with potentially millions of unique combinations. For each segment of each creature, I ...
2
votes
1
answer
2k
views
Is there any way to change texture filtering globally in Direct3D 11?
One of the major changes I have encountered between Direct3D 9 and Direct3D 11 is the new API for setting up texture sampling. In D3D9, it was sufficient to simply set a given value of a given ...
1
vote
1
answer
1k
views
How to create a sun billboard with Ogre3d
I've been working with a few different engines alongside trying to code my own project. Rather than rewrite an entire renderer, etc I am using Ogre3d. To begin with I am trying to implement a very ...
6
votes
2
answers
38k
views
How can I render a texture to the screen in SDL2?
I've recently started upgrading my SDL version from 1.2 to 2.0.3, and while on the SDL Wiki, I've come across SDL_Renderer, SDL_Window, and SDL_Texture. I did some research and found a link at ...
1
vote
1
answer
4k
views
Why is the light following my camera around?
I have implemented a simple Phong shader without specular highlights for now (just ambient + diffuse components)
The problem however, is that the calculations seem to be done in camera space; as I ...
1
vote
2
answers
1k
views
How to reduce/remove graphical artifacts?
Question
I'm working on a side-scrolling game that has a 2D grid for rendering to the screen. I'm using OpenGL, and I've optimized my game so that nothing invisible is attempted to be drawn.
As of ...
1
vote
1
answer
2k
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 ...
1
vote
1
answer
346
views
How to draw or translate into world space?
I've been hacking around with OpenGL, but there's a few concepts which I can not find the answer on.
I want to draw three GL_QUADS next to eachoter like so:
1[2][3]
I know GL_QUADS are deprecated, ...
1
vote
1
answer
1k
views
Use of the xyY color space?
What's the use of the xyY colorspace in games? I'm not sure what's the advantage of using it in shader programming or elsewhere.
0
votes
1
answer
246
views
x-inverted obj importer in BulletSharp - what's wrong? [closed]
See [dead link removed] at the repository.
Screenshot:
[broken image removed]
Left: bullet imported version, right: correct 3ds max version.
It's somehow inverted. If you think that left part is ...
0
votes
1
answer
304
views
updating 2d array to contain chunk of larger 2d array - for 2d tile map
What i need help with is how can i get a chunk of a large 2d char array and update it so i am only drawing enough tiles to cover the screen?
Currently, i load all the chars from a text file and store ...
2
votes
1
answer
951
views
Invert Alpha on Image
I'm making a lighting system right now, and the last part I have to do is to invert the alpha channel on the final light map. My previous code that used to work was
...
56
votes
7
answers
83k
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:
0
votes
1
answer
737
views
3D rotation and movement of ball on a 2D plane
Here is a video of Amiga arcade pool game:
https://www.youtube.com/watch?v=zTQIPFBUFIg
I am making a similar game with C and Gtk+3.0 but I don't know how to show balls 3D movement on 2D plane!
I ...
0
votes
1
answer
197
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 ...
7
votes
2
answers
2k
views
Atmospheric scattering and sky geometry
I'm trying to implement an atmospheric scattering in my graphics (game) engine based on the GPU Gems article: link. An example implementation from that article uses a skydome. My scene is different - ...
0
votes
1
answer
232
views
How can I get my Android camera system working more like Google Earth's? [duplicate]
I'm implementing a touch screen interface whereby the user dragging their finger on the screen will rotate the camera in a sphere around the central point.
My code works well for the horizontal swipe ...
2
votes
1
answer
2k
views
How does the fragment shader get data from the vertex shader?
How can any interactions between these two shaders work? I mean the vertex shader sends a vertex's color to the fragment shader, but that's only one fragment, what about all the other ones between the ...
3
votes
1
answer
6k
views
What is the difference between shader uniforms and attributes in OpenGL?
I don't fully understand the differences between uniforms and attributes. To be honest, I probably haven't even used attributes.
Can uniforms change for each vertex? I mean to calculate the vertex's ...
2
votes
2
answers
5k
views
In GLSL is it possible to offset vertices based on height map colour?
I am attempting to generate some terrain based upon a heightmap.
I have generated a 32 x 32 grid and a corresponding height map ->
In my vertex shader I am trying to offset the position of the Y ...
7
votes
3
answers
2k
views
What Shading/Rendering techniques are being used in this image?
My previous question wasn't clear enough. From a rendering point of view what kind of techniques are used in this image as I would like to apply a similar style (I'm using OpenGL if that matters):
...