Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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 ...

1
vote
1answer
39 views

Drawing many separate lines using mouse OpenGL(GLFW/glad)

So, in order to draw a line, I track the coordinates of the mouse, then I add them to the array and capture it as GL_LINE_STRIP_ADJACENCY. However, for example, I completed drawing a line1 at P1 and ...
2
votes
1answer
68 views

How to implement a pixelated screen transition shader?

I am interested in creating a screen transition seen in a lot of retro games. The transition is just a kind of pixelated distortion that increases or decreases in granularity over time. The effect is ...
1
vote
1answer
15 views

OpenGL different sized textures for the same framebuffer?

With OpenGL 3.3, is it allowed/okay to bind different sized textures to a frame buffer? I.e. ...
0
votes
0answers
7 views

Issues Rotating 3rd Person Camera Following an Object's Orientation

I've developing a flight simulation in openGL with GLM in C++ and I am having issues rotating the camera around as the plane pitch, yaws, and rolls. It's also my first time using quaternions, ...
0
votes
0answers
31 views

Solve SlowRendering issue with OpenGL

We have been seeing reports of slow rendering of frames in google play vitals. When trying to debug better, it was recommended to use adb shell dumpsys gfxinfo to get more information. Our game uses ...
0
votes
1answer
52 views

OpenGL scene performance optimization

I am writing my 3D engine for Linux, and I ran into a performance problem. What was included at the time of testing: Bloom DOF (Depth Of Field) Soft shadows Point light source 1k, 2k textures (...
0
votes
1answer
19 views

Create a white background for the texture and then blend using GLSL

I have a transparent png texture and I'd like to create a white background and then blend this on top of that. Is this possible using just GLSL? I can't multiply, add or mix colors because I don't ...
0
votes
1answer
21 views

World position reconstruction from depth fails when viewport size does not match window size

I'm facing very strange issue. My code for world pos reconstruction works correctly when the viewport size is equal to window size (or framebuffer size in other words). Below is the part for ...
0
votes
0answers
40 views

Cross-platform shaders with SDL2

I'm working on a (my first) project, a little 2d game in C++ with SDL2 to set up the screen and stuff. I learned how to write graphics code using THREE.js to run OpenGL ES shaders, so in this new SDL2 ...
-1
votes
1answer
36 views

Help with dual quaternion skinning

I'm trying to convert my code to use dual quaternion skinning instead of matrix skinning because i just can't get the skinning matrix created correctly from bones+weights using matrices. Edit: just ...
1
vote
0answers
35 views

glDrawElementsInstanced rendering always rendering the last instance at the origin

I'm in the process of adding instanced rendering to my engine, to do this I'm adding an offset attribute with a divisor of 1. But for whatever reason, OpenGL is consistently rendering 1 instance at ...
0
votes
0answers
46 views

Weird behaviour of glsl with fragment, vertex and geometry shaders

I am a beginner in developing games. I started some time ago with OpenGL and the glsl language. These days I am having so many problems and for me it is too difficult to solve, because the shaders are ...
0
votes
1answer
24 views

Turning on Vertex Attribute Divisor With Instanced Rendering Renders Nothing

When I render with glDrawArraysInstanced with the vertex attribute divisor set to zero, the triangle appears as expected. But when the divisor is set to any value other than zero, the triangle ...
0
votes
0answers
18 views

How to parse a bvh file to a skeleton model already made in OpenGL?

I'm trying to parse the bvh data to my skeleton I already developed with OpenGL. There is one thing regarding data parsing I got curious about. Bvh data has two parts, which are HIERARCHY and MOTION. ...
0
votes
0answers
35 views

Mouse click from screen coordinates to world coordinates in Orthographic projection

I'm trying to draw GL_POINTS at a right clicked mouse position, when I tried the following methods, https://gamedev.stackexchange.com/a/144667/99481 and https://...
0
votes
1answer
32 views

GLSL Shader compiles, but source is empty

I'm trying to compile a GLSL shader, to which I use the following code. Initialization ...
0
votes
0answers
47 views

OpenGL Ray Transformations

Sorry for my english at first. I have method for ray intersection test and it works. If I apply a transformation to an object, the method does not see it. I think that happens because I'm using wrong ...
-3
votes
0answers
72 views

Object Picking in Vulkan

How can I perform object picking with Vulkan? ie. I want to render each object using a different color to a texture in a separate rendering pass, and read those texture pixels to get the color value ...
1
vote
0answers
81 views

how to calculate smooth normals for 10,000,000 vertices?

I am trying to calculate smooth normals with angle weight for a huge mesh with 10 million vertices. Currently, i am using map/dictionary to store the traingles connected to a vertex. That is, for each ...
0
votes
1answer
42 views

GLSL - Efficient Point inside Box Check

I'm attempting to improve the performance of a shader that changes the colour of a region of the world that is inside a "zone". I am using a deferred lighting system, so the colour and world-space ...
1
vote
1answer
37 views

OpenGL additive vertex color mode

Surely OpenGL has a way to set the vertex color mode. By default it is multiplication. When I have an existing texture on a quad to represent a player in my game, I want to add color to it. As of ...
1
vote
2answers
72 views

Pros and Cons of making one complex mesh vs more simpler ones

Looks like I have a problem with basic understanding of how OpenGL works. Lets say I have a mesh made out of three cylinders that is shown on the picture: So are there any major difference in ...
1
vote
1answer
94 views

Terrain collision detection

How should I go about making terrain collision system without hightmap ? What I have tried is building a heightmap from a blender model, but that works only if the vertices are evenly spaced. Mine ...
1
vote
1answer
61 views

OpenGL Deferred Shading Pixelation

I'm working on a 3-pass deferred lighting system for a voxel game, however I am having problems with pixelated lighting and ambient occlusion. The first stage renders the color, position and normal ...
1
vote
0answers
19 views

How can I make a transparent hole with shaperenderer using stencil masking in libgdx?

I'm making a 2d game, where I need a resizeable, moveable rectangle outline. I'm trying to use stencil masking to do it by cutting a hole in a solid rectangle, and I thought this would help: How can ...
0
votes
1answer
92 views

Can DDS be used in OpenGL in Linux without license/patent issue?

Is there a 'standard' for OpenGL game creation intended for both Windows and Linux? I understand DDS is the DirectX standard (or, at least, it appears to be). Is there one that does not have potential ...
0
votes
1answer
48 views

Billboard quad in same draw call?

I am currently drawing a isometric world in 3D, meaning the floors and walls are all quads aligned to the original axis in the world and using a rotated orthogonal camera to "distort" the images into ...
0
votes
0answers
34 views

UV flipped in parallax mapping

I'm attempting to implement parallax mapping using the following shader pair in a deferred renderer, but as you can see in the attached image, the vertical shifting of uv coordinates for sampling is ...
1
vote
1answer
67 views

Unexpectedly fast rotation after refactoring OpenGL code to add more abstraction

I've been working on an OpenGL program that simply renders a square that rotates in 3D space. The square also has a texture applied to both sides. Here you can see an example screenshot of the program ...
0
votes
1answer
39 views

How can I color single triangles with a color palette?

My primary goal is to have a lowpoly rendering style, so that each triangle has its own homogeneous color on all its fragments, meaning color is not interpolated between vertex. I have my indices ...
0
votes
0answers
21 views

OpenTK Camera isn't working

I've looked at many tutorials on this topic although there aren't that many, and I tried creating a 3d camera that can move while pressing WASD and such and it doesn't seem to work. Here are some ...
0
votes
0answers
40 views

How can I fix this MineCraft Forge OpenGl error?

I am making a MineCraft Forge 1.12 gun mod. The gun works but I only need to add some animations for reload and aim. So I have tried something but I gives me an error every time. ...
1
vote
1answer
32 views

Why does my terrain texture fail to load? (OpenGL)

I'm currently using a vertex shader and a fragment shader for loading my texture onto the terrain I made. Here is my vertex shader ...
0
votes
1answer
53 views

i need suggestion animation technique for 3d?

firstly you need to now i am beginner :) i am using opengl and for display vertex buffer object(vbo). i made 2000 frames animation model with blender and i export with (.obj) files and i upload all ...
0
votes
0answers
19 views

Efficiently drawing a batch of meshes?

I was playing around with some isometric ideas, I want to create fairly large maps with a couple of Z levels, much like the older X-com games. I figured I am probably way better off to draw the quads ...
1
vote
1answer
419 views

Render Stutter - OpenGL or loop timing?

For some time now i have no been able to pinpoint the nature of the rendering stutter shown above(by not clearing the screen, not using SwapBuffers and drawing only to the front buffer). See the big ...
0
votes
1answer
71 views

Migrating 2D game from immediate mode to VBOs

I am in the process of migrating away from legacy OpenGL calls in my 2D LWJGL game. Previously I would render each sprite using immediate mode, which was dead easy - bind the texture, add the vertices,...
0
votes
0answers
29 views
0
votes
1answer
69 views

Opengl texture rendered as solid color,why?

her is my vertex array and texture coordinate.. ...
1
vote
1answer
47 views

i want to upload to 2gb model animation to vram with VBO technic but i am getting this error with nvidia (with amd no error)

when i try to work with amd its working with amd hd6870 and ati x1550 but when i try to work with gtx 950 its giving this error. if i upload less than 2gb example 300mb then its working but i want to ...
0
votes
1answer
51 views

Error code 1282 when calling glDrawElements

I am trying to render my terrain using an EBO, but the function glDrawElements returns an error (1282). I tried to find out what ...
4
votes
1answer
135 views

How to create a skybox in an infinite world like minecraft?

I'm making a minecraft-clone game in C++ using OpenGL. I created a skybox using OpenGL's cube map but the camera can go outside of the skybox since it's an infinite world. Then I changed it to update ...
0
votes
0answers
16 views

Billboarding Labels Using Quaternions

I am encountering some issues with billboarding. Although my situation is a bit complicated. So, I am modeling the solar system, and I am also placing labels on everything. For an example, I'll use ...
0
votes
1answer
32 views

how to use glm::rotate with a eulerangle?

I have a vec3 to represent my object's orientation/rotation but the glm::rotate method expects a quaternion. If I just convert ...
0
votes
1answer
103 views

Minecraft/OpenGL - Create Multiple viewports

I'm working on a project for the game and i have been trying to draw a second smaller "window" that would act like a second camera, independent from the player. I have looked into glViewport however ...
0
votes
1answer
43 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 ...
1
vote
1answer
92 views

Separating game logic and rendering logic in separate static libraries

I'm trying to write a game in C++ using OpenGL. I've tried to separate my game logic and my rendering logic as much as possible, and up until now, this has worked for me. I haven't written a lot of ...
0
votes
0answers
35 views

Calculating Path of a character around stationary objects (2d object)

How would I go about calculating a path for a character around stationary objects? Any advice is greatly appreciated. blue = character; red = stationary objects; green X = destination; 2d Game in ...
-1
votes
1answer
91 views

Interesting graphic artifact

I was exploring old Minecraft source code when I encountered this: I just wanted to know what causes such distortion and how to fix it with OpenGL?
0
votes
0answers
35 views

Ambient Occlusion Rendering

I'm having a weird issue with rendering ambient occlusion. There seems to be a screen space split that inverts the ambient occlusion. Here is what my issue looks like SSAO Image my SSAO shader ...