Questions tagged [graphics-programming]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
1k 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
266 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
299 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
219 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
179 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
2k 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 ...
23
votes
1answer
3k 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?
6
votes
2answers
645 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
474 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
1answer
65 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
1k 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
202 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
28 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
1k 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
388 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
44 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
1k 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
336 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
516 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
567 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 ...
5
votes
2answers
4k 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
138 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
396 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
73 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
255 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 <...
1
vote
1answer
592 views

Change transparency of image at runtime, LOVE2D

I would like to know how to take a defined image (e.g. a tile) in the LOVE game engine and draw it with a transparency that may vary per-frame. Stencils seem to only work for completely hiding parts ...
7
votes
4answers
2k views

Why are 3d projections on a 2d screen not like what the human eye sees?

Firstly, I'm sorry if this question doesn't make much sense or is poorly written - I have almost no experience with programming, and none at all with game development. I'm also not sure it's an ...
0
votes
1answer
23 views

OpenGL only utilizing the last initialized sprite's positional data

I'm currently creating a 2d fighting game utilizing OpenGL and I have run into a problem where OpenGL is only drawing at my last initialized sprite position, regardless of how many sprites I ...
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
388 views

How shader program still works even after detaching shader object?

In the following process of shader creation, shader object is detached after linking program (glLinkProgram), how does the shader program still works after detaching and deleting shader objects? ...
0
votes
1answer
1k views

What is the “correct” way to render to a cubemap using Vulkan?

After searching far and wide for the solution to this, the only one I have been able to find that verifiably works is to the render a face to a framebuffer and then use a memcpy to copy that ...
56
votes
7answers
27k views

Why do game studios need graphics programmers if they're using game engines?

In the credits section of the games I play, there are names of graphics programmers. If they used a game engine, why do they need a graphics programmer? Isn't the game engine doing their job?
1
vote
0answers
179 views

How do I deform a texture?

I'm using LibGDX, and I don't know where to start; I would like to deform a texture. Let's say I have a PolygonSprite, and I have vertices and a texture. Image 1 represents what I have. I would like ...
1
vote
2answers
1k views

Playstation 4 OpenGL ES support (or Xbox) [closed]

I know that the Playstation 3 supported at least OpenGL ES 1.0, and the Vita OpenGL ES 2.0. But what about the Playstation 4 (and/or the new PS4 Pro)? Does anyone know for certain if it has native ...
0
votes
1answer
223 views

Why is my transform stretching?

I've read a lot about transformations: model to world space, world to camera space and projection transformationsl but when programming it, I can't get things right. I think I'm missing something, so ...
1
vote
2answers
3k views

2D racetrack collision bounce using angle of reflection (bounce angle)

I am currently working on a race game where I want to define the collision of my vehicle with the outer and inner borders of the track. If that happens to be the case I want to vehicle to bounce of ...
0
votes
2answers
65 views

Java 2D - Cannot get code to work for generating points for a line with a start point and Angle

I am developing a Java 2D video game. I am trying to write code to generate points for a line (actually a projectile path), at a specified angle, from a given start point. There seems to be ...
0
votes
1answer
53 views

Possible Framerate Problem using Pygame?

This is the first game I've ever tried to make using Pygame and I am running into some issues displaying the player character and the enemy characters. I have a "main" game file and other ...
-1
votes
1answer
2k views

How can you procedurally dismember a character model? [duplicate]

For example in the new Doom, you can use a chain saw and slash an enemy apart, the enemy actually splits in half in the path of the chain saw. I know how to do the cheap effects where you store a copy ...
1
vote
1answer
370 views

Second glBindBuffer() call crashes program on Draw call

Background/Issue: I'm pretty new to openGL and I'm trying to create a game engine (for learning purposes) and my program keeps crashing on my glDrawElements() call but only after trying to set ...
0
votes
2answers
491 views

Mining procedural caves in Unity

I am using cellular automata to randomly generate caves in Unity. Attached is a screenshot: The black area represents walls. Walls can contain resources that can be mined. Walls are made of blocks. ...
1
vote
1answer
245 views

What does the alpha channel on a back buffer do?

I see that e.g. in OpenGL it is possible to create a back buffer with an alpha channel (RGBA8888). What's the effect/advantage over having an RGB888 back buffer?
0
votes
1answer
53 views

Trying to subdivide an ISO tile

I have code that calculates where the user clicked inside an iso tile in an isometric map. The tile has a width of 1 unit and a height of 0.5 units. My code calculates where they touched inside the ...
1
vote
2answers
1k views

How do I create my own GPU accelerated graphics API in C#?

I am creating 2D game engine in C# and I need some graphic API, so that user can draw sprites or convex vector shapes. I tried to use GDI+ for it. But I discovered that GDI+ is not GPU accelerated and ...
0
votes
1answer
242 views

Artifacts when trying to implement Cook-Torrance BRDF

I am trying to implement the Cook-Torrance BRDF within OpenGL, but I keep running into issues. The most obvious one are black patches and a bright spot at (0, 0). I checked my shader multiple times, ...
5
votes
1answer
647 views

How could I render a star like those in Elite Dangerous - coronas and some sort of 3D “plasma” effect on the surface?

Lets assume I wish to render a large, 3D, star object in a game engine using OpenGL. I can use a few different meshing methods: this includes mapping a cube to a sphere (with better subdivision to ...
0
votes
0answers
2k views

How to use Graphics.DrawProcedural to render a quad over a scene?

I want to learn this so I could do some screen space particles in Unity. This is meant as a sort of "hello world" shader. my current script is: ...
3
votes
2answers
524 views

How can I make a “paint” effect?

I am wondering how one could implement "paint" in games. As a reference, I have two games I am specifically thinking about which are Super Mario Sunshine with its "goo" and Splatoon. I'm wondering ...
12
votes
1answer
2k views

Shader to see silhouette through alpha blended sprites

I want to achieve in Unity a see through effect like the one in these examples: In my specific scenario there are a couple of requirements: Sprites are using alpha blending, and sprites have ...

1
2
3 4 5
8