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

2D Tile based game Texture Atlas combining

I am new to OpenGL and game dev, I have been to courses and trying to learing everything about this. My task is to implement a Texture Atlas in a 2D tile based game (very similar to Tibia) using ...
0
votes
0answers
30 views

Can I set the unity camera to have the same position in a real world?

I have a problem about setting the camera in the unity to have the same extrinsic parameters as my real world camera to the origin. So let's me describe my problem step by step. I have a camera in a ...
2
votes
0answers
100 views

How can I achieve simulated fluid surface deformation in a bottle?

I'd like to mimic this effect seen in Half Life: Alyx: I can't figure out what is going on here, people say "it is just a shader effect it isn't simulating anything", but I don't think that is true ...
0
votes
0answers
16 views

RayCasting implementation not working with camera rotations

I've followed several guides for a custom implementation of a raycasting algorithm for picking objects in my opengl application. This is my unproject function ...
0
votes
1answer
13 views

(While using a cube map) box-like textures appearing around my scene whenever I move the camera

I've been learning about cube map and I implemented one into my program. It seemed to work well until I started moving the camera around the scene and zooming out. As you can see in the attached gif, ...
0
votes
0answers
43 views

How do I render to a resizable window from a large fixed size back buffer in current graphics APIs?

I have some code that uses DirectX 9 with Windows native window management, that I would like to port to newer graphics APIs, but this code has a fairly unusual approach to window resizing, and it ...
0
votes
1answer
26 views

How to compress repetitive information when uploading mesh data?

I want to avoid sending repetitive information when drawing a mesh. If I use a single point for each face and two vectors as additional attributes that represent the travel of each vertex, I can use ...
0
votes
0answers
19 views

C++ OpenGL Arcball controlls 'flipping direction' after crossing any of the axes

hello graphics developer... I want to implement something like the mouse rotation controls found in 3D modelling software like MeshLab Here is the code in the mouse callback: ...
1
vote
1answer
68 views

Why do I have additional glBindBuffer() calls?

I have a OpenGL2/OpenGLES2 application and it among others renders a sphere using the following pseudocode: Update vertices data on CPU call glBufferSubData(GL_ARRAY_BUFFER, ...) to update them on ...
0
votes
1answer
27 views

Debugging Python OpenGL apps

How do I debug OpenGL apps written in python? I tried but I was unable to use standard tools like nvidia nsight or glsl-debugger or renderDoc on python code. Are there any specialized tools for ...
0
votes
1answer
28 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
42 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
14 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
52 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
18 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
1answer
35 views

Multiple directional lights use cases?

I have been building and designing a hobby-tier game engine and I am currently working on supporting any amount of lights of any type. I checked out Unity and it supports multiple directional lights, ...
0
votes
0answers
10 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
35 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
29 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
27 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
43 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
votes
0answers
25 views

Green textures when adding 2 textures using GLUT

My cube is all green and only uses the bumpID[0] texture instead of texID[0] under bumpID[0]. This is my display func ...
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 ...
2
votes
0answers
16 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
29 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 ...
-2
votes
0answers
13 views

How to add a normal map onto objects using glut and opengl

Right now I am using the freeimage dependency.
0
votes
0answers
19 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
33 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
26 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
28 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
14 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
20 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
23 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
44 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
14 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
31 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
21 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
69 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
17 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
41 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
35 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
11 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
35 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
17 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
47 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
32 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
54 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
195 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
94 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

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 ...

1
2 3 4 5
80