We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [graphics-programming]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
36 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 ...
1
vote
1answer
69 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
133 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
55 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
0answers
32 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
47 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 ...
0
votes
1answer
45 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
56 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: ...
-1
votes
1answer
228 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 ...
1
vote
2answers
41 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
68 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, ...
0
votes
3answers
110 views

weird behaviour doing simple XMMATRIX multiplications

I have the following function: ...
0
votes
2answers
77 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 ...
0
votes
1answer
94 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
1answer
70 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 ...
0
votes
1answer
210 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 ...
0
votes
1answer
62 views

How can I seamlessly animate textures across tiles like in Civilization 6?

I am trying to make a much simpler version of the graphic effects we see in the game Civilization 6. This question applies to the graphics on land and ocean tiles. But I first noticed this effect on ...
1
vote
2answers
105 views

How to develop custom Unity graphics?

Processing is a Java library for working with computer graphics, providing methods by which to draw primitive objects, custom meshes, etc., as well as mathematical methods (such as Simple Harmonic ...
0
votes
0answers
45 views

OpenGL texture management

I have an OpenGL engine built using bindless textures, which allows me to store all materials in an UBO and drawing thousands of instances with different materials in one pass, by accessing the ...
0
votes
1answer
143 views

Polygons depth sorting in Z-buffer

Why is it that the Z-buffer algorithm does not require polygons to be depth sorted to function correctly?
23
votes
3answers
5k views

How do I know if I'm abstracting graphics APIs too tightly?

When making a renderer that supports multiple graphics APIs, you would typically want to abstract your code in some sort of low level library that is tied with some graphics API like OpenGL, Vulkan, ...
0
votes
1answer
189 views

How to create a decent strategy game without becoming an artist?

I love to make games. But I am not an artist. I never learned to make 2d or 3d models. I spent most of my time on programming. I know there are Game engines for non-programmers. But I am looking a way ...
1
vote
1answer
560 views

Rendering clouds similar to Sky: Light Awaits?

I'm interested in adding clouds to my game, with a style similar to those in Sky: Light Awaits You can see them in motion in these videos: (Starts at 26:00) https://www.youtube.com/watch?v=...
0
votes
1answer
134 views

Directx 12 Root signature compatibility with pso

Can you bind a different root signature than the one that pipeline was created with? If so does it have to have exactly the same parameters or could it have like one more but the pipeline will ignore ...
1
vote
0answers
185 views

how to calculate smooth normals for 10,000,000 vertices?

I am trying to calculate smooth normals with angle weight for a huge mesh with 10 million vertices. Currently, i am using map/dictionary to store the traingles connected to a vertex. That is, for each ...
1
vote
1answer
159 views

Why do GPUs have limited amount of allocations?

I've been learning Vulkan lately and I read that you can allocate VRAM memory only set amount of times and it doesn't matter if it's 2gb or 2kb, why is it? I'm specifically referring to ...
3
votes
1answer
130 views

Render moveable entities into 3D isometric world?

I have a separate list of moveable entities, and then the regular 3D map, represented by a 2D array of stacks of tiles. My problem is that right now, I'm rendering my moveable entities after the map, ...
2
votes
1answer
923 views

Strange realtime shadows in Unity3D

I'm trying to do realtime lighting, and my shadows are acting very strange. When I project a spotlight out from the camera (like a flashlight in a first person game) my shadows show up as 3D skews of ...
22
votes
1answer
2k views

Why do transformation matrices always have an extra dimension? [duplicate]

In 3D math I always see matrices with one additional dimension. For example, in 3D graphics, matrices are always 4x4 and in 2d they are 3x3 matrices. Can anyone explain why?
5
votes
2answers
326 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 ...
1
vote
1answer
178 views

Does it make sense to do more calculations in the fragment shader if there are more vertices than pixels?

I'm very new to graphics programming, and as I understand it vertex shaders are called per vertex and fragment shaders are per pixel (ignoring anti-aliasing). When it comes to optimization all sources ...
1
vote
0answers
107 views

How does one create ENB for games like: San Andreas

I know this particular community could be wrong for such a question that includes programmers, modders and such. I believe I should be asking such question on stackoverflow.com or something similar, ...
1
vote
1answer
63 views

Does GL Memory model guarantees that late Depth Testing accesses depth buffer values in same draw call

Suppose I issue a draw command that draws 3 overlapping triangles (T1, T2, T3). Fragment shader assigns Depth = 3 to T1 fragments, 2 to T2 and 1 to T3 fragments. Depth Buffer is cleared to 0 before ...
3
votes
0answers
527 views

ray-casting, floor-casting part fails

I'm currently working on a ray-casting engine in Java and I can't figure out what's wrong with my code. For the learning and theory I use: The permadi tutorial: ( https://permadi.com/1996/05/ray-...
0
votes
1answer
90 views

OpenGL: How to render a “shadow” for an object that's behind another?

First off, an image from Fez that depicts the effect I'm after: I'm trying to achieve a similar effect in my project. I'm quite certain this is done with a stencil buffer, but the resources on such ...
1
vote
0answers
23 views

How can I load a file in memory on the Apple IIGS?

I recently got an Apple IIGS and have it booting GS/OS off of a compact flash with 10 32MB ProDOS volumes. It's a great little setup and I've installed ORCA/M, 816 Paint, Merlin 16+ and Complete ...
5
votes
1answer
485 views

How can I dynamically switch between graphics APIs?

In games like the new "Doom", you have a console, from which you can use commands to reduce the game's quality or even to switch graphics API, from Opengl to Vulkan and viceversa. How is this done? I ...
0
votes
1answer
174 views

What does declaring a const float within a function do? (CGFX)

I've been working with this piece of code to get the mip map level that I should sample for a texture that I got off a forum somewhere. I noticed that they use a const float. Now from what I ...
1
vote
1answer
37 views

How to adjust scaling with rotation?

I'm rendering a texture to a square. I have to scale the texture because it is 10 times wider than it is tall. In my fragment shader I divide both the X and Y texture coordinates (I'm using OpenGL), ...
2
votes
3answers
800 views

OpenGL: How do I map a square texture onto a rectangular surface?

I'm not asking about how to map the texture itself. I'm just wondering how I could go about evenly mapping a texture to an object so that it repeats itself instead of stretching to the surface. For ...
0
votes
1answer
240 views

Normals on a sphere

I am generating vertices for a sphere by normalizing the vertices of a cube. The coordinates of the vertices are mapped to [-1; 1]. . I want to get the normal vector of each vertex. My question is ...
2
votes
2answers
348 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
2
votes
0answers
34 views

What does a game programmer and graphics programmer do? [duplicate]

I'm quite the novice in terms of my knowledge of game development, and I'd incredibly appreciate any further insight on this. To be a bit more specific, I encountered this video, (https://www.youtube....
2
votes
1answer
301 views

One Giant Shader VS Many Small Shaders

I am building forward rendering engine combined with atlas shadow map technique. My goal is to build an engine that is capable of rendering similar scenes from games such as.. Doom Overwatch So I ...
4
votes
2answers
2k views

Do sprite animations usually run at the same framerate as the game itself?

Just getting into game development and wondering about fps. For example, Binding of Isaac can run at 60 fps, but looking at its sprite sheet, the walk animation is only 12 frames. The game animation ...
1
vote
2answers
114 views

How to clip 3D object in projection (octants)?

In example we've wrote some code in Pascal (graph unit) which rotates 3D object in oblique frontal (dimetric) projection in all octants positioned in center of them. The projection's type: The code ...
0
votes
1answer
242 views

GLfloat vs GLfixed vs GLint performance in 2017

Some people claim that floats should be used for rendering vertices in modern graphics cards, because graphics cards are optimized for floating-point arithmetic and therefore, integer calculations are ...
0
votes
2answers
71 views

How to render a model that consists of individually transformable parts?

Consider a 3D model for a spider that consists of a body and eight legs. The legs can be transformed (rotated) relative to the body. I am not sure what the common ways of rendering such a scene are, ...
1
vote
1answer
146 views

Zooming in so a smaller portion of the game scene fills the entire screen

so i am creating a game similar to super-smash-bros, in which the camera should zoom in on players when they are close together, and scale back when they are apart. I create a window for my game via <...