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
0answers
18 views

Stencil not working processing

With jogamp I can create the following stencil: ...
1
vote
1answer
118 views

PyBullet & OpenGL - Rotations are reversed in OpenGL [closed]

Project description: I am writing a basic game engine to help with my PhD topic on multi-agent learning. I am using PyBullet as the backend physics engine and OpenGL for visual display. I have OpenGL ...
2
votes
1answer
50 views

No local transform with skinned mesh with assimp?

I'm trying to add skeletal animation to my engine and I'm importing meshes with assimp, but I think I misunderstood the skinned mesh concepts (or don't understand assimp). When I import a model, ...
4
votes
2answers
233 views

GLSL: How can I optimize this lighting (fragment) shader? Basic 2D game, 30+ light sources cause significant frame loss

I am using a fragment shader to create circular light sources in my 2D game. Full code at the bottom. Essentially, an array of light source objects (called Lights in the code) are passed into the ...
0
votes
1answer
69 views

Parts of OpenGL rendering area missing/transparent until resize

I am having a weird transparency issue when running my game in windowed mode. Parts of the window, left and top parts in normal window mode, right and bottom when in maximised window, become ...
1
vote
0answers
65 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://...
2
votes
0answers
42 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 ...
1
vote
1answer
167 views

OpenGL texture2d/image sampling issue. Strange artifacts in texture

I have an issue when using textures in OpenGL, strange artifacts occur where geometry overlaps, but not always. Video Reference. I am using a GL_TEXTURE_2D with <...
1
vote
1answer
247 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 ...
1
vote
0answers
76 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 ...
4
votes
1answer
94 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
37 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
199 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 ...
0
votes
0answers
30 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
72 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
1answer
96 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 ...
1
vote
2answers
326 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 ...
1
vote
0answers
118 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. ...
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
0answers
39 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 ...
0
votes
1answer
166 views

How do I calculate the bounding box for an ortho matrix for Cascaded shadow mapping?

I've been trying to get a cascaded shadow mapping system implemented on my engine, though it appears to be that the bounding boxes for the cascades aren't correct. The part I'm interested in can be ...
2
votes
1answer
287 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,...
3
votes
0answers
51 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
67 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
161 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
205 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 ...
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 ...
0
votes
0answers
29 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
16 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
95 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
30 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
37 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
87 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 ...
-1
votes
1answer
105 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
80 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
114 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
86 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
50 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
97 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
37 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
117 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
3answers
154 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
73 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
37 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
26 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
108 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
33 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 2
3
4 5
82