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

Why are there gaps in my fibonacci sphere?

I recently took an interest in sphere topologies to find which one is the best. The most popular one seems to be the fibonacci sphere. So I went and did some research and found some C code online that ...
0 votes
1 answer
45 views

Force even window dimensions

Force even resolution window I am using GLFW/glfw3 OpenGL to write 2D games. Some of my shaders have artifacts that only appear when the window size has an odd value. Eg 1201 by 1024 creates artifacts....
3 votes
1 answer
2k views

Converting Euler rotation angles from Z up to Y up (Max to OpenGL)

I'm working on pulling geometry and it's transformation from a 3DS Max exported FBX (Z-up) to an OpenGL model format (Y-up). The main problem is I intend to keep the transformations as Translation and ...
0 votes
1 answer
394 views

How to implement collision detection using opengl and c++

I am trying to implement collision detection system in opengl and c++ and I have a few qustions about best directions. I will just explain my ideas. So, I have a cube and a sphere as a basic collision ...
0 votes
2 answers
4k views

How to load and render a 3D model? C++ SDL, OpenGL

I have been learning C++ for long time (but only learning game development for eight days) and I have made a simple game using 2D textures. I was thinking of starting on 3D game development. I wanted ...
0 votes
1 answer
57 views

How to scale down noise intensity?

I'm currently making a planet and for that, I added noise, to create terrain on the surface. The method I'm using is creating simplex noise (that ends up looking like the image below) And I write ...
3 votes
2 answers
335 views

Why use sprite tile maps on the GPU in WebGL?

I'm trying to figure out the best way of rendering my layered tiled maps with WebGL, and have come across this tutorial several times: https://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.html ...
0 votes
3 answers
452 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 ...
0 votes
0 answers
37 views

So - Multi Draw Indirect, or batching?

I am not sure which one is better. Is Multi Draw Indirect just an easier, better, way than batching everything into one regular draw call, if you're using 4.3+? You can use VertexAttribDivisor with ...
0 votes
1 answer
437 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 ...
0 votes
0 answers
52 views

Well tuned orbit camera

I have been trying to make an orbit camera using glfw. I got a working solution which is as in the following. ...
1 vote
2 answers
327 views

How to keep same aspect ratio in different devices with cocos2dx?

I have been making a board game and I am using cocos2dx. There are two scenes for now, One is main menu and the other is gameplay scene. When I run the apk on tablet with EXACT_FIT resolution policy ...
1 vote
1 answer
303 views

How to subdivide an octahedron into a sphere?

For a game I'm making, I have to tessellate an octahedron into a sphere on the GPU (shaders). What I've done is I've successfully tessellated the faces, but I'm having trouble subdividing more spaces, ...
0 votes
0 answers
24 views

How do you update a non-renderable texture in webgl2 if you cant bind it to a framebuffer?

This is a noob question but I am stumped. I have a texture that stores x and y velocities. These velocities can be positive or negative so I need a texture that can store negative values. I can make ...
7 votes
3 answers
12k views

How can I round out the corners of a quad in OpenGL?

Even though I think the image is pretty self-explanatory, I'm going to explain what I am trying to achieve: I was working on a game, and I needed a GUI framework, that I decided to build myself. As a ...
27 votes
5 answers
70k views

Fastest way to draw quads in OpenGL ES?

I am using OpenGL ES 2.0 I have a bunch a quads to be drawn, would love to be able to have to pass only 4 vertices per quad as if I were using GL_QUADS, but basically I just want to know the best way ...
0 votes
0 answers
46 views

How to render my volume rendered through raycasting into an imGui window

I've been trying a lot to modify my Code so I can pass my scene into an extra ImGui window but I just can't modify my code so it still works and uses an FBO to render into ImGui. Here's my starting ...
12 votes
3 answers
1k views

How to hide a post-processed mesh outline when/where the mesh is hidden

I'm working on setting up an active outline in my 3d engine, a highlight effect for selected 3d characters or scenery in the screen. After working with the stencil buffer and getting some ...
0 votes
0 answers
33 views

How to know fps of game running on Mesa 3D on Windows 10

I am running some old OpenGL 3D application. I don´t have source code from the application but I assume it was implemented with OpenGL 2.0 or 2.1. I am running it on Windows 10 on Intel UHD graphics ...
1 vote
1 answer
74 views

Why is my texture moving?

I tried sampling equirectangular texture as a reflection. It simply does not work as intended. The texture is moving with my camera in a weird manner. Here is what I tried to do. Fragment shader: <...
1 vote
1 answer
476 views

Attempt to fix sprite sheet pixel bleeding in OpenGL 2D causing sprite distortion

While working on a project, I encountered the common problem of pixel bleeding when trying to draw subregions of my sprite sheet. This caused sort of "seams" to appear at the edges of my ...
1 vote
1 answer
320 views

Sprite framework binding multiple textures

In an attempt to batch render as many quads (sprites) as possible, I'm instance rendering a single unit-sized quad and passing in a buffer of per-instance data that includes width/height, texture ...
0 votes
1 answer
100 views

colored triangle where the color changes over time

I am trying to draw a triangle which changes color over time. My implementation is by using uniform variable. my fragment shader- ...
0 votes
1 answer
91 views

Graphical issue when using a depth pre-pass

I have implemented the Z pre-pass technique into my engine, leading to a 2x performance improvement in a test scene. However, the technique darkens the objects (but not the skybox), introduces z-...
0 votes
1 answer
80 views

Strange flashing cube bug in snake game

I'm trying to make a simple snake game in C and OpenGL, and I have this at the moment, which runs almost perfectly: ...
0 votes
0 answers
49 views

How I can compute normals vectors for a tessellated terrain?

I would like compute normals vectors for a tessellated terrain generated procedurally, in order to use them for a basic lighting. I don't know how I could do it. I can do it in the Tessellation ...
7 votes
1 answer
3k views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
0 votes
1 answer
62 views

What is the advantage of using Element Buffer Objects, if any?

I'm following the amazing LearnOpenGL tutorials and noticed that Element Buffer Objects, which were mentioned and used in the Hello Triangle chapter, never appear again. So my question is, is using ...
1 vote
0 answers
85 views

Are there OpenGL functions that are only available for specific platforms?

I want to load the OpenGL functions for my project myself. Are there any specific functions besides wglGetSwapIntervalEXT that require me to query the spec for its availability? And if there are, ...
0 votes
1 answer
45 views

glm::eulerAngles gives unexpected output for quaternion

I used the euler->mat4->quat to give the right result, but euler->quat gives the wrong result - is there something I did wrong? ...
0 votes
1 answer
81 views

How to execute early depth test

I have trouble applying early depth test in my engine, to prevent fragment shader to be (fully) executed for fragments that will be overwritten anyway, because other fragments, drawn later, will be in ...
7 votes
1 answer
1k 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: <...
0 votes
2 answers
129 views

How to procedurally compose shaders? [closed]

I read several times that shaders can be composed by the engine on the fly, depending on graphical settings. How is this generally done?
1 vote
1 answer
41 views

glPatchParameteri(GL_PATCH_VERTICES, 4) causes access violation

I'm trying to create a tessellated terrain, for this purposes I'm following the LearnOpenGL tutorial: https://learnopengl.com/Guest-Articles/2021/Tessellation/Tessellation However, when I set the ...
0 votes
1 answer
46 views

ObjFile not properly loading

i am losing my mind. I am trying to create an obj parser has a way to learn opengl but i have ran into a brick wall. with DMGregory help i got the textures to work i think but know the mesh just looks ...
1 vote
1 answer
178 views

Implementing a Maya-like orbit camera in Vulkan/OpenGL

I want to create an orbit camera with zooming, panning, and rotation. I used the following examples to create cameras: https://stackoverflow.com/questions/54400422/how-to-implement-altmmb-camera-...
0 votes
1 answer
414 views

When trying to render a texture in opengl after including the stb_image.h file in the project i get a linker error

Initially i gave the path of the stb_image.h & stb_image.c file location C/C++ include directories as adding the header file directly to the project was not working.
0 votes
0 answers
110 views

How can I draw split-screen in OpenGL?

My teacher wants me to compare 2 algorithms. I need to divide my window in half for displaying the code for each version (left for the first and right for the second algorithm). Does ...
1 vote
2 answers
1k 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
1 answer
52 views

Tessellation shaders not working, no objects drawing on screen

Using this tutorial https://learnopengl.com/Guest-Articles/2021/Tessellation/Tessellation and this tutorial https://www.youtube.com/watch?v=21gfE-zUym8 I implemented tessellation shaders that I haven'...
0 votes
0 answers
108 views

How I can compute normals in a tesellated terrain?

I'm trying to generate a terrain using tessellation. I tesselate patches, so the amount of data passed to the GPU is 4 * numberOfPatch * numberOfPatch. My problem ...
1 vote
0 answers
71 views

How to render a block being carved by a milling machine?

I'm making a simulation of a milling machine - something a bit like this diagram: At the top there is a cylinder mesh representing the milling tool. Below it is a cube mesh representing the material ...
44 votes
6 answers
39k 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.
0 votes
1 answer
581 views

text rendering artifact when rendering in 3D opengl GLfW

Main.cpp ...
3 votes
2 answers
1k views

How to draw text.Label().draw to FBO?

I just started OpenGL (PyopenGl) & Pyglet 3 weeks ago, and decided to read the Red Book. So sorry if my question shows my lack of comprehension... My question is: Is it possible to display/write ...
3 votes
1 answer
1k views

Specular Light not working (Phong Lighting)

There seems to be a problem with my current Phong Shading implementation. I have been using the per fragment approach. The specular highlight aspect of the technique is not rendering as it should, as ...
0 votes
1 answer
98 views

How to create an octahedron for sphere subdivision?

I have vertices that generate the first out of two pyramids. However, I want to have the second pyramid facing downwards as to make an octahedron. What are the correct vertices to use, because I've ...
0 votes
0 answers
38 views

Can we place a middleman on whatever functions are returned by WGL, EGL, or CGL?

I find myself wondering whether our PC games from the 2000s will continue to operate without a VM. To the present, GPU manufacturers have generously kept pre-3.2 OpenGL in their drivers. I'm amazed ...
0 votes
1 answer
400 views

TBN matrix for normal and parallax mapping

I'd like to refer to this question because I didn't completely answer to my problem. I've implemented normal and parallax mapping but because of some assumptions I have to use two different TBN ...
3 votes
1 answer
4k views

Rendering text with SDL2 and OpenGL

I've been trying to have text rendering in my OpenGL scene using SDL2. The tutorial I came across is this one Rendering text I followed the same code, and I get text rendering fine. However the issue ...

1
2 3 4 5
85