Questions tagged [graphics-programming]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
128 views

How to Render two or more images on video frame in same draw call using metal

I'm new bee to graphics programming and i have an existing code base which basically takes frame from video and passes it to metal shader where effects (like colour changes) happens. Whats currently ...
5
votes
3answers
2k views

Ray tracing and Z buffering in graphics

I am a high school student taking computer science as a subject, and someone who is very interested in the game development industry. I am currently writing an essay on Raytracing and Z-buffering by ...
0
votes
1answer
34 views

How to position/transform vertices for 2D UI in shaders?

I am building a 3D engine and have a rendering abstraction that focuses on writing shaders. Most my 3D shaders have gl_Position output like: ...
2
votes
2answers
380 views

How does cube mapping work?

Based on my reading of cube mapping tutorials so far, my understanding is that you need a direction vector, and from the direction vector we can determine the point of intersection with one of the six ...
2
votes
1answer
70 views

Calculating Directional Shadow Map using Camera Frustum

I'm trying to calculate the 8 corners of the view frustum so that I can use them to calculate the ortho projection and view matrix needed to calculate shadows based on the camera's position. Currently,...
0
votes
1answer
52 views

OpenGL Rendering Pipeline

I've been learning OpenGL graphics programming and I've decided I'd quite like to make a simple game using OpenGL. Drawing something in OpenGL, needless to say, is quite the endeavour. However it ...
0
votes
0answers
38 views

What's the difference between bloom and emission?

In my engine, I've implemented bloom but I also want to implement emission because some models that I have come with an emission map. It sounded to me like something adjacent to bloom but I guess it's ...
0
votes
1answer
48 views

Pseudocode for calculating per vertex normals for a trianglestrip mesh

I have a terrain that is defined as a trianglestrip mesh. Now I'm trying to calculate the normals of each vertex but I've realised that my normal way of calculating vertex normals only works with ...
0
votes
1answer
139 views

Mapping a Texture to a 2d Quadrilateral

I want to map a 2d picture onto an arbitrary 2d quadrilateral, for the purpose of particle system. To do that, I split the picture into two triangles, and then linearly interpolated u,v along the ...
0
votes
1answer
39 views

Multiple directional lights use cases?

I have been building and designing a hobby-tier game engine and I am currently working on supporting any amount of lights of any type. I checked out Unity and it supports multiple directional lights, ...
0
votes
1answer
52 views

OpenGL approach to depth-testing-like combination of a large buffer of fragments

I have a depth buffer and color buffer created by another effect. The buffer is more than double my screen size. It is not rendered from geometry, but as a whole it resembles a rendered scene with an ...
0
votes
1answer
39 views

how are the vertex properties of meshpart decided based on model format in xna

Exactly how the question says , how does the vertex properties like vertex stride and the data stored in the mesh part decided based on the format of a model and how would i determine that and then ...
5
votes
3answers
557 views

How do I handle Game Screens in LibGDX?

In my game the main screen is the playscreen. But because I want to draw the menu and the gameover screen on top of the playscreen, I don't create separate screens for them. But if I want to replay, I ...
49
votes
9answers
33k 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'...
0
votes
0answers
16 views

PBR specular highlight artifact

I am trying to implement pbr and it seems I have an artifact at the specular highlight This is basically the code ...
0
votes
1answer
476 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 ...
0
votes
0answers
30 views

What information should be included in a render command?

I'm writing a 3D renderer for my engine and now that I'm working properly with a scenenode system, I've decided to implement render queues (command lists to some) and render commands. I wanted to know,...
1
vote
1answer
39 views

SDL window crashes when mouse goes below a certain point

I added code to check the rgb values of my surface, and whenever i call the function it seems to work fine! the only problem is that whenever the mouse goes under y = 400 the entire window crashes... ...
0
votes
0answers
43 views

OBB Frustrum Culling in Clip Space

I've been trying for a while to implement a frustum culling method using a per-computed AABB in object space and transforming it's corners into clip space. ...
3
votes
0answers
118 views

Object Transparency Dithering (as shown in Super Mario Odyssey)

A couple games I've been playing recently all have a similar goal of dithering objects when they approach the near clip plane. Super Mario Odyssey applies this dithering-near-clip-plane effect, but ...
0
votes
0answers
23 views

Gamma adjustment slider implementation

Various online sources talk in sufficient detail about gamma correction. By following them, I achieved a rendering pipeline that looks somewhat like this: ...
0
votes
0answers
44 views

What are the options when float textures aren't precise enough?

I am currently experimenting with rendering planetary scale terrain. I am generating the terrain on the GPU with noise, and to fix the 32 bit floating point precision problems, I generate the ...
5
votes
4answers
918 views

How to make game appear to run faster?

I believe I read somewhere that there is a technique which will make games appear more smooth than they are. I believe it is some visual trick, but I don't remember which one. (It is be something like ...
0
votes
0answers
25 views

Sprite alignment in my sprite packer

I am creating the "perfect" sprite packer. This is a sprite packer that makes sure the output sprite is fully compatible with everything. It converts (if needed) the source frames to BMP in memory It ...
1
vote
0answers
74 views

RayCasting with Mode7

I'm trying to join the mode7 algorithm with RayCasting. For mode7, I'm using a simple rotation matrix to implement the rotation. The result is a little strange and I can't fix it. Do you know what is ...
0
votes
1answer
93 views

Can I linear interpolate color along both the X and Y axis of a circle instead of using the distance formula on each individual point?

I've been unable to make it work and I'm not sure whether it's a problem with my code or if this can even be done. I'm sure there is a way to prove whether it is possible mathematically but I don't ...
4
votes
3answers
167 views

How to draw a smoother solid-fill circle?

I'm experimenting with drawing circles and have brute-forced a very simple one: Pseduocode: ...
0
votes
2answers
57 views

Can a character interact well with surroundings in-game?

I don't have any experience in game programming, but I am currently on programming-related degree, although on a different branch to game design. I thought about how an environment can come more ...
0
votes
4answers
4k views

graphical interface when using assembly language

I want to learn a framework to use in assembly. I know that's not possible without learning the framework in C first. So I'm thinking of learning SDL in C and then teach myself how to interpret the ...
0
votes
0answers
42 views

How to divide commands to CommandLists in DirectX12/Vulkan?

Currently my DirectX graphics engine submits all draw commands in a single, large CommandList. I want to paralellize my CommandList recording to improve performance on CPU side, but I'd have to ...
2
votes
1answer
139 views

Additive Blending and Gamma Correction

Should one do additive blending (aka lightmapping) in linear space? I tried doing it in linear space, and it became, well, linear and bland, losing that cool HDR-style bloomy effect. Is there some ...
2
votes
2answers
392 views

Anti-Aliasing Problem

So, I was annoyed by how the HUD for my GameState was very pixel-ated and I wanted to change that through the use of anti-aliasing. However, it works with a small exception: It adds all these lines ...
0
votes
1answer
127 views

Alpha Blending in Software with Gamma Correction

How does one efficiently implement alpha blending, without botching gamma? Alpha blending is basically the following expression: ...
0
votes
2answers
172 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. ...
-1
votes
1answer
235 views

Fastest Software Gamma=2.2 for RGB?

With gamma=2.0 you can use that Carmack's inverse sqrt hack or a lookup table. Yet all standard graphic formats mandate the use of gamma=2.2, and SVGA framebuffer also requires it. Unfortunately, for ...
25
votes
8answers
10k views

What advantage do OpenGL, SFML and SDL have over software rendering?

I started watching the Handmade Hero stream, where Casey Muratori creates a game engine without using frameworks or such. Yesterday I got to the part where he showed how an image is drawn onto the ...
1
vote
2answers
49 views

How can I create a .ico file with all the various resolution sizes within one container?

I was looking at this GOG.ico in ffmeg, and was surprised to see all the streams for it...indicating it was holding multiple images in the .ico container or .ico has some kind of self-creation ...
2
votes
2answers
435 views

How To Add Animation Graphics To An Android Game

How to make something like this animation drawings that coming out from the car ? (I'm using android studio) The Game's Link : Finger Driver
5
votes
2answers
453 views

Ordered dithering between “discrete” colors?

I want to achieve color dithering between discrete colors like this: As you can see, there is no gradient, or technically there is, but very discrete as it's only a 3 color image (right bar). So I ...
0
votes
2answers
159 views

d3d11 renderqueue multi pass rendering design best practice

The goal: issue least calls to d3d11 ImmediateContext and render advanced effects like toon / outline / anything that requires rendering the same vertex buffers with at least two different vertex ...
2
votes
2answers
82 views

Midpoint displacement generating unsatisfactory terrain

Following this lesson for implementing mid-point displacement algorithm for terrain generation. I aim at generating a wavefront(obj) file of the terrain I have an array of dimension (2^n + 1) x (2^n +...
40
votes
3answers
6k views

How can bays and straits be determined in a procedurally generated map?

I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map. So far, I've been successful in labelling certain geographic features: land, ocean, ...
1
vote
2answers
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 ...
0
votes
3answers
140 views
0
votes
1answer
227 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
1answer
197 views

When does it make sense to use Index Buffers?

The concept of Index buffers is that certain vertices are shared across faces, hence can be reused to save space of duplicated verticies. A vertex is usually more than 12 bytes (depending on the ...
1
vote
2answers
56 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 ...
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 ...
49
votes
7answers
66k 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
1answer
535 views

Is Frustum Culling and Occlusion Culling used together, or separately?

I am taking a 3D game programming course and my professor provided the class with already-implemented graphics code with OpenGL. The graphics uses frustum culling to remove primitives outside the view ...

1
2 3 4 5
8