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
1answer
19 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
29 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 ...
-4
votes
0answers
36 views

How to re edit existing game [closed]

I just wondering if it okey to edit existing game, make it more alive, but I don't know how.
-3
votes
1answer
34 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 ...
-2
votes
1answer
40 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 ...
-1
votes
1answer
24 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
37 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
30 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
104 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
29 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 ...
-1
votes
0answers
49 views

How to build cross-platform for iOS and other platforms with a single graphics API? [closed]

I was able to support Windows and Android with my C++ game by using: sdl2, sdl2_net, assimp, freetype, imgui, glm and I'm planning to use OpenGL for Windows and OpenGL ES for Android, but my problem ...
1
vote
1answer
66 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: ...
0
votes
0answers
40 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
44 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
12 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
33 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
76 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
23 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
57 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
32 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
29 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
55 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
129 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
17 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
31 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 ...
1
vote
1answer
40 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
46 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
97 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
32 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
31 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
51 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
36 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
81 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
242 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
46 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
20 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
35 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
94 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
101 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 ...
0
votes
1answer
61 views

Very small line when two sprites are exactly next from eachother

Recently, I have been thinking about a hangout game, not really need to go into detail, because I am focusing on creating the engine itself. Basically just to make my brain not hurt while making the ...
0
votes
0answers
56 views

OBJ file loader texture coordinates ‘scrambled’

Edit I've rewritten the loader to duplicate data if only one element (v, vt, vn) is different. I get a much better result, but it is still incorrect. The seams on the mesh match what they should look ...
0
votes
1answer
50 views

Not understanding how indices and texturePositions are mapped to vertices in LWJGL

I've been following this tutorial on OpenGL and LWJGL and at some point three different lists are introduced without really explaining how they interact with each other. Can someone explain how it ...
0
votes
0answers
50 views

Collision detection stop movement

I am making a simple first person 3D game in OpenGL with C++. I am just wondering on how you make an object stop moving when it collides with another object. This is what I am using for detecting ...
0
votes
1answer
66 views

Building an LWJGL jar file - java.lang.NoClassDefFoundError

EDIT: Recently got it working by making a batch file that does this: set /p CP=<cp.txt java -cp %CP%;testing.jar me.pale.main.Main and cp.txt is this ...
0
votes
1answer
65 views

OpenGL 2D texture lookup returns zero (black)

I am trying to use a 2D texture as a lookup table for pre-computed values. In each case I set all values of the texture to 0.5 for testing. When I use a 1D texture, it works and I get 0.5: ...
1
vote
0answers
46 views

Synchronizing transformation of a Rect class between CPU and GPU

I implemented a Rect class in my custom game engine that utilizes openGL. I decided to approach the whole Rect class design like ...
0
votes
0answers
42 views

rotate sprite without stretching

I am attempting to rotate the sprites in my game, but they get stretched whenever it happens. I know that it is due to the screen not being square, but I can not figure out the correct way to ...
0
votes
0answers
83 views

Workaround for texture coordinate problem on border of terrain "chunk"?

I am working on clipmap terrain with streaming chunks loaded into a texture array. There are currently 2 texture arrays, one for the heightmap chunks and one for the normal map chunks. Chunks load in ...

1
2 3 4 5
84