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
1
vote
2answers
71 views

Parts of 3D model disappear during animation

I'm trying to properly play an animation done in Blender 2.8 inside my OpenGL application. When the animation is running, it happens that at some particular frames, some parts of the 3D model "...
1
vote
1answer
864 views

Rotate camera around its center in 2D

I'm currently trying to develop my own little game engine (trying to understand maths in games). I have implemented 4x4 matrices and 2d vectors (I don't need 3d since I'm aiming at orthographic ...
3
votes
2answers
2k views

What does glMultiDraw* do?

I'm having trouble understanding exactly what glMultiDraw* does, and when it should be used. Is it to be used if I have one VBO with multiple objects in it or do I use it with many VBO's? It would ...
0
votes
1answer
419 views

Rendering to framebuffer / multiple rendering in a frame makes geometry black

I'm trying to adapt the shadow-mapping process given on this microbasic guide into my game, it's made with LibGDX. I've run into a blocking point with the creation of the shadow buffer via rendering ...
6
votes
2answers
314 views

How to generate a multiplier map for radiosity

I am following this tutorial: here I am at the part where you are creating a hemicube. I have got the code to render the scene into a texture and therfore an array. Now how can I generate a so-called ...
0
votes
1answer
156 views

Render to cubemap wrong Y values

I'm currently trying to render to a cubemap in order to blur it. However the top and bottom faces appear much closer than they should be in the blurred version. I thought the problem came from my ...
1
vote
0answers
61 views

Wireframe shader sometimes won't render parts depending on camera rotation

I'm trying to make a stylized wireframe shader for a game using this method, but it seems to be conflicting with my character controller. Here's some images to better show what's going on: https://...
1
vote
2answers
593 views

Proper way to update pixel array data

For a game that updates a board every frame I am calculating the next arrangement of board, updating pixel array data and render board as 2D texture to quad the size of the screen using OpenGL. I use:...
0
votes
1answer
134 views

OpenGL Strange mesh when animating Assimp

I'm trying to animate a skeletal mesh. The mesh loads with no problems and everything is set up correctly. My problem is that when I calculate the matrix for a given keyframe the mesh goes nuts. Here ...
0
votes
1answer
375 views

NiftyGUI - Text isn't rendering

I am trying to create a gui with nifty on top of lwjgl. I've already had some problems during the Nifty setup, however now Nifty is set up and running correctly but for text rendering. Here is my xml ...
1
vote
0answers
37 views

Deforming a lip mesh to match face-tracking points

I'm creating a lipstick filter. I have a basic mesh for the lip shape ( 140 vertices ) which I am able to render on screen. I need the mesh since I have my own lighting system, and hence need the ...
0
votes
1answer
125 views

Orbital rotation equation

I am developing a space sandbox (3D). Now I am working on an asteroid belt around a planet. I have an Asteroid class and an ...
1
vote
1answer
692 views

OpenGL Water reflection seems to follow camera yaw and pitch

I'm attempting to add reflective water to my procedural terrain. I've got it to a point which seems like it's reflecting however when I move the camera left/right/up/down the reflections move with it. ...
1
vote
1answer
122 views

How front-to-back blending works?

I would like to implement dual depth peeling in my engine. I read the original paper and examined the corresponding source code. I understand the algorithm, except how the blending works, especially ...
39
votes
6answers
27k views

Why do we use 4x4 matrices to transform things in 3D?

To translate a vector by 10 unit in the X direction, why do we have to use a matrix? We can just add 10 to the mat[0][0], and we got the same result too.
5
votes
2answers
9k views

How can I render an OpenGL scene into an ImGui window?

The picture rapresents what i want to achieve. I read, somewhere on the Internet, that you can render the fbo and pass that fbo as a texture to render into the ImGui window. The problem is that I don'...
4
votes
1answer
91 views

Data structure for collecting entities for instanced rendering

My game, a citybuilder, has many simple entities that rendered via glDrawArraysInstanced. A large city has over 600,000 entities, but most of those entities are one of a few hundred meshes. Every ...
1
vote
0answers
65 views

Transform the mouse coordinates to the GLSL plane

I am creating a 2D map editor in C ++ with GLFW. I want move and drag entities with the mouse, but I have a problem, the mouse coords are in the window size range (1200, 720) and the entity is in the ...
1
vote
1answer
191 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
vote
0answers
31 views

C# OpenGL: How to translate a triangle

I am trying to translate/move a triangle 0.3 to the right. When I run the code below, it moves the triangle, but part of it is cut off, like it is in a set box (shown in images below). Code to move ...
1
vote
1answer
133 views

Why is my OpenGL triangle not drawing on the screen?

I am currently following this tutorial to create a simple game engine, but I am doing it using SDL and C++. I am stumped, however, because I can't get a triangle to draw on the screen, and I'm getting ...
1
vote
1answer
88 views

Trouble generating a depth map (black screen)

I am having trouble generating a depth map for my scene. I tried to figure out this issue a 2 weeks ago and got nowhere after days of trying to fix it, so I took a break and tried to tackle it again ...
0
votes
0answers
29 views

How to modify this old pre-3.0 OpenGL code to modern OpenGL?

I've done the getting started section on learnopengl website. However, that means I don't understand the old way of doing things, so I am struggling to understand some code I want to take a look at to ...
-1
votes
2answers
70 views

How to load 3D modells when they are necessary

I'm working on a 3D game engine, currently I load ALL of my 3D modells into the memory when my game starts, but obviusly there will be hundreds of 3D modells, so somehow I should unload them when they ...
1
vote
2answers
210 views

3D Camera Rotation (Unwanted Roll) - Space/Flight Cam

I am working on a camera class that will have full range of motion (pitch, yaw, and roll). When only altering pitch and yaw, I am getting a large amount of roll. I understand that the issue is ...
5
votes
0answers
566 views

Draw Edges in OpenGL

I use blender game engine and blender uses OpenGL for graphics. How can I draw lines around all 3D objects? Would this be a job for a filter? Mainly, I want my end result to look drawn. I found this: <...
-1
votes
1answer
72 views

How do I debug OpenGL apps written in python?

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.
0
votes
1answer
98 views

VAO not showing

My VAO is simply not showing up and i'm not sure if my matrices are wrong or if the shader is wrong… Please have a look a see what is wrong… My code is big so i'll post the essential. ...
1
vote
0answers
65 views

How to use continious collision detection in a dynamic AABB tree

I am currently writing a game in c++ using openGL, and I am currently using a kinetic sweep and prune algorithm for the broad phase and then using GJK Raycast + GJK & EPA for the narrow phase. ...
2
votes
1answer
169 views

OpenGL - Multiple Render Target - write only to some targets, discard others

In OpenGL, is it possible to achieve behaviour like this: out float out1 out vec4 out2; //..... out1 = /* write some value */ out2 = /* discard */ My output ...
0
votes
0answers
22 views

Can frame buffer objects in openGL ES have different kinds of attachments?

This question is with regards to the QT openGL app presented in this repository https://github.com/PRBonn/semantic_suma I am trying to run this application on NVIDIA AGX Xavier, however, I am getting ...
0
votes
1answer
167 views

Running OpenGL app on Windows XP x86 produces incorrect texture colors

I'm working with the Cen64 emulator and I compiled from source a x86 version that operates fine on Windows 10 x64. As soon as I run it on a Windows XP x86 machine the colors are then all incorrect. ...
0
votes
0answers
29 views

How can I efficiently render a tile-based map with many Z-levels, where the levels act like hollowed out voxels?

My map setup is a little different to what you normally have with tilemaps. The map itself is a rectangular prism, with a width, height, and depth being variable. In my case, width is the x-axis ...
2
votes
1answer
123 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
2answers
2k views

OpenGL shows a black screen

I am new at OpenGL, I try this example: https://stackoverflow.com/a/31524956/4564882 but I get only a black widget. The code is exactly the same. this is the code associated to the QopenGLWidget: <...
4
votes
1answer
4k 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 ...
7
votes
1answer
3k views

Depth Peeling implementation problem: How to render the next layer? (OpenGL)

I try to implement order-independet transparency sticking to the pseudo code in the linked paper (page 4). I can't figure out how they are able to do this in OpenGL. I am rendering the scene two ...
3
votes
0answers
48 views

Help in understanding atmospheric scattering shading

I have a made a planet and wanted to make an atmosphere around it. So I was referring to this site: Click to visit site I don't understand this: As with the lookup table proposed in Nishita et al. ...
0
votes
0answers
40 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
71 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
94 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 ...
0
votes
0answers
22 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
15 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, ...
2
votes
2answers
11k views

Getting error GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT

I am getting error code GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT when creating framebuffer on Mac (using glCheckFramebufferStatus). I am using same code for rendering on Mac and iOS both. Maybe problem ...
0
votes
0answers
60 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 ...
9
votes
1answer
15k views

3D Camera Rotation

Please, forgive me, but I need help and I've been stuck on this for a few weeks now, I'm making no progress and everywhere I go and I see a different answer, everything I try doesn't work. I've had ...
0
votes
1answer
28 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 ...
1
vote
1answer
74 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
0answers
27 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: ...
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 ...

1 2
3
4 5
81