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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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
51 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
28 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 ...
0
votes
0answers
23 views

Setting up OpenGL and GLFW with CLion [closed]

I can't find anything for how to get OpenGL and GLFW to work with CLion that works or that I understand. Can someone just point me in the direction or link a tutorial for how I would do this? Will ...
-1
votes
1answer
70 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
22 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 ...
1
vote
2answers
75 views

Moving a camera without rolling (tumble not arcball rotation)

I'm trying to move my camera around using mouse+keyboard. I'm looking for specific camera behaviour however, and I cant figure out how to get it right. What I've found, is that to get a maya/tumble ...
0
votes
1answer
28 views

OpenGL vector rotation matrix to a given point

I have a sphere with a radius of .5 The sphere is centred at 0,0,0 I am now trying to place items around my sphere based on a given x,y,z on the surface of the sphere. My items have been draw/...
2
votes
2answers
84 views

How to draw a 3D capsule?

I want to draw a 3D capsule defined by a segment (two points start->end) and a radius: Image source: Orionist on Wikimedia Commons I already have a sphere leaning on this answer: https://...
0
votes
0answers
28 views

Fast 2D tilemap rendering using modern OpenGL

let me try to keep myself short. I will start out with trying to explain my current situation, then what I need advice for and finally my current approach. Sooo, as the title suggests, I'm trying to ...
0
votes
1answer
65 views

Sun model matrix

I'm playing with sun implementation in my engine and I correctly built model matrix using below order of matrix operations: Translate to camera position. Calculate x and y axis of rotation matrix ...
0
votes
0answers
11 views

How to organize passing data to shaders in cross-API render system?

I try to create rendering system that supports DirectX and OpenGL. I am trying to create class for constant buffer, but DirectX constant buffers and OpenGL uniform buffers have different memory ...
0
votes
0answers
49 views

Are Mutexes in OpenGL shaders possible?

I am in the process of developing a shadow system for a 2D platformer which uses a polar map that saves the closest length to a fragment from a light and doesn't apply the light to any fragment beyond ...
1
vote
1answer
40 views

How to access an uniform array with a float as index in GLSL?

I'm trying to do basic multitexturing of terrain in OpenGL. Im building the terrain with an image representing different elements (beach, water, jungle...) : Im trying to map each color of this ...
0
votes
2answers
61 views

Correctly transforming normals for G-Buffer in Deferred Rendering

I have a deferred rendering system: first there is the G buffer generation, then there is the lighting or shading calculation on that gbuffer data. However there seems to be an issue with various ...
0
votes
0answers
19 views

undefined reference to some opengl functions (glBindBuffer,glActiveTexture,glGenerateMipmap)

i am using c++,sdl-2 and opengl and i using codeblocks. when i use 32bit mingw i didnt get error like this but i tried to use 64 bit i get this error :(. i set-up mingw64 right i think i also made ...
0
votes
1answer
29 views

Using PyOpenGL, can I rotate raw data rather than the current matrix?

I'm trying to create a sort of PyOpenGL renderer for the Bullet physics engine, and at the moment I'm rotating my basic cubes with math in Python. However, if I do the math in Python that's going to ...
0
votes
0answers
21 views

Class initialization disrupts my OpenGL context and I am unable to render anything after

I have OpenGL context setup successfully, and I can draw textures on screen, but once I initialize CGEFrameRenderer (from gpu-image-library - just instantiation and calling init) I am unable to render ...
1
vote
1answer
33 views

How to store shader output to VRAM?

This is really ungrateful question to Google. Basically, I would like to know, regarding openGL, what are various methods to do some kind of computation in one of the shaders and have the results ...
2
votes
1answer
55 views

Solving a recursive problem in the geometry (or any other) shader

I would like to calculate an effect of an external force on a binary tree (wind on a tree). It's a recursive function - take a (parent) node and calculate the angle to rotate all of the nodes "...
1
vote
0answers
42 views

How to implement weighted blended order independent transparency in OpenGL?

I want to implement weighted blended OIT in my C++ OpenGL 3D game, but I didn't find any C++ examples about weighted blended order independent transparency. Paper How to clear accumTexture(...
0
votes
0answers
35 views

Finding a tile data in an array

I have tile vertices stored in an array. How would I go about finding a tile when given its position. ...
0
votes
1answer
41 views

“RuntimeError: Validation failure (0)” using shaders

I'm trying to move away from using glVertex() in my game code because it doesn't seem to work well with a large quantity of vertices. At the moment I'm trying to make code that uses Shaders, but when ...
0
votes
0answers
33 views

how can i start mipmap technic from character?

hi how can i start mipmap technic from character ? i mean example like this picture : in my code mipmap starts from camera(Near Clipping Plane). i dont want this. ...
0
votes
1answer
34 views

Skeletal animation: unexpected quarternion values

I'm following ThinMatrix's skeletal animation tutorial and his custom written Collada parser is deriving a different rotation quaternion from each keyframe matrix than the Assimp importer library does....
0
votes
1answer
39 views

VBO interleaving dillema

I'm trying to write a map editor for a unity game using openGL. In order to do that, I need to unpack it's resource files to get meshes, textures and other good stuff. In doing so, I've discovered ...
1
vote
1answer
48 views

How to decide how many textures to break an object into?

So I am making a couple spacecraft in my game. And I want them to look sharp and as photorealistic as possible. How can I decide if a certain craft should be broken into multiple meshes to each ...
0
votes
0answers
21 views

How do you calculate the center point of a skeleton when the pelvis is the root bone?

I have the center point of where the skeleton is supposed to be positioned. The root bone is the pelvis which is not the center of the skeleton in the y plane. I don't want to hard code the delta ...
0
votes
0answers
7 views

offset texture attached to frameBuffer to render panorama

I would like to pre-render horizon of large landscape to texture and than paste it as cylindrical screen around the camera (to accelerate rendering of distant details) Easiest would be make 8-gon ...
0
votes
1answer
46 views

Camera Pitch, Yaw from View Matrix

I have a camera that works with Pitch and Yaw (no roll) and compute the look at matrix as following : ...
0
votes
0answers
60 views

Implementing a wobble effect for speech bubbles in Unity?

I'm working on a little game in Unity 3D and I'd like to replicate the wobble effect seen on the speech bubbles in the game "Night in the woods", as seen here: https://www.youtube.com/watch?v=...
0
votes
0answers
19 views

Performance comparison of reading Depth Buffer or texture in fragment shader

My requirement is to render per pixel data (say pixel transparency) to some buffer (say render pass 1) and then render a shape using the per pixel lighting rendered in shape 1. I can use depth buffer ...
1
vote
0answers
27 views

Choosing a draw call when not reusing vertex data

Up until now I've always used glDrawElements, and have my vertex and index buffers bound. From what I've read, glDrawElements is ...
1
vote
1answer
16 views

Does gluLookAt add or set the view matrix variables?

I'm trying to rotate the camera view in PyOpenGL, but it's not working well. The weirdest behavior I've noticed is that putting gluLookAt in a loop seems to change the camera view, even when I'm not ...
0
votes
0answers
45 views

Why ImGui not rendering image correctly in my game ui

[Scene:] I am working on a game project.In a part of my project,I have to do following things. 1.Read a image 2.Detect face(I am using opencv) 3.view in my imgui window using ImGUi::image() I ...
-3
votes
1answer
60 views

How can I quickly add bloom to my game engine?

The title says it all: I need a quick method for adding bloom to my game engine. No need for code, I only need the explanation.
0
votes
1answer
68 views

Intel GPU running faster than Nvidia GTX 1060

My app in its current state renders only 2 triangles to the screen using OpenGL. I am using std::chrono::steady_clock for frame counting. With Intel graphics, I ...
0
votes
0answers
17 views

How widely supported is glBlendFuncSeparate

I need to use glBlendFuncSeparate to implement this answer. I'm implementing this in a rendering engine that needs to run on multiple platforms (ios, android, ...
0
votes
0answers
16 views

Particles Artifacting on Unity games running OpenGL 3.0

Before I begin: I am using a Samsung Galaxy Note Fan Edition (Note7) on Android 8.0.0 and Experience UI v9.0, with the Exynos 8890 SoC, which included the Mali T-880 MP12. I have been encountering ...
1
vote
3answers
278 views

Why is OpenGL displaying this specific color as white?

I have a sprite class that is supposed to make a 2D rectangle based on the location, colour and size of the rectangle. I have created a renderer class that uses this sprite class to create buffers and ...
1
vote
0answers
72 views

Development decision: how to proceed regarding OpenGL [closed]

There is a 3D app developed by someone with OpenGL almost 2 years ago. The development is not finished by the previous developer and I'm assigned the task to finish it, based on customer requests. I ...
1
vote
1answer
126 views

How to create a 2D fog shader?

I am trying to write a fragment shader in GLSL for a fog effect in a 2D game. Here are some links showing what I'm after. Here the fog is in the foreground and near the ground: https://twitter.com/...
7
votes
1answer
6k views

Can I sell a game made with OpenGL?

I love creating games, and I've always made games using OpenGL and not with game engines such as Unity or Unreal. Can I legally sell the games I made with OpenGL?
1
vote
1answer
71 views

I don't understand code that builds 3D sphere

I'm trying to learn some lwjgl and opengl, and I was trying to make a 3d sphere etc, I found a code to do that, but I don't 100% understand the code and the math behind it and would like to get some ...
1
vote
0answers
35 views

How is terrain editing implemented like a sculpt tool?

Some creativity/sandbox games have a terrain editing feature. When thinking of a terrain, I'm thinking of a grid of vertices. The elevation of each vertex is then determined by a heightmap (image). ...
1
vote
0answers
72 views

Plotting 2D map coordinates to OpenGL 3D projection

I’m trying to convert a 2D map created in my map editor to a 3D plotting with OpenGL. This is my map generated in my map editor: Those vertices are relative to my Cartesian origin world coordinate (...
1
vote
1answer
52 views

Does GL Memory model guarantees that late Depth Testing accesses depth buffer values in same draw call

Suppose I issue a draw command that draws 3 overlapping triangles (T1, T2, T3). Fragment shader assigns Depth = 3 to T1 fragments, 2 to T2 and 1 to T3 fragments. Depth Buffer is cleared to 0 before ...
0
votes
2answers
56 views

OpenGL Array Texture generates black texture

I am creating a game using OpenGL that has many textured cubes. I am trying to use an Array Texture to load multiple textures from one file. I tried to setup my texture atlas; however, all that ...
1
vote
1answer
50 views

GLSL shader time uniform freezed?

I have a simple fragment shader to simulate "falling water". I'm using Ogre3D and opengles2, this is my code: ...
2
votes
2answers
74 views

Sobel Edge Detection on Depth Texture

I'm currently trying to implement contour shading via edge detection on a depth texture. I'm rendering the color and depth information onto two textures. In my post processing shader I do the ...
1
vote
0answers
22 views

2D pixels change size when scrolling [duplicate]

I'm working on a 2D side-scroller, OpenGL, pixel art. And I'm having trouble getting the pixels to remain square when scrolling the camera. By that I mean, when scrolling the camera at low speed when ...