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

How to effectively manage multiple dynamic objects in OpenGL

Im at the point in the development of my game where I want to start rendering multiple objects on the screen and update them independently. There are two concepts I can think of to manage this. Each ...
0
votes
1answer
55 views

posting cards in memory game

I am making a memory game using opengl and c++. I am able to post playing cards to the screen. I am having a problem posting two identical cards randomly to the screen. I am able to post 10 cards to ...
2
votes
1answer
39 views

OpenTK immediate mode on net core doesn't work?

I have some old code that i imported into an OpenTK C# application running on NET 5.0. The rendering uses old fashioned immediate mode and it works on my current computer but nothing renders in the ...
0
votes
0answers
21 views

Program doesn't detect a ray triangle intersection correctly

Every frame I check if a ray intersects a triangle. But in practice program tell me that triangle is intersected only when I move camera on to it's position. I don't even have to put cursor on a ...
0
votes
0answers
16 views

Parallax mapping issue

Can anyone guess why this shader is only working from a top down view position (0.0, -1.0, 0.0). The parallax mapping calculation in the shader below is basically copied directly from learnopengl.com ...
0
votes
0answers
51 views

Rotate a texture around its center

I am tryna developing a little game library in C++ with OpenGl. I got stuck on the texture rendering step. My achieve is that to rotate the texture around its center. Now, I already know that the ...
0
votes
0answers
35 views

How to properly terminate an openGL application?

I use GLFW in C++. I close my application the following way: ...
0
votes
1answer
25 views

LWJGL2 Camera Movement Stutter

I'm having quite some trouble with camera stutter in my LWJGL2 game. The stutter only occurs when moving the camera. When it stands still, the scene is rendered smoothly. I could verify that by ...
0
votes
0answers
26 views

Ursina Engine shaders not supported

Ursina shaders don’t work for me. I’m running Ursina 4.1.1 on Python 3.8.5 on macOS 10.15.5. Shaders I tried: lit_with_shadows_shader screenspace_shaders.fxaa_shader screenspace_shaders.ssao_shader ...
0
votes
0answers
36 views

How to Pass Multiple VBOs to OpenGL for a voxel game

I'm trying to make a voxel engine (NOT based on an octree model). Currently I have a setup with a Chunk class, which stores the following: ...
2
votes
0answers
33 views

Best practices for treating Light Volumes in Deferred Lighting pipeline

This topic is about ways to handle light volumes in a deferred lighting pipeline. I currently have a deferred lighting pipeline where spheres are sent to an openGL GLSL lighting shader. The sphere ...
0
votes
1answer
29 views

Why clip in clip space - confusion with Gribb-Hartmann clip plane extraction

I understand to extract clip planes from the perspective matrix one can follow the methodology laid out by Gribb-Hartman as documented here: http://www.cs.otago.ac.nz/postgrads/alexis/planeExtraction....
0
votes
1answer
39 views

How do I calculate a matrix to render a mirror about a plane using GLM?

I've been trying to work out how to render a mirror for a while now, but a lot of resources I find either use very outdated tools I'm not familiar with, appear to be college slides referencing other ...
-2
votes
1answer
48 views

GL error GL_INVALID_OPERATION: mismatched type setting uniform of location "4" in program "1"

I get this error while trying to add lighting ...
-1
votes
1answer
46 views

How do I add light to my textures?

How do I add light to my textures using this? I have this GLfloat ka = 1.0; glm::vec3 ia = glm::vec3(0.5f, 0.5f, 0.5f); and in the fragment shader ...
0
votes
1answer
32 views

If I want to use textures and colors, how do I put them into my fragment shader?

I have many mesh objects in my scene and I have applied an image texture to some objects but I want to set different colors for the other objects. How do I do that? This is my fragment shader ...
0
votes
0answers
40 views

Opengl. A single texture is applied to all my objects. glTextureStorage2D Error faced

I can't seem to figure out why a single texture is applied to all my objects. I have three objects - fence, ground and cone but they get weirdly placed textures or a single texture on all of them. ...
0
votes
0answers
31 views

Filtering and aliasing in a scene

I have 4 fisheye cameras and I project them after lens correction onto a 3D bowel mesh. I'm getting flickering or really like ants are moving in those areas of the scene (top view) of the cameras. I'...
4
votes
1answer
124 views

In OpenGL, why do people worry that the accuracy of the depth buffer gets worse the farther away?

I'm really new to graphics programming, so I'm learning about depth buffers with this article. I got that the conversion from View Space to NDC is non-linear, but I think we can avoid the problem by ...
0
votes
2answers
30 views

opengl two vbo names

I'm a newbie in OpenGL trying to learn VBO. I have two arrays (point0 with 3 points and point1 with 6 points). Suppose I have ...
2
votes
1answer
68 views

How to get rid of intersections between terrain and road strip drawn on top?

When I draw a road as is (stencil:off, depth:on,less), the results are like this - ; Then I tried adding stencil a test for the road: ...
1
vote
0answers
49 views

Java/LWJGL 3 Optimization and Render error

(I asked the same question on StackOverflow but didn't got an answer. It's the first time I post here so idk if this is not allowed or anything, so if it is please tell me) I was following ThinMatrix'...
0
votes
2answers
49 views

Is there a way to figure out in which quad I am in fragment shader?

In my openGL project I draw a lot of quads (composed from 2 triangles) - for sake of example let's say quad 0,1,2 and 3. I process them in single pass. I do transform them with projection view matrix ...
0
votes
0answers
13 views

Opengles glBindBufferBase has weird performance issue

I am now doing some optimization for rendering process. I notice that in my game some objects is totally static and never changed. In my old way, I will create a uniform buffer every frame, and put ...
0
votes
0answers
49 views

OpenGL I want my image to change color based on stencil

I have an image and a rectangle on the screen, using the using this stencil functions I managed to render or not render a certain part of my image. ...
1
vote
1answer
85 views

Optimizing a deferred renderer

I've been creating a game engine with Kotlin and LWJGL. I wanted to render scenes that support many light sources, so I worked on implementing a deferred renderer. My basic pipeline is as follows (...
0
votes
0answers
26 views

Weird Collision Response occurring between 2 objects

I have been trying to program collision response between two objects (with AABBs) and the response is not what I except. Instead of bouncing off (reflective to the collision normal) each other the ...
0
votes
0answers
65 views

Huge texture management in OpenGL

I have developped a big map where the user can navigate. Let's say this map has a resolution of 15000x5000 (for example. It can be even higher). The way I am handling this in 2D is with a Tile Map (...
1
vote
0answers
33 views

LWJGL Using gl_VertexID properly?

I've gotten back to making lwjgl games, and I'm trying to make a sort of wave type vertex shader. I call this to make it wave: ...
0
votes
1answer
33 views

How to update constant buffer patially in OpenGLES

I am wondering what does glMapBufferRange actually do? I am accessing my constant buffer like this way: ...
0
votes
1answer
81 views

OpenGL gl_Position z-range and depth buffer range

Am I correct that the OpenGL depth buffer has values between 0 and 1 while the z component of gl_Position is between -1 and 1?
0
votes
1answer
29 views

Keeping two triangles with different scale attached during rotation

I'm making a simple Lunar Lander clone. The ship is a triangle, and I'm trying to draw the exhaust fumes of the ship. I'm wondering how to draw the exhaust so it's always relative to the ship. I'm ...
0
votes
1answer
133 views

CPU / GPU usage are both below 100% - what is bottlenecking my game?

I've been developing a C++ OpenGL game for the last couple of months. A few weeks ago I was profiling the game and I noticed that the GPU usage was almost at 100% (with the framerate uncapped). I ...
0
votes
0answers
18 views

Does mac OSX support multisampling?

I am using macbook air and writing my rendering app using GLFW library. I am currently enabling multisampling like the way I shown in the code snippet below. ...
0
votes
1answer
35 views

Rendering order objects with transparency?

I do not know if this question might have been asked before, but which method for rendering transparency is more efficient in terms of less lag?: Rendering the scene from front to back with respect ...
0
votes
1answer
43 views

Is there a way to blend an opacity overlay in a "mix" like nature without using an FBO?

I have done this many times whilst using FBO's, but in this unique case i would prefer not to use an FBO. I have tried a multitude of gl.BlendFunc() and ...
0
votes
0answers
52 views

Render 3 textures into an RGB texture?

Flutter has support for external textures, but they have to be RGB. I want to render YUV video to Flutter. On OpenGL I used to create 3 textures, and upload Y,U,V to each corresponding texture. Then I'...
0
votes
1answer
147 views

How to calculate the shadow bounding box with a directional light

I'm trying to implement a directional light in my C++ / OpenGL engine, but I struggle to calculate the shadow bounding box (i.e the shadow frustum). The bounding box has to encompass the main frustum ...
0
votes
0answers
36 views

Drawing 4D coordinates OpenGL WebGL

Quick question summary: how do I make openGL take 4 coordinates per point into the vertex shader from an array? I will then convert these to 3 coordinates (glPosition.xyz). More detailed explanation: ...
2
votes
1answer
36 views

LIBGDX ShaderProgram not passing uniforms

I'm trying to implement a Shader that turns any RGB values below 190 into black. LIBGDX code: ...
0
votes
0answers
66 views

OpenGL : std140 alignment and uint64_t arrays

I have a problem but I can't figure out what is happenning (I think that there is an alignment problem...), so in my OpenGL application I use bindless textures which handles are sent to the shader via ...
0
votes
0answers
39 views

Multipass rendering pipelines comparison (basic, uber, compute, ...)

I'm working on a project in wich as you can see in V1 it's doing a lot of drawcalls, 3 per instance of MyRenderer actually, in the first place I would like your opinion on this pipeline, if I'd be ...
0
votes
1answer
93 views

OpenGL Vertex Shader "joint matrix * weight" multiplication performance

Trying to implement animation on my engine. I'm at the first stage, rendering default pose of skinned meshes. Working as expected but very slow. With the below calculation, the shader takes 6ms to run....
1
vote
1answer
425 views

Orthographic projection not showing a triangle

I just want to draw a simple triangle using GL_LINES primitive with orthographic projection matrix. This is my vertices... ...
0
votes
0answers
38 views

how set set RGB components separately in opengl

Suppose I have previously rendered some set of pixels on the screen that each contain one of the following RGB values: ...
0
votes
1answer
68 views

Tangent Space Light Direction Incorrect?

I have normal mapping with a directional light in place. I noticed the lighting looks off but am unsure why it is happening. I believe it is related to the TBN matrix and possibly the handedness fix ...
0
votes
0answers
21 views

How to add vec2 for UV for texture mapping when using indices to build cube

I am trying to apply texture mapping to my cubes but are unsure on how to proceed. Current I am using indices to avoid having to repeat vec3s to make a cube and a vertex array of the points and their ...
0
votes
0answers
39 views

glCopyImageSubData slower than binding & drawing

I've read that above GL4.3, to copy one tex to the other, glCopyImageSubData will be the fastest solution, but after some forloop nested compare, it just not is the case here , glCopyImageSubData is a ...
0
votes
2answers
95 views

When does a "frame" start and end?

Here is the main loop that I currently have (and it does work perfectly): ...
0
votes
1answer
125 views

Improve cube rendering performance in lwjgl

I've been coding a minecraft-like game in lwjgl using cubes. I've reached a point where I can render 6 chunks of blocks before it starts lagging. I've searched online for optimizations and one of the ...

1
2 3 4 5
84