As of May 31, 2023, we have updated our Code of Conduct.

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
1 answer
105 views

OpenGL 4 hidden line removal

I'm having trouble with hidden line removal in OpenGL 4. I use a vertex/geometry/fragment shader to draw the lines. I call glDepthRange(0.01, 1.0); before I draw ...
shawn_halayka's user avatar
0 votes
0 answers
77 views

Gaussian blur only blurs the interior of primitive?

I cannot work out why my blur shader based on this example affects only what's inside the illuminated sphere. Below is the loop I'm using to blur an HDR framebuffer 5 times horizontally and vertically ...
Sina Dasht's user avatar
0 votes
0 answers
56 views

Skeletal Mesh with Assimp and OpenGL

I'm trying to animate a skeletal mesh using opengl and assimp and I'm having trouble understanding what transforms I need to apply for it to work. From what I understand, each vertices have bone ...
Jazzwave06's user avatar
0 votes
0 answers
124 views

C++ Problem With Separating Axis Theorem When Using Rotations

I started writing small game that uses some collision detection. I have been able to implement a working SAT collision detection prototype, but I figured out that it stops working properly, when some ...
xxnoflz's user avatar
0 votes
1 answer
179 views

Is it a good idea to detect collisions in 2D game on different thread?

I am writing simple tiled map based game using LWJGL and Kotlin. I am testing out different collision detection algorithms and avoid using out of box solutions for personal reasons. I figured out that ...
Steyrix's user avatar
  • 191
0 votes
1 answer
54 views

Yaw rotation not translating to Quaternion

I'm trying to implement the gimbal lock fix described in this question, but I end up getting weird behavior where when I rotate on the X axis (or try to at least) it rotates on both the X and Y axis ...
CaptainLupa's user avatar
0 votes
0 answers
42 views

How to calculate angles after subsequent rotations?

I have a class that manipulates a model matrix in opengl: ...
Aziz Hakberdiev's user avatar
0 votes
1 answer
123 views

Efficiently pass one uniform value per polygon or quad to the fragment shader in a single batched draw call in WebGL?

I want to render multiple colored quads, with one solid color per quad, using WebGL 2.0 and Javascript. However, this question is probably generalisable to other OpenGL implementations as well. The ...
Anders's user avatar
  • 243
0 votes
0 answers
50 views

How to allow objects in a list to access the object that owns the list?

I'm trying to make a voxel game while learning about OpenGL. The world is made up of many chunks of voxels. Therefore there is a Chunk class, containing an array of ...
Will Mungas's user avatar
0 votes
1 answer
328 views

How to make a concisely, elegantly, and human-friendly Quaternion camera?

I have spent three weeks struggling with the quaternion camera! Now I have two Implementations. One has some kind of gimbal lock issue or something like that. Another one is totally anti-human ( I ...
potter john's user avatar
2 votes
1 answer
202 views

How can I implement semi-transparent/semi-opaque voxels in a voxel game?

I am creating a voxel game with OpenGL, and I would like to implement water. My voxel world is divided into chunks of 16x256x16 cubes (or voxels). Each chunk has its own VAO with two VBOs, the first ...
Vincent's user avatar
  • 41
0 votes
0 answers
77 views

Rotate game object to the mouse pointer

I am making a game from scratch using OpenGl and GLFW. Since my motivation is to learn computer graphics, I am using my own explicit math functions for rotation and translation. My current rotation ...
Anmol Chauhan's user avatar
0 votes
0 answers
145 views

Setting glOrtho and glViewport so top-left of window has coordinates (0,0)

I haven't used OpenGL for a long time and have trouble setting up a 2D screen where the upper left window coordinates are (0,0) and the width and height of the ...
stuv_2028's user avatar
0 votes
0 answers
63 views

Should Uniform Buffer size be set very large to accommodate shaders with different numbers of parameters?

When using uniform buffers should you set the size of the buffer to really large to be able to use different types of shaders with different number of parameters. for example lets say i have a ...
ResidentD1022's user avatar
0 votes
0 answers
81 views

FPS Counter not printing out into the console

So I've been trying to make a FPS counter for my custom game engine, but I can't seem to get the game loop to run the FPS counter. I even tried to debug the code, but it keeps saying like "input....
Mohammed Alamairy's user avatar
0 votes
1 answer
90 views

Why won't my legs rotate at the top instead of the centre

As the title suggests, I'm battling with getting the legs of my model here to rotate properly. They rotate in the middle instead of at the top where the knee joint would be. So far I've tried ...
Fenrir Gaming's user avatar
0 votes
1 answer
113 views

r/l/b/t parameters in orthographic projection?

I am trying to implement following: What are the l r b t units? I understood that r-l= is just ...
dgan's user avatar
  • 131
0 votes
1 answer
106 views

What would be a good approach to create an abstraction for a game object without textures?

I am practically pretty new to OpenGL development and right now doing some research in Java with LWJGL. But it's really not a question about Java or C++ (GLFW, etc.). It is about OpenGL > 3 api. ...
Edgar Alloro's user avatar
0 votes
1 answer
64 views

Some objects only rendering half of the screen in snake game

I'm trying to make a basic snake game with OpenGL. I hold all the game object locations in a matrix called MAP. And when i render them, i operate the location info ...
anbvy's user avatar
  • 5
0 votes
1 answer
158 views

How to I modify a texture in OpenGL?

I am programming the editor for a RTS game and I have created the following: I am trying to modify the terrain so that it is not completely grassy. I am intending to add functionality so that I can ...
rjhwinner03's user avatar
0 votes
0 answers
48 views

match GLTF/assimp/unreal material terms to my shader

I'm trying to render a simple scene I exported from unreal engine. I exported it as gltf, and it appears ok in blender and windows preview. but while loading this model in my code, I have no idea how ...
Joao Pincho's user avatar
0 votes
0 answers
108 views

OpenTK mouse picking not working

I am creating a game using OpenGL and need a lobby for which I am developing with WPF, C# and OpenTK. For the lobby I need mouse picking functionality on the 3D objects and although there are many ...
Mike F's user avatar
  • 143
0 votes
2 answers
126 views

Handling pipeline objects in both DX12 and Vulkan like graphics APIs

I have been using OpenGL and Directx11 extensively for my engine. The thing is, when I wanted to support DX12 or Vulkan, I realized that they collect all the state data in one place, removing the ...
Roveldo's user avatar
  • 50
0 votes
1 answer
77 views

Wrong results in Fragment shader when using clamped value

I'm following a tutorial and I want to clamp all position values of a triangle between 0 and 1 then output them as a color this is the code for my vertex shader: ...
ViperTheGuy's user avatar
0 votes
1 answer
92 views

Is it possible to have shared data between shaders in GLSL that is loaded once?

For my game engine, I would like to be able to load all of the matrices (i.e. mvp, model, etc.) once per frame to save a bit of time, and have a set of uniforms that any shader can access by using ...
hoZer's user avatar
  • 1
0 votes
0 answers
262 views

How can I render a texture in a specific x/y position on the screen? (OpenGL - glium)

I am in the process of writing a 2D game in Rust, and decided to use glium for the graphics part. So far I'm doing fine, able to render textures and shapes ...
AndroGR's user avatar
0 votes
0 answers
291 views

ImGui Rendering Text Atlas instead of Framebuffer color texture

My application looks like this: I am using Dear ImGui for UI and wish to draw the frame buffer contents into a texture and then display that texture in an ImGui Window. I have followed the official ...
Mitch War's user avatar
1 vote
1 answer
407 views

How is the GLM '*' operator on quaternion and vec3 defined?

Using the definition of quaternion rotation given here: So the equivalent code in GLM of the above formula would be like this: ...
peter's user avatar
  • 21
1 vote
1 answer
117 views

How do I modify parts of a texture on a quad?

I am programming a Real Time Strategy game, and I was wondering how I could retexture one part of a terrain quad to change a texture in the position where I click at. For example, if I clicked in the ...
rjhwinner03's user avatar
-1 votes
1 answer
228 views

How to generate terrains in real time?

I am trying to make a terrain editor for my Empire Earth OpenGL clone engine. Are there any articles of how to generate terrains in real time? It would be cool if it had pseudocode, even cooler if it ...
rjhwinner03's user avatar
0 votes
1 answer
116 views

How can I adjust this shader so that my atmospheric scattering works on spheres not positioned at the origin?

I have the following vertex and fragment shaders, adapted from this shader on shadertoy. Vertex: ...
NeomerArcana's user avatar
0 votes
2 answers
127 views

LWJGL With Modern OpenGL

I have a question. I am following ThinMatrix's tutorial on YouTube which is about making a 3d game with lwjgl. He uses OpenGL v3.0 and higher. However, my built-in graphic card supports only OpenGL ...
Yuri's user avatar
  • 3
0 votes
0 answers
100 views

PhysX Skeletal Animation

I am developing a game and using OpenGL for graphics API and NVidia PhysX for the game's physics. Recently I implemented skeletal animation from this site. The objects are read using assimp which ...
Mike F's user avatar
  • 143
0 votes
1 answer
845 views

How to load an FBX animation file in ASSIMP?

I have an example from a LearnOpenGL tutorial which loads the animations. Now, I want to use that to render FBX animation, but the result is totally wrong. What I want is simply to load an FBX ...
Nicholas Jela's user avatar
0 votes
1 answer
79 views

glDrawArrays draws nothing in C. Trying to draw point in openGL(in C), no error but draws nothing

...
Sage.Z's user avatar
  • 1
0 votes
1 answer
163 views

Function glBindBuffer access violation while executing

So I have a problem, I am calling some opengl frame buffer functions in my code but for some reason I get the error from the title. I am also calling many other opengl functions without any problems ...
Žarko Tomičić's user avatar
0 votes
1 answer
102 views

Why would some assets require a transposed TBN matrix?

I'm writing an OpenGL/DX11 Windows/Linux "engine" and I've encountered a confusing behavior in DX, specifically. For math, I'm using GLM, which means all of my HLSL ...
pdm's user avatar
  • 103
0 votes
1 answer
165 views

What's the difference between Unity3D rendering pipeline and OpenGL rendering pipeline?

I wanted to write small software renderer that will follow almost the same flow as OpenGL does, but got stuck with understanding of the rendering pipeline. After reading tons of info across the ...
Yurii B's user avatar
1 vote
1 answer
206 views

Screen space reflections bug

I try to implement screen space reflections in my graphics engine using ray marching algorithm. After a lot of trying I got this result: https://youtu.be/yzkgpcliBVQ As you can see, the reflections ...
Алексей Карамбович's user avatar
0 votes
0 answers
85 views

Having GUI on side rather than on game screen

How would I make it so that rather on the game screen the GUI is on the side of the screen and puts the game screen in its own little area so that its not covering part of the screen because right now ...
Zwei's user avatar
  • 1
0 votes
0 answers
50 views

How can I get look_at matrix from view_matrix?

I'm trying to set a look_at with the input of a view matrix, is there a way to do it? Because I know you can do the opposite (I think) where you set a look at and ...
Meyer Buaharon's user avatar
0 votes
0 answers
113 views

Per pixel shadows with depth / displacement map

I am looking to draw 2D sprites that cast artificial 3D shadows onto a flat terrain using an additional depth-texture when rendering the sprites. A black/white depth texture is used to add a height-...
Dahl's user avatar
  • 21
0 votes
1 answer
621 views

Simulating sprite shadows for a 2D top-down game

I have read some other posts with almost identical titles on here, but they are not exactly what I am looking for. (What I have seen come up a lot in 2D shadows is some sort of "ray-cast effect&...
Dahl's user avatar
  • 21
0 votes
0 answers
276 views

Implementing material (mtl) files into objects (obj) in LWJGL/OpenGL

I have an object loader that takes in textures, but when I try making some textures, they never turn out exactly how I want. I found out that a lot of them take a colour I want in one place and put it ...
Zwei's user avatar
  • 1
1 vote
1 answer
344 views

Correct camera transformation for first person camera

I am making a camera in openGl and I am having troubles with first person camera. So I had a few versions of camera transformation and all of them had their own problems. So at first, I was doing ...
Žarko Tomičić's user avatar
0 votes
2 answers
631 views

Rendering top down water on a 2D surface (OpenGL)

i'm looking for suggestions on how i could use shaders to create a water effect on the surface in the picture (below): I am using noise to create heightmap and normalmap textures that is uploaded to ...
Dahl's user avatar
  • 21
1 vote
0 answers
179 views

Draw and render a sequence of 3D models with OpenGL

I have an application that will generate a 3D model for a dynamic 3D object (3D mesh + texture formatted as .obj file) at a time, so I end up getting a stream of 3D models (or 4D models?), and I want ...
Gavin's user avatar
  • 111
0 votes
0 answers
153 views

Multisample anti-aliasing not working with interior mapping

Multisample anti-aliasing is not working for rooms that I generated with interior mapping (see the picture below). Any suggestions why this is the case and how it can be resolved?
klaus se's user avatar
  • 101
0 votes
0 answers
331 views

OpenGL Multisampling doesn't work

I am trying to get the Antialiasing (multisampling) in OpenGL with SDL to work(as shown here), but the result doesn't change and I still get jaggy edges. Before rendering I call the following ...
TheBaum's user avatar
  • 43
0 votes
0 answers
105 views

Is it possible to use hardware acceleration in OpenCL

I built a small game engine using OpenCL and SDL2 but it's not running really fast compare to Vulkan and OpenGL. I wrote rasterization code, but when I did some research Vulkan and OpenGL use hardware ...
is code's user avatar

1
2
3 4 5
85