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
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
83 views

OpenGL color attachments don't work

Trying to implement GBuffer. Only gAlbedoSpec color attachment (GL_COLOR_ATTACHMENT2) works properly. When i try to use another texture (gPosition or gNormal) in ...
0
votes
0answers
17 views

Drawing a group of objects of different scale in one scene

let's say I'm making a space simulator game. The game has big objects like planets, moons, etc. and small objects like spaceships, meteorites, etc. My problem is which scale I should use to represent ...
0
votes
0answers
72 views

Is making an acceptable 3D engine possible using only SDL_* functions?

I've been watching Javidx9's 3D engine series and I decided to start making it with SDL because it was something I had heard of and seemed simple enough. I'm not going to implement too complex ...
1
vote
0answers
43 views

Techniques for cursor snap-to-vertex in WebGL or OpenGL?

What's a technique for snapping the mouse pointer to vertices in WebGL or OpenGL? All I need is the vertex position, no other info. Ideally, I'd like to do this without needing to keep positions and ...
0
votes
0answers
13 views

Question about model loading and textures

I recently learned how to load models with assimp, but I'm confused about something. Assimp loads normal and height vertices, but you can also load height and normal textures. So far, I've done shader ...
0
votes
0answers
75 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!). ...
0
votes
1answer
74 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 ...
0
votes
1answer
90 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 ...
23
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 ...
2
votes
0answers
40 views

THREE.ShaderMaterial cannot perform antialiasing

I created a ShaderMaterial to draw a box in three.js using the following key code: ...
0
votes
1answer
36 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
1answer
70 views

when to unbind vao in drawing loops

I am very new to open gl and am struggling to understand relation between vaos vbos and ibos like how is currently bound vao related to currently bound ibo? now i am trying to render 4 triangles with ...
0
votes
0answers
29 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
35 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
0answers
21 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 ...
0
votes
0answers
42 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 ...
0
votes
1answer
26 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 ...
1
vote
0answers
48 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
0answers
35 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
49 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 ...
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 ...
2
votes
1answer
178 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
21 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
152 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
1answer
37 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
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
40 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 ...
0
votes
0answers
28 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 ...
0
votes
0answers
118 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, ...
0
votes
0answers
68 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
65 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
2answers
775 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
1answer
544 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 ...
1
vote
1answer
305 views

ECS as part of the rendering pipeline of an engine

I'm trying to integrate ECS design into my game engine. Currently I'm trying to mimic the components of unity (although not pure ECS) with MeshFilter (holds ...
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,...
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
30 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
82 views

How to correctly reset vertex attributes after modification

I am trying to use the same vertex shader for two different use cases to preserve memory, but I am having issues where the modifications of one shader run are passed on to the next run, even after ...
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 ...
5
votes
1answer
266 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. ...
0
votes
0answers
61 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: ...
1
vote
1answer
69 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
98 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: ...
0
votes
1answer
35 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
0answers
110 views

Help with Minecraft-like AABB-AABB collision detection and resolution

I am currently working on a Minecraft like game with OpenGL and C++. I've gotten as far as abstracting a Camera object and setting up movement and even defining basic gravity like simulations, but I ...
0
votes
0answers
179 views

Terrain deformation via mouse in real time using OpenGL

The main problem I’m facing is how I can, given a spot on a terrain mesh (x and z coordinates) change the mesh so that the surrounding points also change height but will be less affected. What’s ...
0
votes
1answer
122 views

How to set the value of each index in a uniform array

I am currently implementing "instancing" into my game engine to allow the drawing of 1000 tree models following the tutorial found here: https://learnopengl.com/Advanced-OpenGL/Instancing. I have ...

1 2
3
4 5
82