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

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.

0
votes
2answers
101 views

Game assets are images or 3D models

I am new to game development and I have created simple games with javascript and SFML. Those games are 2D and there I used images as my gaming assets. I was trying to be familiar with OpenGL like 3D ...
0
votes
1answer
65 views

Perspective Matrix doesn't work OpenGL 4

I tried to implement my own perspective matrix and it doesn't work. I don't understand why. With just with my view matrix (without Perspective Matrix) I can see my mesh. Here my view matrix : ...
1
vote
0answers
38 views

How can switch GLSL “version #120” to “version #330”?

I am using GLSL "version #120" and i want to change it with "version #330". I added "GLM" library for this purpose. But i have some problems. Therefore i will ask you what is equal to this setting ? ...
0
votes
1answer
41 views

Can I use glTranslate and glRotate when my GLSL Version over (#version 120)?

I was using "GLSL Version #120". But now i am trying to do one tutorial and it is using "gl_ClipDistance[0]" inside of vertex shader. And "GLSL Version #120" doesn't support "gl_ClipDistance[0]". Now ...
0
votes
1answer
54 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
56 views

Adjusting view matrix when glViewPort & resizing

I have an issue when my window resizes. I have a simple MVP shader like this gl_Position = projection * view * model * vec4(in_Position, 1.0); to render a map ...
-1
votes
0answers
21 views

How can I add vertex normal support to MD5 model animation?

I am trying to add skeletal animation to my project. I followed one tutorial, but it did not include vertex normals. Therefore I can't perform lighting, bump mapping, etc. How can I add support for ...
0
votes
1answer
114 views

Unresolved external symbol _glad_XXX

I am relatively new to C++ but I have a few years of java experience. I decided to try to make a game with C++, In contrast with the handful of games i have written in Java with lwjgl. I am having a ...
-1
votes
0answers
50 views

How to correctly implement the ray intersections with blocks as in minecraft with lossless performance?

I am doing minecraft like game. We need an algorithm to find the intersection of the beam emanating from the camera with the block that first intersects and select the distance at which to check as a ...
0
votes
0answers
39 views

Explanation Morgan's McGuire Screen Space Ray Tracing method

I tried to implement the Morgan's McGuire method, but my attempts failed. He described his method here: Screen Space Ray Tracing. Below is my code and screenshot. SSLR fragment shader: ...
1
vote
0answers
39 views

Artefacts in SSAO Shader

I am having trouble with my Screen Space Ambient Occlusion shader. The objects in the game have the correct occlusion applied to them, however the occlusion flips depending on the angle of the camera:...
-1
votes
0answers
58 views

Is the GPU's texture memory cache cleared when reading from multiple textures?

I have been reading lately about the memory layout of graphics cards and the issue with dependent texture reads. I am worried about the efficiency of the way I use framebuffer textures. Initially I ...
1
vote
1answer
58 views

Noise when using SSLR (Screen Space Local Reflections)

When I tried to apply reflections to my scene, I ran into the problem of noise: My fragment shader code: ...
0
votes
0answers
35 views

Extracting and Rendering the camera frustum

So my conquest on plotting the camera's frustum starting because my AABB testing against the frustum is not that accurate and I decided to plot it in order to have a visual indication of what the f*** ...
1
vote
0answers
60 views

Grass swing/shake effect in 2D game

I want to make the grass swing/shake whenever the player walk through it. Like shown in this gif Grass Swing Effect from this article. I know I have to move the x coordinates of the vertices factored ...
12
votes
4answers
2k views

Difference between “buffer” and “array” in OpenGL?

When I read doc on webGL or OpenGL there can be seen some patterns in how names of functions and objects are used. But I can't understand the difference between buffer object and an array. There are ...
0
votes
0answers
15 views

Inverse kinematics with end effector orientation?

I'm trying to implement an inverse kinematics solver, but this time even with the end effector's orientation. I succeeded with the case when the end effector only requires the position. I learned ...
0
votes
0answers
40 views

How can I use bump map and fog in a shader at the same time?

I've been following a tutorial from someone named "thecplusplusguy" on YouTube. He showed how you can use shaders to emulate fog with OpenGL but when I tried to incorporate what he did in my bump ...
0
votes
1answer
81 views

How can I reduce the amount of GLSL code written?

I am writing a game engine for Linux. It has a sufficiently large number of effects that can be turned on / off. Effects are defined before compiling with #ifdef. ...
3
votes
1answer
46 views

Fixing T-Junction artifacts in a BSP Editor

I'm starting a little BSP engine, and have begun implementing Brush CSG. Currently I represent my brushes as the enclosed volume of surface planes (like old idTech 3 maps), with a cache for each face ...
0
votes
2answers
157 views

How can I represent a 2d UI?

So, I wanted to start building a desktop application, which is of course with an interface, and I thought that OpenGL would be best. The problem is, once I started following TheChernoProject's ...
1
vote
1answer
95 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
171 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 ...
2
votes
1answer
26 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
40 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
79 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
39 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
22 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 ...
-1
votes
1answer
83 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
41 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 ...
-1
votes
0answers
54 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
34 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
36 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
1answer
38 views

GLSL Shader compiles, but source is empty

I'm trying to compile a GLSL shader, to which I use the following code. Initialization ...
1
vote
0answers
115 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
51 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
45 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
83 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
151 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
84 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
38 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
114 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
76 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
43 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
77 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
49 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
71 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
44 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
62 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
24 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 ...