Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [graphics]

A very generic term referring to visual part of a game. Try to avoid unrelevant usage and instead tag for specific graphics type (2D, 3D), API, framework or a library you are using, if possible.

Filter by
Sorted by
Tagged with
0 votes
1 answer
34 views

How to compute screen-space error for LOD selection?

I'm developing a LOD selection system and I would like to select a LOD level based on screen-space error. Could someone explain how I can accurately compute the screen-space error?
0 votes
1 answer
26 views

Update index buffer in Vulkan at run-time

What is the proper way to update at run-time the index buffer in Vulkan? Many thanks
2 votes
1 answer
70 views

How to check if an AABB is behind another AABB while isometric depth sorting?

I have an isometric scene in a custom engine where my world sim is 3D, but I'm rendering sprites. To depth sort, I follow the approach in this blog post. Basically: wrap each sprite in an AABB, then ...
1 vote
3 answers
2k views

Graphics2D.drawImage not working

I'm trying to come up with my own game using Java AWT after watching a few video tutorials. However, I encountered a problem where I cannot draw an external image file that I loaded using the ...
0 votes
0 answers
27 views

Height gradient generation from height map,using compute shader has weird artifacts

I am trying to generate the height gradient (the slope) for a heightmap of mine using a compute shader in Unity, and the result has weird ringing artifacts and I completely lost what could be wrong. I ...
0 votes
0 answers
21 views

The perspective projection change the sign of z

I have an issue, I am drawing a cube in 3d. I am using z-buffer for hidden surfaces removal. But the hidden faces are drawn (i see the inside of the cube). After some research And I found that this ...
11 votes
1 answer
30k views

The view matrix finally explained

I must say that I am really confused by how a view matrix is constructed and works. First, there are 3 terms: view matrix, lookat matrix, and camera transformation matrix. Are those 3 the same, or ...
0 votes
0 answers
30 views

How to implement graphics API functions like setUniform on a cross-platform shader in VLang?

I've been working on a C++ game engine for a while, but I decided to scrap the project because doing it in C++, despite my best efforts, I could feel the technical dept building. As such, I switched ...
1 vote
1 answer
84 views

Mirroring a Character's Position In a Shadow After Rotating 180 Degrees

Description: I am creating a 2.5D RPG. When my character moves from left to right, they rotate 180 degrees to face the new direction. Just like this example. They also have a blob shadow sprite that ...
0 votes
0 answers
26 views

Texture space Raytracing of cylinder primitive in godot shader for Helix interception

I have been trying to do raytracing of an helix in a spatial shader in godot 4.2, but apparently I missed something because the result is bloby and melty at the cylinder level. The basics is that I ...
17 votes
4 answers
11k views

Pleasing isometric hexagons

What angles and long-side/short-side ratios give the most aesthetically pleasing and graphically regular isometric (squashed and flat side up) hexes, that additionally resolve to whole pixel sizes for ...
4 votes
1 answer
118 views

What are N-Buffers?

For a school project, I had to read a scientific paper that talked about Ambient Occlusion. In it, the authors mentionned using a technique they call N-Buffering. From what I understood, it looks like ...
0 votes
0 answers
21 views

Black screen when sizing JFrame/JPanel with Toolkit.getDefaultToolkit().getScreenSize()

I am working on a game engine. ...
1 vote
1 answer
733 views

How To Calculate The Correct Sprite Dimensions?

I am creating a 2.5D game similar to Paper Mario. I want the sprites that I import to Unity to be the perfect dimensions so that quality is not affected by the camera's position. If I'm understanding ...
0 votes
1 answer
3k views

Sprite becomes blurry or jagged when camera zooms out

My game uses 2D sprites in a 3D environment, and I'm really struggling with my sprites' quality. I have high resolution vector art with clean linework created for my sprite. I'm exporting it as a .PNG ...
0 votes
0 answers
51 views

C++ how to load different assets within an asset manager?

I'm in the process of redoing my asset/resource manager currently I have load functions scattered throughout my code for example LoadMeshFromFile(), LoadTextureFromFile(), LoadShaderFromFile(), etc, ...
0 votes
1 answer
77 views

How to get the direction to the sky a pixel is facing to draw a sky?

I am drawing an empty texture over a framebuffer with a fragment shader active to try and draw a sky, but I need the direction each pixel is facing in (for correct linear perspective) to draw the ...
2 votes
1 answer
1k views

How to manually render with a given camera in Unreal Engine 4?

I would like to render with any camera at any given time for a Portal clone project. There's a USceneCaptureComponent2D but it renders the whole scene to a texture. ...
2 votes
1 answer
68 views

Hide Horizon Line with Small Terrain?

I'm drawing a sky plane with an atmosphere fragment shader in front of my terrain. It looks pretty much fine at sea level, but if you move above the sea level, the illusion is quickly broken, as you ...
3 votes
1 answer
5k views

What is the purpose of tangent and bitangent vertex attributes?

Every vertex of a 3D mesh has position and some optional values like texture coordinates, vertex color, and normal, but also tangent and bitangent vectors. While the purposes of texture coords, vertex ...
0 votes
1 answer
690 views

Using GetRawTextureData<Color32>() in Unity with non RGBA32 textures?

I am trying to manipulate a Texture2D using GetRawTextureData<Color32>() as this does not require extra memory to be allocated like ...
0 votes
1 answer
377 views

Cocos2d-x setContentSize, setScale give poor graphic quality

I want to create sprite with size is relative to the screen size. I.e: Sprite size is equal to screen width * 0.2. I use setContentSize and ...
2 votes
3 answers
553 views

How do I prevent buffered image size fluctuation when rotating?

As you can see in the GIF, as the car rotates, as the Car rotates, the size appears to change to fit the determined height and width, what would be the best way to change these in conjunction with the ...
0 votes
1 answer
177 views

Shader to give the effect of a 2D character covered in oil

I have a 2D pixel art game where characters can be covered in a flammable black oil-like substance and I am looking for a simple way to depict that visually. Simply tinting the character black won't ...
29 votes
5 answers
21k views

Why is Y up in many Games?

I learned at school that the z-axis is up. It is the same in modeling software like Blender. However in many games the y-axis is up. What is the reason?
0 votes
1 answer
92 views

Normalized coordinates not translating to screen coordinates the way I need them to

I am making a simple game in C# using pictureboxes. I want to move a picturebox on a form. Once this picturebox is placed in a new location, I normalize its X,Y coordinates between [0, 1] and then ...
0 votes
0 answers
42 views

Spherical Billboard Effect

I try to make a spherical billboard that follow the camera's direction. But, the result that I got is model get distorted or event twisted. If I'm using only a yaw/pitch quaternion per time, it works ...
0 votes
0 answers
34 views

How can I create a Spotlight in a Vertex Shader?

...
17 votes
3 answers
6k views

Game loop isn't performing well enough, so my frame rate is too low (Windows Form + GDI+)

I decided to learn about building games, so I picked up C# to use it along with Windows Form - I already have C# experience, so that was the main reason I did so. That said, I tasked myself to build a ...
1 vote
0 answers
62 views

LWJGL3. A strange graphic artifact of OpenGL 3.x

I work in java with lwjgl3. I came across a strange artifact, the source of which I have not been able to determine for a very long time. I'm drawing a large surface. When I approach this surface and ...
0 votes
2 answers
8k views

Low FPS in Unreal engine, but GPU usage is low as well

I am running an Unreal Engine 4 project which has many high quality assets. My computer is fairly strong: CPU: AMD Ryzen 5 3600 6-Core GPU: GeForce RTX 3060 SSD: Lexar 500GB NM610 M.2 NVMe SSD RAM: 2 ...
2 votes
1 answer
249 views

How is a Spherical Harmonics Lightmap generated?

I have successfully generated a single color lightmap using ray tracing. For each texel in the lightmap, I trace into the hemisphere (using the normal) and capture the incoming light. This single ...
1 vote
0 answers
193 views

Recreating The Visual Effect From Super Mario RPG Remake In Unity URP

The upcoming remake of Super Mario RPG uses an effect that adds a 'colorful fog'(I'm really struggling to describe it 😅) to certain parts of the screen. It's mostly used in the corners and top of ...
0 votes
0 answers
284 views

PyOpenGL "Attempt to retrieve context when no valid context" - seems to be Linux specific?

I've been trying to learn PyOpenGL, so I'm still pretty clueless about what's going on. I've been following a video series. I couldn't get it to stop throwing "Attempt to retrieve context when no ...
1 vote
0 answers
31 views

Issues with bitmap character spacing

I've been working on a bitmap character renderer for my game engine in C#, however, I've been running into some spacing-related problems. This script parses the font and gets all the relevant data ...
1 vote
1 answer
122 views

Can somebody please explain why my illumination is inconsistent?

100% not a graphics guy here. Problem Demonstration. Randomly discovered this when showing the project to a friend after not touching it for over a month (been working on other stuffs). First I ...
0 votes
1 answer
2k views

glfw resizing causing image scaling

I have a quad rendered that extends from the top left of the window to with width of the window that is also 64 pixels high. When I resize the window, from its initial size, the quad and text scales ...
63 votes
5 answers
74k views

What are normal, tangent and binormal vectors and how are they used?

I would like to find out the following information: What are they? Example usage in game development (the area they are used in) About the following vector types: ...
1 vote
0 answers
45 views

How to Generate a Texture to Make an Obstructing Plane Appear Invisible in a 3D Scene?

I have a 3D scene with a camera. Between the camera and the scene, I have a plane with arbitrary orientation. This plane obscures a portion of the scene from the camera’s perspective (anything behind ...
0 votes
2 answers
698 views

How to create pixel graphics in 3D?

I stumbled across this game on itch.io: Backland After trying to find information on how to accomplish the same graphics, I found this tutorial: Youtube Video How can I accomplish this 3-dimensional, ...
0 votes
1 answer
73 views

How to get rid of shading seams inside a cylinder?

Is there any other way to remove these shading "seams" other than to increase the vertex count of the cylinder?
1 vote
0 answers
32 views

Differentiate Generic Tromino or Tetramino Match vs Specific Shape (Square, Line, L, ect..) in Match-3

This is primarily a user interface question related to match-3 games and visualizing a goal for the player using clear imagery. I'm interested in having a match-3 game where if you get certain matches ...
0 votes
0 answers
243 views

Implementing Camera Movement and Rotation in 3D Game Engine

Apologies in advance for any mistakes on terminology, I'm really really new to this I'm completely new to 3d (and it's maths) but as a personal exercise I'm doing my own game engine that displays a ...
0 votes
0 answers
41 views

Perspective projection distortions

I'm building my own engine using python and pygame however my cube model is not able to be displayed correctly. This is my result after applying translation, scaling and projection matrices: ...
0 votes
1 answer
138 views

Perspective projection not working as intended

I copied a perspective projection matrix from here (https://jsantell.com/3d-projection/) and applied it to my vertices. It looks ok but without depth. Rotation matrices also work. When I try to divide ...
1 vote
0 answers
49 views

Trying to plot trajectory of rocket using only its current position and velocity components

I have a 2D controllable rocket for which I want to plot the parabolic motion. Additionally, the parabola should be able to change due to the thrust of the rocket accelerating it in either direction. ...
0 votes
1 answer
212 views

How to achieve no gaps between triangles in software renderer like in Quake?

I've heard alot that I need to use fixed-point math, top-left rule, etc. to eliminate gaps between triangles but the thing is how did Quake not have any gaps, did it? I've seen Quake's math file and ...
1 vote
1 answer
141 views

Bending at edges of screen

This is a weird effect where objects bend at the edges of the screen (shearing?). It doesn't happen everywhere. I know it happens in Minecraft and Godot, but not Blender or Bevy. What is it and is ...
0 votes
0 answers
36 views

Persistent Variable Issue: Incorrect Texture Index in C++/Opengl Rendering

I am attempting to render two different textures in C++/OpenGL. However, I am encountering an issue where the integer I pass as the texture index to my Fragment Shader always seems to be set to 0. In ...
0 votes
2 answers
208 views

Which method of preventing viewport distortions is most ideal?

I am working on rendering various 2D shapes in OpenGL. After initial experimentation, I came to the conclusion that the rendered image is distorted due to the window having a non-square aspect ratio: ...

1
2 3 4 5
22