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

learn more… | top users | synonyms

0
votes
1answer
49 views

Depth Stencil Buffer

In OpenGL, what is the difference between GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL? I have looked around and have been unable to find a clear explanation. Information on their usage with GLSL would ...
0
votes
0answers
22 views

Is it reasonable to generate mipmaps on the color attachment of my framebuffer in realtime?

I'm looking into hdr tonemapping and so far all the equations I've found result in really, dulled results. One i haven't tried uses an average luminance of the image. The pdf I've been reading ...
1
vote
1answer
56 views

Question regarding irradiance

I know that the formula for irradiance at surface point p with normal n given a point light source at position l is: H = I(cos x) / ||l - p||^2 Where: x = angle between n and l-p I() = Intensity ...
2
votes
3answers
164 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?
1
vote
1answer
47 views

How to orthogonalize the “up” vector in a camera based on “eye”, “look” and “up” vectors?

Given a camera position defined as (eye, look, up), where "up" not quite at right angles to eye->look, how would I re-orthogonalize "up"? I've had a hunt around, but did not find anything, yet if I ...
0
votes
1answer
34 views

How to load in meshes efficiently into DirectX11

I wanted to know if there was a standard and efficient method to load meshes from a file into DirectX11. Currently, I'm loading .obj's by parsing them in and storing their information into a vertex ...
0
votes
1answer
45 views

DirectX11 Shader issue

I am currently having issues with HLSL shaders. I am trying to implement point lights but I am getting unusual data when debugging the shader in Visual Studio. I have read on several sites that say ...
0
votes
1answer
39 views

Creating procedural mesh with orientation

I am working on creating a procedural cylinder mesh with Unity C#. I have everything working but there is one thing I would like to implement in my existing code is to define a vector3 halfAxis which ...
0
votes
2answers
90 views

What's the correct way to move 2d sprites in opengl 2.1?

I'm getting into Opengl 2.1 and wanted to know how can I move 2d sprites. I already created my vbo and ibo, and the vertex data is already there. But, how can I move a sprite once it's already drawn? ...
1
vote
1answer
71 views

Apply an special effect to an scene area

I have a 2D game where I have a second camera on my scene, that renders an upside down image of the scene, and distorts it, giving the effect of water reflection. I render this camera first, and on ...
1
vote
2answers
166 views

How to calculate alpha for n channels, so the sum equals 1 (100% coverage)?

Having "n" number of overlaying channels (bitmaps in the same place, layers etc.) how to calculate required alpha for each of them, so they "hide" background completely? Each layer can have equal ...
1
vote
1answer
71 views

Problem with 2D matrix transform og shapes

I have set myself onto the task of creating a class BaseObject, which represents a graphics object with an associated shape as the member variable shape, which is a pointer an object Polygon. I'll ...
2
votes
1answer
125 views

What are some ways of making a game engine centered around the idea of drawing vector lines and polygons only? [closed]

I've always loved the look of games that just use simple lines and polygons for graphics. Rez is one of my favorite games, visually. I'm a programmer and designer first and foremost, and I'm horrible ...
0
votes
1answer
60 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 ...
0
votes
0answers
59 views

'Bad' triangles when doing affine texture mapping

I am really clueless about what i must do. I wrote a function to do affine texture mapping, but i get in most situations 'bad' triangles. I really didn't want to ask this question as it probably is ...
1
vote
1answer
96 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
0answers
53 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 that a component could utilize it. Instead, I found two different objects: ...
-1
votes
1answer
47 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?
0
votes
0answers
8 views

Fill color in moving object without flickering [duplicate]

Here is my code in which moon is moving around earth but now i want to fill moon and earth with color and also want to remove flickering in the moon while moving. Please help me, i will be very ...
34
votes
2answers
6k 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: (1.0, 0.1, 0.5), (0.1, -0.5, 0.3), (-0.51, 0.46, -1.0) ... ...
2
votes
0answers
51 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
1answer
113 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!! #include <stdio.h> #include <conio.h> #include <graphics.h> #include ...
3
votes
1answer
385 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, ...
0
votes
0answers
84 views

How to get drawing offsets for an isometric camera

I do have some semi-working code, but I'm really stuck on getting everything to align to the screen properly. Here's my current, broken solution in Javascript: //ts = tile size (i.e. 64), th = ts/2, ...
3
votes
1answer
291 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
1answer
74 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 ...
5
votes
1answer
158 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 working code for the sake of it). ...
1
vote
1answer
177 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?
9
votes
1answer
412 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
2answers
78 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 account. I have put a world matrix ...
0
votes
1answer
79 views

Possible to create 3-D or accelerated graphics on Windows using your own library/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
1answer
65 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
1answer
90 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
2answers
454 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 ...
4
votes
2answers
1k 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 ...
0
votes
0answers
142 views

Fixing/avoiding Z-fighting with decals OpenGL

I'm trying to draw animated flames as a decal in OpenGL (just a simple quad with an animated texture as a decal on another quad). Problem is as the camera moves away I get terrible Z-fighting in the ...
5
votes
1answer
504 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
3answers
189 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
2answers
324 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 ...
2
votes
2answers
369 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 ...
10
votes
1answer
471 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 ...
2
votes
1answer
615 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
3answers
572 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 XNA, I need the angle for which I'd have to compute cos or tan ...
2
votes
4answers
347 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
1answer
90 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
1answer
269 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 ...
1
vote
1answer
239 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
1answer
471 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 ...
1
vote
2answers
2k 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
1answer
426 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 ...