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
-1
votes
0answers
16 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
3answers
236 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 ...
1
vote
2answers
492 views

Frame Buffer Object (FBO) is not working. What is the right way to use?

I am trying to use FBO but i am living some problems. I will show you my steps but first i will show my running screen ,so we can compare them. Like before fbo after fbo. My running screen and Draw() ...
0
votes
1answer
67 views

Flat shaded triangles using the ModelBuilder?

I decided to give the ModelBuilder a try but I cannot get rid of the smoothing of my terrain. So what I tried: Create each triangle individually with there own ...
0
votes
1answer
383 views

Light position is always on the origin point therefore the diffuse and specular do not work

I am newbie to opengl. I did the tutorial by learnopengl. I have a strange problem when I was trying to do the light effect (ambient, diffuse and specular). For the diffuse, the effect appears on an ...
6
votes
1answer
761 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: <...
3
votes
1answer
4k views

How can I use ImGui to render simple text instead of using stb_truetype directly?

Since ImGui builds on top of stb_truetype for its font rendering, I thought it could be nicer to use its already built font-processing capabilities (...
1
vote
2answers
147 views

Getting Model View Matrix by hand

Right now I'm trying to calculate the model view matrix by hand... The App is 2D. I have something like this: ...
-3
votes
0answers
76 views

Moving camera with keyboard (WASD) in OpenGL (GLFW) [closed]

I want to move camera with keyboard in OpenGL. I followed this tutorial, but I have no idea how can I use them. This is my code: ...
-1
votes
1answer
61 views

Post Processing without using FBOs?

Recently, I've been making a 3D game (hint my questions), and I recently have modified a pixelization shader from a unity shader graph tutorial. The thing is, I want to render the shader on the WHOLE ...
1
vote
1answer
97 views

OpenGL height map accuracy for planetary rendering

I am trying to implement planetary rendering and I am trying to use OpenGL tessellation to model the terrain. Here is an overview picture using cube faces projected onto a sphere: If I use the ...
0
votes
1answer
60 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
1answer
307 views

glfw resizing causing image scaling

I have a quad rendered that extends from the top left of the window to with width of the window that is also 64 pixels high. When I resize the window, from its initial size, the quad and text scales ...
0
votes
2answers
41 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
1answer
109 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
11 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
1answer
183 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: ...
1
vote
1answer
68 views

Need help getting an objects orientation / all my OpenGL rotations are reversed

I'm using OpenGL on Ubuntu Linux with the Eclipse IDE and the GCC compiler. I am bringing blender models into a homemade renderer/game engine. I parse a text file containing object descriptions to ...
1
vote
1answer
67 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
1answer
123 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
1answer
39 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 ...
1
vote
1answer
211 views

What should the Z coordinate be after transformed by the projection matrix?

I'm working on an OpenGL 1.x implementation for the Sega Dreamcast. Because the Dreamcast didn't have any hardware T&L the entire vertex transformation pipeline has to be done in software. What ...
0
votes
0answers
20 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
1k views

Depth texture white in shader

I am trying to implement shadow mapping into my project and am stuck at this problem: If I'm reading the shadow map values with glReadPixels and linearize those ...
0
votes
1answer
191 views

Axis of affine transformation matrix

Let's say I have a right handed column major 4x4 transformation matrix. Can I safely assume (even though there exist non uniform scale) that first column is X axis vector, second column is Y axis ...
0
votes
0answers
21 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 ...
2
votes
1answer
70 views

How to move the shadow map with the camera?

I implemented a directional light and a shadow map for that light based on learnopengl.com tutorials. And it is working great, but I would like to move the shadow map with camera/player, so I have ...
0
votes
0answers
49 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 (...
0
votes
1answer
166 views

how to move a 2d shape in opengl 4.6 (glfw)

Class Button So from my understanding in order to move a 2d shape you need manipulate the vertices and then update???? If i do need to update the buffer how i would go by doing that? float xpos = 150 ...
0
votes
1answer
33 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
2answers
384 views

How can I access an OpenGl buffer from within a GLSL 330 shader?

I am currently attempting to create a simulation using OpenGl's GPU acceleration for both the simulation computations and rendering. The rendering portion of my simulation is complete and working, but ...
0
votes
1answer
221 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
1answer
240 views

Graphic render speed in libgdx using many sprite sheets

I am currently working on a customizable Player-character for my top down view 2D pixel game. I am using libgdx and aiming for android devices as well as desktop applications. I am wondering about an ...
1
vote
1answer
435 views

How can I render a font in C with OpenGL?

What I tried: I was testing some things in order to render text with stb_truetype.h and OpenGL in C. I took as a reference the example that appears here. Basically, this example, loads a .ttf file and ...
2
votes
1answer
47 views

How does re-glBufferData()'ing interact with glVertexAttribPointer?

I understand the basic sequence: glGenBuffers() creates a "buffer object name," glBindBuffer() creates the actual buffer object (as well as binding the name), glBufferData() "creates ...
1
vote
0answers
30 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
18 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
254 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 ...
0
votes
1answer
27 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
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
156 views

I can't make the cube map to use shadow mapping - or it seems so

Basically, I'm following tutorials as I'm very new to OpenGL. I managed to perform shadow mapping towards just one direction, meaning I created 2D texture depth map. Now with omnidirectional shadow ...
0
votes
1answer
39 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
1answer
71 views

What is the proper way to create a camera matrix?

I am having issues when trying to create a camera transform. It seems to have odd distortions and it does not seem to rotate properly, though it will translate alright. While I have seen issues like ...
0
votes
1answer
55 views

Distance between moving, rotated rectangles in snake game

I am trying to implement basic Snake game with movement based on timestep. For now I've got something along those lines: Update function: ...
0
votes
1answer
22 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
58 views

convert world to screen coordinates with camera position and camera angle

Heyho :) I'm trying to convert world coordinates to screen coordinates. I have available: fov, screen width, screen height, camera position, camera angle and obviously the position of the object in ...
0
votes
1answer
91 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 ...
0
votes
2answers
90 views

When does a "frame" start and end?

Here is the main loop that I currently have (and it does work perfectly): ...
0
votes
0answers
42 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'...

1
2 3 4 5
83