Questions tagged [opengl]

OpenGL is a graphics standard and API which targets the desktop and workstation markets. It is designed to be easy to accelerate with dedicated computer hardware, and hence most implementations give greatly improved performance over traditional software rendering. Currently, OpenGL is used for applications like CAD software and computer games. It is also cross-platform. The OpenGL standard is controlled by the Khronos group, which also controls OpenGL ES.

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

How to use assimp textures with openGL/getting a better understanding

I recently learned how to load a model to openGL using assimp, but I am having trouble figuring out how to do lighting calculations on this model. Previously with my own created objects I would set ...
2
votes
0answers
31 views

THREE.ShaderMaterial cannot perform antialiasing

I created a ShaderMaterial to draw a box in three.js using the following key code: ...
22
votes
1answer
4k views

Optimization of rendering of cube world

I have a world made of many cubes (like in Minecraft), they have only color (not texture). I am rendering them using OpenGL 3.3 core profile (GLFW3, GLAD, GLM). I am already have done some ...
0
votes
0answers
52 views

Some maths about camera in 3D

So after finishing a 2d game for my school project, I decided to dive into 3d world by using raylib instead of Unity. Raylib does provide a simple implementation of 3d camera without you doing maths, ...
0
votes
1answer
32 views

Temporary objects in opengl

I want to write a game in which the player shoots projectiles (bullets, etc). Since I don't know how many and when these projectiles will be shot, I wonder how to buffer and render them (and when!). ...
2
votes
2answers
255 views

How do game engines implement multiple rendering platforms?

How do game engines like UE4, Unity, Source, Cry Engine, etc add different rendering library's to their game engines? (Eg. OpenGL, DirectX, Vulkan)
0
votes
1answer
34 views

How to map texture across whole face?

I'm trying to map a texture to a square face in OpenGL 3.2, but the texture gets tiled in the upper right corner. I've tried changing the uv coordinates, vertices and shaders, but nothing seems to ...
0
votes
0answers
21 views

Align object according to camera rotation so it stays fixed

I'm trying to implements a bullet whose orientation aligns with the free movement of my first person camera. I got the following camera code from learnopengl.com: ...
0
votes
0answers
28 views

How to define a weak-perspective camera in openGL?

I know how to define the perspective camera as well as weak-perspective camera in the Math. But how to define a weak-perspective camera () in openGL?
1
vote
0answers
31 views

Can't get world position from reverse Z buffer

I'm using this solution to render using a reversed Z buffer. This looks fine and completely fixes all my z-fighting, but it breaks what I use in shader to derive the world position from the depth for ...
0
votes
2answers
328 views
0
votes
0answers
19 views

OpenGL Terrain Vertex Ordering Prevents Uniform Height Maps

Evening everyone. Working to implement a simple terrain editor and have an issue I haven't been able to resolve. In the attached screenshot you'll see if I raise up a quad in the terrain the slope on ...
5
votes
2answers
1k views

Light Attenuation Formula Derivation

I understand that when sampling the brightness of a given point on the surface, a certain cutoff needs to be taken into consideration. Other words, when the light is further away, the intensity ...
0
votes
0answers
32 views

OpenGL and multithreading in C++, GL_INVALID_OPERATION error. Array object is not active

I have two threads. My main thread handles all the OpenGL calls, and my second thread batches all the data together in std::vector and then passes the data back to the main thread. Absolutely nowhere ...
1
vote
0answers
46 views

Why does the Modelview Matrix in OpenGL not have accurately signed vector values for look vectors?

When I do a GluLookAt(0.0, 500.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0) so that I'm 500 units up on the positive Y axis looking down at the origin with the top vector of the camera pointing toward the ...
0
votes
1answer
25 views

Stretching a tetragonal shape in a texture to a square object

I'd like to write a fragment shader that stretches a tetragonal shape in a texture to a square shaped game object of mine. My problem is best described with a picture, seen below. The shader receives ...
0
votes
1answer
87 views

combine two translation/rotation/scale triplets without matrices

Let t1/2, r1/2 and s1/2 be two sets of transformations. Translations are vec3, rotations are quaternions and scales are vec3. Lets assume that all common operations are defined (overloaded operators ...
0
votes
0answers
20 views

How would I combine FABRIK inverse kinematic results with a skeletal animation?

So, I've been working on a skeletal animation system in OpenGL/C++, and it's actually not coming along too badly. I can play animations, which I do by sending bone transform matrices to my animation ...
0
votes
0answers
40 views

Implementing W-buffering in modern GPU

I was trying to figure out how perspective projection matrix works, and somehow I ended up in this rabbit hole of depth buffer precision. It seems to be some interest in a depth buffer where the ...
2
votes
1answer
102 views

How can I change the camera to work from an Y up system to a Z up

I am following the tutorial from learnopengl.com but it uses a Y-up system, but I would like to change it for a Z up system because I'm more used to it. I tried changing the up vector to be 1.0 on ...
0
votes
0answers
28 views

Vertex skinning, calculating the bone matrices (for bind pose) and then animating them

I am attempting to do HW skinning in Opengl. Please note that I am purposefully doing it in a not-game ready optimized way, because I need this to scale. I wrote the following code to 'apply' the ...
0
votes
1answer
407 views

Create a white background for the texture and then blend using GLSL

I have a transparent png texture and I'd like to create a white background and then blend this on top of that. Is this possible using just GLSL? I can't multiply, add or mix colors because I don't ...
0
votes
0answers
18 views

Draw circle OpenGL 3.3 [duplicate]

How do I draw a perfect/smooth circle using OpenGL 3.3 and GLSL? I can only find old OpenGL tutorials or ones that have a blocky circle. I would also like to be able to resize the circle to become an ...
0
votes
1answer
213 views

Billboard quad in same draw call?

I am currently drawing a isometric world in 3D, meaning the floors and walls are all quads aligned to the original axis in the world and using a rotated orthogonal camera to "distort" the images into ...
13
votes
2answers
8k views

What is the difference between OpenGL 1.x and 2.x?

Is there a good tutorial that shows the difference between OpenGL 1.* and 2.*? It would be very helpful to know which functions I should not be calling (like glBegin(), I assume).
0
votes
1answer
36 views

Understanding buffer swapping in more detail

This is more a theoretical question. This is what I understand regarding buffer swapping and vsync: I - When vsync is off, whenever the developer swap the front/back buffers, the buffer that the GPU ...
0
votes
1answer
87 views

glfwCreateWindow function returning NULL

I am working on creating a game engine using GLFW. To begin, I set up a window class in C++ to test how making a window works. For some reason, when I call the glfwCreateWindow function, it returns ...
0
votes
0answers
84 views

Discarding GLSL fragment values not working with stencil buffer

I am trying to make a system where I can outline sprites, but I can only get it to work correctly when I use a regular-shaped texture. Here is what an outlined regular texture looks like: However, ...
2
votes
1answer
270 views

GLFW shift key not behvaing like other keys

I am using GLFW 3.2.1 Currently I am implementing a camera. For the vertical controls I am using space to go up and shift to go down. For all other keys, pressing the key results in the section of ...
0
votes
0answers
12 views

Graphing 10 sets of Data

I have 10 sets of data saved in arrays. For example A1 = [1,2 ,3], A2 = [5,6,7]...etc. I am using OpenTk GameWindow to plot it as I have a big data set (10million+ per data set). For now I know how to ...
0
votes
0answers
37 views

Skybox textures is black

My skybox is displayed, but does not display the textures that I load from the image. Instead, it shows the transparent color if i set glTexImage2D how ...
1
vote
3answers
1k views

OpenGL Viewport inside of a Viewport

I'm creating a labyrinth in opengl, and I'm trying to create a minimap. For that, I thought of creating a viewport inside of a viewport. I already tried following a tutorial from Lazy Foo, and I can ...
0
votes
0answers
25 views

Libgdx storing rendered frames quickly to use them later

I have implemented a gif-button for my libgdx game that allows the player to store the last few seconds of gameplay as a gif. It works by storing frames in memory, and encoding them into a gif if the ...
1
vote
1answer
48 views

Comparing meshes and reducing duplication of data

I'm writing a class that reads an obj file, indexes each mesh and creates a VAO and GameObject of the appropriate type. I've stumbled on a design issue. Objects of the same name (Tree_A001, Tree_A002) ...
1
vote
2answers
512 views

Drawing outlines around 2D objects OpenGL

I am trying to draw an outline around any arbitrary object using OpenGL and shaders with a different color than the original object, while also retaining compatibility with alpha values <1. I am ...
0
votes
0answers
48 views

C++ OpenGL: Object Components

I've been trying to make a barebones engine/game in VS C++ with OpenGL. So far it's worked well, I've managed to render two green triangles on the screen and can accelerate one using WASD input. ...
2
votes
0answers
62 views

Are there any good techniques for reducing or smoothing stutter after a longer frame?

I've been using SDL2 with OpenGL to play around with some very basic game engine development. I'm running everything on a newer laptop with Linux and Intel integrated graphics. Regardless of whether ...
1
vote
1answer
104 views

Time to render each frame is proportional to the amount of models in the scene

This question is deliberately written in a "High-Level" manor to avoid screeds and screeds of code snippets, hopefully I can get my point across, I am using C++ and OpenGL. I have a game engine, and ...
0
votes
0answers
360 views

How to render in a imGui Window

I am learning OpenGL by glfw3 lib and I am using imgui to make a interesting application. However, I can not render what I want in a imgui window. I searched google and get below link: Render in a ...
0
votes
0answers
35 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,...
5
votes
3answers
8k views

OpenGL additive blending not working as expected

I am trying to achieve additive blending with point sprites. When the sprites overlap, all I get is solid red, when I expect to get a smooth blend from red->yellow->white. My sprite texture has all ...
0
votes
0answers
30 views

How to properly space characters for world-space text?

I'm following this very helpful tutorial to get text rendering. I've even fancied it up by caching all of my fonts to a single bitmap. Fun stuff. However, this tutorial assumes that text is going ...
0
votes
0answers
27 views

Confusion about updating and rendering camera in different threads

So basically my problem is that the camera is stuttering and seems to just completely stop updating when moving. It's not exactly a stutter because the camera slows and and also stops for split ...
0
votes
1answer
21 views

OpenGL stencil pipe

Is there a document describing 2D stencil pipe ? Static, no rotation etc. Something in more details then enable stencil (buffer) write stencil ( mask) to stencil buffer 1st pass write stencil ...
3
votes
3answers
2k views

OpenGL are strips/fans faster for rendering or just data bandwidth

When we send data for drawing we can mark it as TRIANGLE_STRIP or TRIANGLE_FAN to reduce the number of vertices we have to specify. Now, does this actually improve the rendering speed on the graphics ...
0
votes
0answers
59 views

OpenGL obj loader doesn't work

I made my own obj loader,i tried other's obj loader,but nothing works. Here's my obj loader: ...
4
votes
1answer
199 views

How do open world game engines allocate memory?

My troubles I've been trying to create a game engine but since I am not well experienced in C++ I am having trouble deciding on how to load new scenes efficiently level by level or just an open world. ...
1
vote
1answer
67 views

How do I initialise levels sequentially?

I have been learning opengl and I have made good progress over past few months. However I still struggle to understand game logic in C++, I am new to C++ too. Say I have this program. ...
0
votes
1answer
25 views

samplerCube for point light shadow map has dark corners relative to screen aspect ratio / size?

I almost have point light shadows working but the corner of the samplerCube that I use for the shadow map has corners that get darker depending on the main camera. Is this something to do with a ...
0
votes
1answer
66 views

Debug in OpenGL & GLFW (version >= 4.3)

I try enable debug system in OpenGL with helps debug output in OpenGL version >= 4.3. My code: ...

1 2 3
4
5
81