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

learn more… | top users | synonyms

-2
votes
2answers
65 views

What's the difference between the representation of a line and that of a line segment?

What is the difference between a line and a line segment from the implementation point of view? To me, line segment means: class LineSegment2d { Point2d start, end; public: ...... } This ...
0
votes
0answers
24 views

OpenGL textureGather and DirectX gather

These functions sample multiple RGBA pixels but return only a single component. OpenGL: https://www.opengl.org/sdk/docs/man/html/textureGather.xhtml DirectX: ...
0
votes
0answers
38 views

Texture artifacts depending on texture size

I get some strange artifacting with textures depending on their size. I run OpenGL 3.3 with an GTX 580 so it should definitely support non power of two textures. I've narrowed down the problem ...
5
votes
1answer
138 views

What is a lobe, in reference to lighting and graphics

I sometimes see references to lobes when talking about lighting, especially with specular lighting, but also with spherical harmonics which doesn't do specular. Can anyone explain what exactly a lobe ...
0
votes
0answers
62 views

How to calculate spherical harmonic coefficients for indirect diffuse?

After reading the article "An Efficient Representation for Irradiance Environment Maps", I'm a bit confused as how to calculate the spherical harmonic coefficients. I'd like to generate these ...
0
votes
0answers
49 views

Animations in games

I wonder how skeletal animations in games work. I am Writing my own Graphics Engine for "fun", and I have come across several problems with animations. Here is how I do it right now: 1: Load the ...
0
votes
1answer
79 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 ...
0
votes
0answers
13 views

Creating VR Headset Video

So I have a video stream of known resolution and I have a VR headset via HDMI at a known resolution. Is there an existing library to create the slight fisheye and side-by-side layout for these ...
5
votes
2answers
200 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 ...
3
votes
2answers
561 views

How do I use graphics APIs to select the proper display device among multiple attached to a PC?

I have an LCD monitor display and Oculus Rift attached to my PC. I have an Nvidia 820M dedicated GPU. How does the GPU know to which display device it has to render (or to send rendered information)? ...
1
vote
2answers
91 views

Is it possible to run GLFW eventhough my graphic card(Nvidia) supports Direct3d API? [closed]

I have Nvidia 820M GPU installed in my windows 7 machine. In nvidia control panel it is showing it supports Direct3d API version 11. Am I able to run OpenGL applications(using GLUT,GLFW) on my machine ...
7
votes
1answer
91 views

Is quadrilinear texture sampling hardware supported?

If you have a volume texture with mipmaps, GL_LINEAR_MIPMAP_LINEAR texture sampling will perform quadrilinear texture sampling. Is that implemented in hardware like bilinear texture sampling is? Or ...
1
vote
1answer
68 views

Can you trilinear sample a non volume texture?

Let's say that i have a regular 2d texture (not a volume texture). Is it possible to do trilinear texture sampling of that texture even though it isn't a volume texture in opengl or directx? ...
5
votes
2answers
732 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 ...
0
votes
1answer
65 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
44 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
63 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
324 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
83 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
101 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
58 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
62 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
125 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
108 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
179 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
160 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
167 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
81 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
1answer
162 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
55 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: ...
0
votes
1answer
51 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 ...
35
votes
2answers
7k 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
59 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
152 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
461 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
112 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
452 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
82 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
220 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
269 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
444 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
81 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
84 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
85 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
104 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
705 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
2k 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
195 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
668 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 ...