Questions tagged [graphics-programming]
Programming related to the visual representation of information on computer screens.
373
questions
0
votes
1answer
14 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
29 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 ...
0
votes
1answer
77 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 ...
2
votes
1answer
79 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 ...
0
votes
1answer
55 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:
...
1
vote
1answer
67 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
34 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 ...
-1
votes
1answer
74 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 ...
0
votes
0answers
11 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
27 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
64 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 ...
2
votes
2answers
458 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 ...
3
votes
1answer
201 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
0answers
52 views
What's the difference between bloom and emission?
In my engine, I've implemented bloom but I also want to implement emission because some models that I have come with an emission map. It sounded to me like something adjacent to bloom but I guess it's ...
0
votes
1answer
62 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
91 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 ...
0
votes
1answer
77 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
0answers
21 views
PBR specular highlight artifact
I am trying to implement pbr and it seems I have an artifact at the specular highlight
This is basically the code
...
0
votes
0answers
37 views
What information should be included in a render command?
I'm writing a 3D renderer for my engine and now that I'm working properly with a scenenode system, I've decided to implement render queues (command lists to some) and render commands. I wanted to know,...
1
vote
1answer
54 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... ...
0
votes
0answers
64 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
227 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
28 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
59 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 ...
1
vote
1answer
66 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
1answer
142 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 ...
0
votes
1answer
115 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
275 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
58 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 ...
2
votes
1answer
209 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
203 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
180 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
237 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
68 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
86 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
168 views
0
votes
2answers
230 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
334 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
150 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
821 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 ...
1
vote
1answer
160 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
160 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
1answer
331 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
253 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
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
231 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
266 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
201 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 ...