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.

116 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
1 answer
1k views

Making a pixel-perfect viewport in LibGDX

My game that uses LibGDX as the graphics library, should be playable with every display. Here's the problem: It have to be pixel-perfect. That means, the scale factor must be an integer value, so that ...
user avatar
  • 191
5 votes
1 answer
193 views

Fixing the size?

My app isn't compatible with all screen sizes. When testing on a small size, my textview overlaps with my button. So, as suggested on the Android Documentation, and many stack overflow pages, I ...
user avatar
4 votes
0 answers
925 views

Normal Mapping a Cubemap

I posted a question on Stackoverflow and it was suggested that it would be better asked here. I have a sphere. It was created via the icosphere method outlined here: http://blog.andreaskahler.com/2009/...
user avatar
4 votes
0 answers
231 views

DX 11 Specular Highlights in Deferred Renderer

I am currently implementing a deferred renderer in DX11.1. Right now I am having a problem that I can't seem to crack with specular highlights when I have multiple light sources. I keep a vector of ...
user avatar
3 votes
0 answers
649 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 ...
user avatar
3 votes
0 answers
323 views

Changing sprite tint over time in Unity. Sprites affected by "light"

Recently I was playing "Altos Adventure" on mobile. I was curious how I could implement an effect similar to their game background. The sprites tint over time to match the time of a day. It's blue ...
user avatar
3 votes
0 answers
404 views

Smoothly fitting texture tiles using alpha gradient on edges

I'm trying to draw a background texture with tiles that I'll rotate and mirror to create a maze. Here is a sample tile: As you can see, I use an alpha gradient on the borders. If I'd use a sharp ...
user avatar
  • 193
3 votes
0 answers
463 views

Subsurface Scattering - Transmittance

I have a question related to SSS and especially transmittance. I've looked at several papers about that topic, most of them from Jorge Jimenez, which are very interesting and, I admit, a bit hard for ...
user avatar
  • 1,043
3 votes
0 answers
239 views

Unusual black squares in transparency effect after wake from sleep

I've encountered unusual black squares in semi transparent textures for a while now, usually in processes that were resumed after the computer woke from sleep. For example I've seen the effect in the ...
user avatar
  • 9,927
3 votes
0 answers
1k views

Geometry Shader and Stream Output with Directx11

I am having trouble trying to send verticies generated in the Geometry Shader to Stream Output. What I am trying to accomplish is to generate verticies from the Geometry Shader and store them to a ...
user avatar
  • 31
2 votes
0 answers
37 views

How to generate a star onto a render texture with spherical warping

How would one proceduraly generate a star in a compute shader that looks like one of thes two at any size needed. Also any way transfer this into a spherical map, would be appreciated. Goal is to ...
user avatar
  • 21
2 votes
0 answers
30 views

Cheap way to soften contactpoint of character with ground

The view of my game is always semi topdown. I'm trying to make the contactpoint between characters and the floorplane more grounded without rendering hundreds of sprites. One thing that I think could ...
user avatar
  • 121
2 votes
0 answers
315 views

How do you find the collision between 3D boxes and 3D QUAD face meshes?

I have an axis aligned bounding boxes for 3D object collision, but I have a complex 3d mesh that's divided into 3d faces so I want to check for bounding boxes and collision with the faces of that ...
user avatar
2 votes
0 answers
117 views

How would I warp a mesh with code?

I recently asked a question about putting a camera at the head of a 3D human model here and it worked out rather well and whatnot, but there is still a problem that bothers me: How would I contort/...
user avatar
2 votes
0 answers
835 views

Quaternion to direction vector - flipping

I've kinda solved this myself by adapting the Camera::setDirection code from OGRE to work for my need: Now I have the following code: ...
user avatar
1 vote
1 answer
83 views

Screen space reflections bug

I try to implement screen space reflections in my graphics engine using ray marching algorithm. After a lot of trying I got this result: https://youtu.be/yzkgpcliBVQ As you can see, the reflections ...
user avatar
1 vote
0 answers
85 views

How to implement texture slicing

I'm making a simple game in C# and i'm trying to slice my UI images into 9 smaller rectangles, so the image doesn't get stretched when drawing to different resolutions, but i'm having lots of problems ...
user avatar
  • 51
1 vote
0 answers
49 views

Synchronizing transformation of a Rect class between CPU and GPU

I implemented a Rect class in my custom game engine that utilizes openGL. I decided to approach the whole Rect class design like ...
user avatar
1 vote
0 answers
110 views

Which algorithms to use for drawing procedural paint splatters?

I want to create procedural paint splatters on textures. I want somewhat similar effect like in Splatoon 2. I think I need to modify albedo image - drawing splatters there. Right now I came up with ...
user avatar
  • 145
1 vote
1 answer
129 views

OpenGL height map accuracy for planetary rendering

I am trying to implement planetary rendering and I am trying to use OpenGL tessellation to model the terrain. Here is an overview picture using cube faces projected onto a sphere: If I use the ...
user avatar
  • 125
1 vote
0 answers
32 views

Unreasonable CPU consumption for server build with nographics

I have built my game in server mode on Mac OS and attached profiler to it. In profiler I can see unreasonable high cpu load. Other scripts take a lot of cpu time. How can this be optimized? Vsync ...
user avatar
1 vote
1 answer
45 views

Find point along x axis where yz plane flips to back facing after perspective projection. Have a solution but don't know why it works

I am trying to find the point along the x axis where a plane with normal pointing along the x axis would flip to back facing after perspective projection. Essentially the red line in this image. My ...
user avatar
1 vote
0 answers
141 views

Line of sight shader

Strategy games (such as Door Kickers) use a player's unit's line-of-sight as a major game feature. To provide feedback to the player regarding which areas are in view and which are not, different ...
user avatar
  • 111
1 vote
0 answers
57 views

GLSL link fails with C9999 (too many buffer declarations?)

I'm receiving a C9999 (*** exception during compilation ***) linker error for an OpenGl 4.6 compute shader. It seems to be related to the number of SSBOs I have declared (14 separate declarations), ...
user avatar
  • 11
1 vote
1 answer
111 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 ...
user avatar
  • 11
1 vote
1 answer
735 views

How can I render a font in C with OpenGL?

What I tried: I was testing some things in order to render text with stb_truetype.h and OpenGL in C. I took as a reference the example that appears here. Basically, this example, loads a .ttf file and ...
user avatar
1 vote
0 answers
215 views

How to decide sprite size for isometric tile textures?

When I draw these textures on screen, I put them in a sprite and specify a width and height to draw the sprites in like this: ...
user avatar
  • 217
1 vote
0 answers
28 views

Why does BorderLayout crop out JSlider on JFrame

I have some working code with a small circle randomly appearing around a large circle in the middle, kinda like planets. I have implemented a JSlider that controls the speed of the small ball moving ...
user avatar
1 vote
0 answers
881 views

Post processing effects not visible on mobile apk build

While setting up post processing on a project that I am currently working on, I discovered that post processing effects are not visible on the apk build on mobile. I setup a new Project with URP on ...
user avatar
1 vote
0 answers
164 views

Draw coloured transparent polygons on top of texture in modern opengl

I am trying to render an image in the viewPort using symmetry_create = 1 and binding texture to it. ...
user avatar
1 vote
0 answers
858 views

Is it possible to crop a render texture in unity?

Basically what I want to do is, take the source render texture from OnRenderImage and crop it (continuously). I've already achieved this by using ...
user avatar
1 vote
0 answers
77 views

Wave interference like render effect

(Someone on gaming told me to better post this here.) So in a lot of games lately I've seen this weird "light interference effect" where objects on the edges of my screen become red and blue blurry. ...
user avatar
1 vote
0 answers
96 views

images loaded onto texture appear completely white

I am applying a texture to a primitive plane using ARKit and Unity like so, ...
user avatar
  • 163
1 vote
0 answers
104 views

What is a good way to load and provide graphics to classes and subclasses in monogame?

First of all: I'm not sure if my question is worded well, I just can't think of any better way. I'm also a beginner both at Monogame and programming in general, so my question might miss the actual ...
user avatar
  • 11
1 vote
0 answers
40 views

Tiled: handling multiple map sizes

I have two sets of assets (lo res and hi res) that are exact replicas of each other except one set is twice the size of the other and used for larger screens. At runtime, I find the users screen size, ...
user avatar
  • 111
1 vote
0 answers
113 views

How to reduce weird polygon artifacts?

I wrote an application that takes an obj file, parses all the vertices, UV coordinates and normals, loads them into an OpenGL VBO and presents the model on screen. It works, but I'm getting annoying ...
user avatar
1 vote
0 answers
91 views

How to mitigate this strange pattern shown in Phong lighting?

I am creating an entire lighting scene in OpenGL. The entire scene consist of only one point light. I noticed some strange z-fighting like pattern. This flickers when I move the camera. Can anyone ...
user avatar
  • 111
1 vote
0 answers
598 views

How to fit a bitmap to a random size rect so it does not strech? (Android Studio)

I'm trying to fit a bitmap to a random size rect but I don't want the bitmap to be streched out. I've tried using BitmapShader and tile it but it become animated and not fixed. Here is my code ...
user avatar
1 vote
0 answers
1k views

How does Unity's QualitySettings.masterTextureLimit work?

I'm trying to get to the bottom of how masterTextureLimit works, but my results have been inconsistent so far. I created a massive sprite (8192x8192), and I'd like to resize it at runtime to save ...
user avatar
  • 331
1 vote
0 answers
182 views

PIXI v4 - Is possible to disable Multi Texture Batching in PIXI v4 ?

I would like to know if is possible to disable the multi texture batching in a PIXI V4 game. Recently i jus update my game PIXI lib from version 3 to 4.2. I`m using cocoon Canvas + . It seems ...
user avatar
1 vote
0 answers
145 views

Rotating an Object Around an Axis

I have a circular shape object, which I want to rotate like a fan along it's own axis. I can change the rotation in any direction i.e. dx, dy, dz using my transformation matrix. The following it's ...
user avatar
  • 131
1 vote
0 answers
246 views

Advice on mapping tiles to a height map/3D world

I've been attempting to think of a way to map tiles to a height map. Where a grid can be either layered or integrated into the world data. However, since I am not using voxels I could use some advice ...
user avatar
  • 11
1 vote
0 answers
122 views

Having problems drawing entities the right way in my isometric game

I am making an isometric game where I have moving Entities's not bound to tiles, and a 3d ArrayList map which is populated by <...
user avatar
  • 141
1 vote
0 answers
34 views

Multi Sampling in Rendering Pipeline?

I am trying to understand : How does multi-sampling rasterization effects pixel shader output? In a nutshell (i am skipping some steps to stay on point of question): Vertex data is fetched. Vertex ...
user avatar
1 vote
0 answers
61 views

Concerns about using a 3D tileset grid

I'm thinking of implementing a 3D tile system for my engine, and tie it to it's world streaming system as well. As in, using it for it's terrain for an open world in an engine that theoretically can ...
user avatar
1 vote
0 answers
80 views

How to create words as objects in Unity?

I am working on a game that has words as obstacles, i.e. the player needs to climb over and around them. There will be hundreds of words in the game therefore I need a way to automate the placement. I ...
user avatar
1 vote
0 answers
51 views

Matrix stack from direction vector chain

I've implemented an IK system for a grabber arm based on several straight segments, starting from a fixed point. The IK is based on a mass-spring simulation, which eventually rests. What I'm left with ...
user avatar
  • 111
1 vote
0 answers
2k views

Implement Candy Crush like level graph

I want to implement road-map like level graph where in you can see what level are you and your friends are on. Just like we see in Candy Crush Saga.For people who have not seen Candy Crush Saga, ...
user avatar
1 vote
0 answers
63 views

Directional light view frustum stabilisation

Calculating directional light view frustum based on scene objects(bounding frustum) results in noticeable scene jittering on camera movement in CSM and non-CSM rendering code paths. What are the ...
user avatar
  • 121
1 vote
0 answers
135 views

convert 2d pt into non-affine coordinate system

Say I have a coordinate system that goes from (0,0) to (1,1). We'll call this screen_space. ...
user avatar
  • 282