Questions tagged [graphics-programming]

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

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

Difference between shader input element classification between D3D12 and Vulkan

I'm confused about the difference between the shader input element classifications in D3D12 and Vulkan. For example, in Vulkan I could have the following declarations: ...
0
votes
1answer
51 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 ...
0
votes
0answers
24 views

OpenGL : std140 alignment and uint64_t arrays

I have a problem but I can't figure out what is happenning (I think that there is an alignment problem...), so in my OpenGL application I use bindless textures which handles are sent to the shader via ...
5
votes
3answers
691 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 ...
0
votes
1answer
19 views

Drawing multiple simulation ticks in a single render frame

I have a 2D fixed-timestep simulation (a bunch of moving sprites) that ticks several times per render frame. I would like to render the state of each tick, so that all the ticks between render frames ...
1
vote
0answers
23 views

How to get world coordinates from a 4X4 camera matrix

I have Intel T265 camera which has a camera coordinates system like following diagram: The camera system has two cameras and the center of the two cameras is the position of the camera system. The ...
0
votes
3answers
222 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 ...
1
vote
1answer
202 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
191 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
111 views

Unity: Alpha and color issues with opaque projector/decal shader

I have been attempting to make a simple "overwrite" version of Unity's projector shader. I can either respect the color, or respect the transparency, but not both. I have simplified the ...
0
votes
1answer
152 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: ...
0
votes
1answer
109 views

Opengl in 500 lines barycentric calculation question

https://github.com/ssloy/tinyrenderer/wiki/Lesson-2-Triangle-rasterization-and-back-face-culling I cannot figure out how we go from uAB-vector + vAC-vector + PA-vector = 0 to the linear system with ...
0
votes
1answer
40 views

How to construct a matrix with the following mapping

How would I create a matrix that maps coordinates like so: Near plane x: [-3,3] -> [-1,1] y: [-6,2] -> [-1,1] z: 2 -> -1 Far plane ...
2
votes
0answers
2k views

Dual Contouring - what is it and how to use it?

I'm having trouble understanding Dual Contouring yet and I need some explanations from someone who has first hand experience. I searched all I could before writing this question. I've already read: ...
0
votes
0answers
27 views

How many texture units are available per shader stage when compared to the total number available on hardware?

The answer to the question How many textures can usually I bind at once?, given here, explains that: OpenGL 3.x defines the minimum number for the per-stage limit to be 16... and that there can be a ...
0
votes
1answer
3k views

How to load in meshes efficiently into DirectX11

I wanted to know if there was a standard and efficient method to load meshes from a file into DirectX11. Currently, I'm loading .obj's by parsing them in and storing their information into a vertex ...
3
votes
1answer
332 views

What is GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS?

I am a beginner in OpenGL. I am learning about textures in OpenGL. What I don't understand is how to determine how many texture units are in the GPU. I heard someone said that you can see how many ...
2
votes
0answers
12 views

How to make use of resizable BAR?

From what I understand, resizable BAR (aka. Smart Access Memory) makes it possible to access the whole GPU memory from CPU code. But how can a programmer make use of that? Is there an example or code ...
1
vote
1answer
88 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 ...
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
0answers
41 views

What does glBlendFunc(GL_DST_COLOR, GL_ZERO); mean?

I need to write a description about a filter method I made but I don't know what glBlendFunc(GL_DST_COLOR, GL_ZERO); means.
0
votes
2answers
88 views

Generate vertices of a sphere by using spherical coordinates

I'm trying to generate points for a sphere by subdividing the space of spherical coordinate in res sector and res slices. At first I did my own implementation, but it wasn't working. After a while I ...
-1
votes
1answer
55 views

Why are vertices coordinates are always between -1 and 1 in 3D Models

I'm writing my very first 3D rendering engine in C++ using SDL2, and I've been following this book that has multiple code examples that has 3D models with vertices that all have coordinates between -1 ...
0
votes
0answers
179 views

Supporting multiple graphics apis

I would like to provide support for switching between both OpenGL and Vulkan in my game (and potentially DX12 later). Currently I only know OpenGL so I am working on that. I have read a lot of posts ...
1
vote
1answer
5k views

Insert 3d text to the front face of a cube GameObject

I want to add a text to a cube in Unity. I have a cube which has a 3d text as a child. I am using the below UnityScript to write on the 3d text: ...
0
votes
1answer
103 views

Get black bars with framebuffer and glViewport

I have read several tutorials and answers regarding framebuffers and glViewport, but I can't seem to resolve this issue I have. I want to take a low resolution framebuffer (400x225) and place it in a ...
1
vote
1answer
81 views

Opengl in 500 lines point in triangle question

https://github.com/ssloy/tinyrenderer/wiki/Lesson-2-Triangle-rasterization-and-back-face-culling I am on lesson 2 of the "Opengl in 500 lines" tutorial. I ...
-1
votes
1answer
128 views

What is the best way to approach a multi pass rendering system?

I am trying to code a new feature in my engine but I can't find a way to implement my idea, which is the next one. I am trying to get multi pass rendering with more than two passes. I know how to do a ...
1
vote
1answer
59 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... ...
1
vote
1answer
130 views

OpenGL: What to do after running glBufferData?

I am interested in understanding a bit more behind how OpenGL does its memory management and what are some good practices before I start heavily coding and back myself into a corner. The real question ...
0
votes
0answers
132 views

Deferred shading - g-buffer positions, world or view space?

So, i am doing this for the first time. I have a lodded terrain that i would like shade deferred. I have built the g-buffer with positions/normals/albedo/depth and render vertices like I did before ...
0
votes
0answers
27 views

How to animate large and complex sprites with modular parts

I am trying to animate sprites like metal slug bosses. But they can't be animated as regular and squared sprites because the have multiple moving parts at same time. Considering i am talking about ...
0
votes
0answers
31 views

Mathematics should I learn for 2D and 3D game programming/development [duplicate]

What mathematics should I learn to become game programer 2D and 3D. From the very basic for beginner until advance
0
votes
2answers
99 views

How to switch career to game engine/graphics programming [closed]

My whole background is related to enterprise applications but I've been thinking of switching my career path from enterprise/business to something that I feel is more challenging and interesting. One ...
45
votes
1answer
11k views

Why is shadow mapping the standard?

Though I am a programmer by trade, I have barely touched game development at all. I've had this question for some time, and now that I'm looking into game development I thought it would be a good time ...
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 ...
2
votes
2answers
689 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
415 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
133 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
332 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 ...
50
votes
9answers
38k 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
1answer
589 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
97 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
454 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
32 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
87 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
922 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
1answer
140 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
585 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
64 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 ...

1
2 3 4 5
8