Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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
2 votes
1 answer
59 views
+50

Is it possible to use a pre-existing texture buffer containing vertex data to initialise a vertex buffer for rendering in OpenGL?

I'm generating a heightmap in a compute shader in OpenGL and storing it to a texture. Lets say I actually store the full vertex data in that texture instead of just the height, which is a trivial ...
0 votes
1 answer
38 views

How to render frustum shape for debug visualization?

I've been implementing frustum culling in an OpenGL application that appears to be working correctly. The issue I have been having when trying to render the frustum shape from the camera, my debug ...
0 votes
0 answers
63 views

Matrices for OpenGL shaders

So I'm trying to figure out the model, view and projection matrices. I can, with some effort, find my drawings (3x3x3 structure of cubes) in 3D space and it looks like: The problem is, the cubes seem ...
10 votes
1 answer
30k views

The view matrix finally explained

I must say that I am really confused by how a view matrix is constructed and works. First, there are 3 terms: view matrix, lookat matrix, and camera transformation matrix. Are those 3 the same, or ...
0 votes
2 answers
38 views

Custom matrix structure with OpenGL shaders

I have a MAT4 structure. ...
1 vote
2 answers
97 views

How do you handle shaders/graphics while remaining cross-platform?

I'm building a C++ based game engine, and I have my ECS complete as well as some basic components for stuff like graphics & audio. However, I'm currently using a custom interface on top of SFML ...
0 votes
0 answers
46 views

When compiling shaders in OpenGL, I get random error messages

I am trying to follow LearnOpenGL while coding in the Zig language, and something that is very odd is that sometimes my shader compilation fails even though I changed nothing between executing the app....
0 votes
1 answer
33 views

OpenGL strange depth testing

Depth testing isn't working (hopefully the images below describe, I'll gladly describe more when asked) for me, and I can't seem to figure out why. GL initialization: ...
0 votes
1 answer
22 views

Frustum Culling Not Utilizing Entire Bounding Sphere in OpenGL

My frustum culling is detecting an object as culled even though not the entire object's bounding sphere is out of the frustum yet. It's like it believes the bounding sphere's radius is smaller than it ...
0 votes
1 answer
47 views

OpenGL texture not working

So I'm setting up texture creationg like so, for the data 3 pixels, 1 red, 1 green and 1 blue pixel: ...
0 votes
0 answers
50 views

Pyglet - How can I add a bloom postprocessing step to my scene?

I have a simple Pyglet scene below. I would like to apply a postprocessing step to add bloom to the scene. How can this be done using pyglet? I've tried looking through all the documentation for ...
0 votes
0 answers
33 views

Glyphs are not being drawn [opengl + freetype]

I've followed this source from learnopengl.com for text rendering. It seems fairly simple, and only required this much code: ...
4 votes
1 answer
2k views

SDL2, OpenGL, Nvidia laptop screen tearing

EDIT 2017-05-14 dvb. Issue still active to this very day, see geforce forum link in main question. Note 3: "Stoltverd" has posted a "fix guide" on geforce forum. It has workarounds for non-OpenGL ...
3 votes
0 answers
278 views

Avoiding z-fighting when reimplementing Freescape games

I need to avoid z-fighting in exactly co-planar surfaces that are too close to the other solids. I'm re-implementing the Freescape engine in ScummVM (all my code is open-source, available here), and ...
0 votes
0 answers
24 views

Cube gets squashed after applying perspective matrix

I'm trying to apply perspective to a simple, rotating cube. I created a perspective matrix using glm library, multiplied it with ...
0 votes
1 answer
542 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
0 answers
74 views

SSAO Looks Like Depth Buffer

I have problem with ssao, i'm using vulkan and follow Sascha Willems vulkan ssao example here: https://github.com/SaschaWillems/Vulkan/blob/master/examples/ssao/ssao.cpp my ssao result looks exactly ...
0 votes
0 answers
48 views

Lighting of clouds billboards

I created billboards of clouds that always face the camera in OpenGL. Now I want to add some lighting effects and maybe simulate a scattering light effect. I experimented with phong shading but my ...
0 votes
1 answer
55 views

Textures still show as opaque even when alpha is multiplied by zero

I'm having a some problems with blending in OpenGLES2.0 I'm drawing a texture above a framebuffer (with ARGB channels). When I draw a transparent texture over a solid color, the alpha channel is ...
0 votes
1 answer
866 views

text rendering artifact when rendering in 3D opengl GLfW

Main.cpp ...
0 votes
0 answers
18 views

OpenGL, How should I pass the matrix using VBO and binding points?

I'm trying to make a simple example in OpenGL and C++ to draw a square and change position and size through an array. my problem lies precisely in the passage of the matrix to the shader. I initially ...
0 votes
1 answer
75 views

How do I interpolate light intensity for tilemap's lightmap?

I implemented lightmap creation for a tilemap, but I cannot figure out how do I interpolate light intensity values. For now, my lighted tiles create an obvious grid-like structure. It was pretty easy ...
0 votes
0 answers
39 views

Screen coordinates in OpenGL shader

I have triangle in screen coordinates, and I have resolution 800x600. How I can put this vertex buffer (triangle with screen coordinates) into OpenGL shader and draw this triangle? Inside shader ...
0 votes
0 answers
41 views

What is the best way to load models with support for multiple textures per mesh?

Currently, I have a model loader heavily inspired by the one made in LearnOpenGL, which works fine when loading regular models. I made a simple cube in Blender, exported it as an OBJ and I'm able to ...
14 votes
2 answers
20k views

Render in a imGui Window

How do i render my game scene into an imgui window? I want to get from this: to this :
0 votes
0 answers
52 views

Why doesn't my Raycast detect AABB collision?

I have the following struct that calculates Raycasting: ...
1 vote
1 answer
46 views

Blinding flash. Set background color when creating new window

Using GLFW to create the main window Example c++ ...
8 votes
2 answers
447 views

How to generate a multiplier map for radiosity

I am following this tutorial: here I am at the part where you are creating a hemicube. I have got the code to render the scene into a texture and therfore an array. Now how can I generate a so-called ...
1 vote
0 answers
54 views

Pros and cons of caching uniforms

I am using LWJGL, and I have a ShaderProgram class that abstracts a GPU shader. I have a bindUniform(int location, Object value) ...
1 vote
1 answer
89 views

Does OpenGL have any automatic texture interpolation?

An image of a minecraft grass block in gimp: Loading from a texture atlas in OpenGL, gives a much blurrier image: I know that the actual image in my glfw window is larger than it is in gimp. (...
0 votes
1 answer
49 views

Mouse Ray Picking: Z-Coordinate of Projected vector (glm::unproject)

I've run into a curious issue when implementing ray picking in my game engine. It seems the Z coordinate of the Projected matrix has to be ever so slightly more than ...
1 vote
0 answers
25 views

Issue with Bullet3 contact points on triangle edges

I'm trying to build a character controller using Bullet3 with OpenGL. I currently have a kinematic body that uses a Ghost body to get all the manifold contacts. The issue I'm facing is in the ...
-1 votes
1 answer
45 views

Shader compilation error

This is the begin of my vertex shader code: ...
7 votes
1 answer
4k views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
0 votes
0 answers
74 views

Order-independent rendering of 2D sprites

I am using OpenGL to render sprites, using an orthographic projection. Each sprite has a position: (x, y, ...
0 votes
2 answers
84 views

Correctly packing an RGBA color to a single float

I am trying to render a colored quad with LWJGL and OpenGL. The vertices array is specified in interleaved format and look like this: ...
0 votes
1 answer
32 views

Having a problem with tangent/bitangent calculation for my meshes

Hy Guys, I have a very specific problem according to normal mapping. I am writing a very simple 3D engine just for fun, following the tutorials at "LearnOpenGL.com". So far, it is working ...
0 votes
0 answers
81 views

Wrong Animation with OpenGL and Assimp

im currently trying to render an Animation with OpenGL. I load the Model and the animation with Assimp.net an C# wrapper from Assip. Rendering the Mesh works fine but everytime when i try to update ...
19 votes
5 answers
57k views

How can I orbit a camera about it's target point?

I'm drawing a scene where the camera freely moves about the universe. The camera class keeps track of the view (or look at) point, the position of the camera, and the up vector. These vectors/points ...
1 vote
0 answers
45 views

UV map shift for VFX & shaders

(I would like to say right away that I personally am not a programmer and may not be so competent in what is said below.) My friend and I are creating a small "game" engine. We have a task ...
0 votes
0 answers
59 views

GLWpfControl and OpenTK force graphics adapter

I am using GLWpfControl and OpenTK for a Game that I'm developing. The game has a lobby which runs on WPF and C# and I used GLWpfControl for the OpenGL stuff. The problem lies on my laptop that has ...
3 votes
1 answer
2k views

Converting Euler rotation angles from Z up to Y up (Max to OpenGL)

I'm working on pulling geometry and it's transformation from a 3DS Max exported FBX (Z-up) to an OpenGL model format (Y-up). The main problem is I intend to keep the transformations as Translation and ...
3 votes
1 answer
59 views

Running a standalone Godot application on a Yocto 2.6 system with OpenGL3.0/ES2.0 hardware

I have an application that displays construction machines like excavators or snow groomers. The application is built on my company's custom engine, but I am trying to find out if I can port it to a ...
0 votes
0 answers
50 views

Bullet physics incorrect rotation with more than one axis

im try to integrate currently bullet into my game framework. But when i try to set the rotation for an rigidbody with more the 1 axis i recive the current result It looks that the rotation is ...
0 votes
1 answer
78 views

GLSL ported shader not working in HLSL

I have been working on an Infinity Grid shader for my engine. It was already implemented to Vulkan’s GLSL, so it worked great with OpenGL’s (4.6) GLSL. Here's a reference. This basic shader with ...
0 votes
0 answers
32 views

tangents and bitangents or larger textures?

This is more of a performance question than anything, but some time ago I learned that to put normal maps in OpenGL 3D rendering, I could do it in two ways... The first is generally what most people ...
0 votes
0 answers
93 views

Cmakelists.txt with sfml/glew/glm .exe doesn't work

I am working on a game in c++, i want to make a Cmakelists.txt file for build a .exe file. ...
0 votes
1 answer
82 views

How to setup gradient lighting in OpenGL shader?

I setup simple single light source lighting around campfire object. However, as can be seen, the transition between lightened area and unlighted one is sharp. The GLSL fragment shader code: ...
16 votes
3 answers
22k views

When to use a vertex array and when to use a VBO?

I'm trying to learn about vertex arrays and vertex buffer objects, but I don't understand the differences in terms of: case-of-use (static geometry like terrains, geometry that changes every frame ...
0 votes
1 answer
392 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 ...

1
2 3 4 5
87