Questions tagged [graphics-programming]
Programming related to the visual representation of information on computer screens.
412 questions
0
votes
1
answer
825
views
In game engine, how to get the vertices buffers of different vertex formats for render from the mesh file properly?
I'm a fresher on engine programming. I have a question of how we can get the vertices buffers of vertex formats from the mesh file.
For example, in OBJ file or FBX file, we save the positions, ...
3
votes
0
answers
898
views
How can I create a wind visual effect like Ori?
I'm working on a mobile game in Cocos2D. The game mechanic is very similar to Ori and the Blind Forest's parachute (Kuro's feather) mechanic. I want to be able to render a visual effect for wind ...
0
votes
0
answers
146
views
Tilemap not rendering properly
I'm making a single-screen scrolling platformer (OpenGL/SDL) and I've made a tilemap out of a 2D array, pre-sized with variables of the LEVEL_HEIGHT and ...
0
votes
1
answer
411
views
What technique should I use to implement the following type of "diggable" terrain?
I'm trying to replicate a certain game mechanic from the game Diggles.
This game takes place in a vertical cross-section of the earth and allows the player to dig tunnels and caves into the ...
22
votes
6
answers
6k
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 ...
1
vote
3
answers
2k
views
Is it possible (and practical) to dynamically create normal maps from graphics in Pixi.js?
I am building a tile game using Pixi.js. The game features dynamically-generated terrain and a day/night cycle. I'd like to use a normal map to give the sense of sloping hills or mountains.
Luckily ...
1
vote
0
answers
180
views
Which programming language should I start with in game dev? [closed]
I am a front end web developer and I've always been interested in building games. I work primarily with HTML, CSS, PHP, and JavaScript on a daily basis, so I'm not new to coding. I would like to ...
1
vote
1
answer
220
views
Skeletal Animation - Caching global bone transforms
Very often I see skeletal animation implemented like this:
On Init - store bone's local transforms and inverse bind pose
On Update - traverse the skeleton tree, multiplying local transforms on the way ...
0
votes
1
answer
429
views
Enlarge screen space Texture by set pixel amount
I have a texture shown over the screen using screen space UV's. The Texture is 495x,596x, Screen size is 888,500, but can change. The Texture has a Tile of (3.469775f,1.392644f) to correct for ...
1
vote
2
answers
2k
views
How to make a "Camera" in Java
I need some help with getting my camera to work in java for a game that I am making. The problem is is that I've never made a camera in a game before and this is my first time trying to make one in a ...
2
votes
0
answers
2k
views
Dual Contouring - what is it and how to use it?
I'm having trouble understanding Dual Contouring yet and I need some explanations from someone who has first hand experience.
I searched all I could before writing this question. I've already read:
...
1
vote
2
answers
113
views
Timed Line Drawing
I'm trying to program a remake of the classic Missile Command Atari game from scratch, but I've run into a problem. So I have a function that can draw a line from one point to another. I figured I ...
4
votes
1
answer
753
views
How do I use openGL shader to reproduce this Photoshop implementation?
Here are my Photoshop actions:
step1 - convert the current image into gray
step2 - use the default parameters, as showed in the screenshot
step3 - use the 『Hue/Saturation』 to convert the grey image
...
3
votes
2
answers
3k
views
Why did 320x240 become the famous Mode X, and not 400x300? [closed]
Mode X was hack invented during the good old days of DOS gaming, offering 320x240 resolution, 256 colors, square pixels, and page flipping.
VGA adapters had 256 KB of memory.
320 * 240 = 76800 bytes
...
4
votes
1
answer
631
views
Java Slick2d lighting using Raycasting
I am trying to make a top down view game in java using the Slick2d library, for lighting I wanted to do something like this : http://www.redblobgames.com/articles/visibility/.
I was wondering if there ...
2
votes
1
answer
168
views
How can I recover polygons and normal maps from compiled games through emulation of D3D or OpenGL?
I am trying to generate labeled training data for an artificial visual cortex to learn on. I'm looking for a tool that will, instead of rendering the scene at each pixel just give me the pre-rendered ...
1
vote
1
answer
88
views
What happenes if you leave out buffers for the inputassembler that the vertex shader expects?
I'm working through my first attempt at a "graphics engine" (I use the term loosely as I'm not aiming for much more than something that will display a few meshes). I want to leave my classes as ...
2
votes
1
answer
651
views
Unity + Oculus Rift - Setting field of view or rendering part of display
I need to render a small portion of the display to a texture.
I found a script to simulate a scissor rect by modifying the projection matrix - Unity 5 doesn't seem to provide any out-of-the-box ...
3
votes
2
answers
3k
views
How to achieve a dynamic soft see-through hole effect in a wall with shaders?
I'm looking for a way to create a dynamic soft see-through hole effect for room walls. I know a few ways how to do it (for example multitexturing with second layer being the hole mask in screenspace), ...
2
votes
0
answers
151
views
uv tiling and offset for uvs not min-max 0-1
For the purpose of the question, a unit = 1 meter.
So, I have a triangle strip that is 4x8 meters (for argument's sake; it is procedurally generated by player). I also have a texture which is ...
48
votes
2
answers
15k
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 ...
1
vote
1
answer
1k
views
How can I change my rendering loop to improve scalability across effect types?
This is the code that I use to setup my shader:
...
-1
votes
2
answers
221
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:
...
1
vote
0
answers
649
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: https://msdn.microsoft.com/en-us/library/...
1
vote
0
answers
389
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 ...
9
votes
1
answer
2k
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
1
answer
2k
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 ...
3
votes
0
answers
211
views
How can I handle multiple simultaneous skeletal animations? [duplicate]
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:
Load the mesh with ...
3
votes
1
answer
10k
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 ...
1
vote
1
answer
76
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 ...
8
votes
2
answers
5k
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 ...
4
votes
2
answers
3k
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
2
answers
821
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 ...
8
votes
1
answer
441
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
1
answer
201
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?
...
12
votes
2
answers
11k
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 ...
1
vote
1
answer
3k
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
0
answers
654
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
1
answer
142
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 ...
5
votes
3
answers
4k
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
1
answer
332
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
1
answer
3k
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
1
answer
134
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
1
answer
250
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
2
answers
928
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?
...
5
votes
2
answers
489
views
Apply a special effect to a scene area
My 2D game has a second camera on the 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 top of it I render ...
1
vote
1
answer
7k
views
Insert 3d text to the front face of a cube GameObject
I want to add a text to a cube in Unity.
I have a cube which has a 3d text as a child.
I am using the below UnityScript to write on the 3d text:
...
1
vote
2
answers
387
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
1
answer
914
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
1
answer
512
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 ...