Skip to main content

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
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
84 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
33 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
99 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
87 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
396 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 vote
2 answers
380 views

How to keep same aspect ratio in different devices with cocos2dx?

I have been making a board game and I am using cocos2dx. There are two scenes for now, One is main menu and the other is gameplay scene. When I run the apk on tablet with EXACT_FIT resolution policy ...
1 vote
1 answer
140 views

How do I make the joints and weights skinned with the variables I'm using?

For some time now I have been trying to do skeleton animation using Rust and OpenGL(specifically the gl library), I loaded the animation information correctly(with the gltf library), the bone ids and ...
0 votes
0 answers
39 views

How do I pick terrain in GLSL/OpenGL by picking 2D vertices positions?

Presumably the problem is with the internal formats and my understanding of that, but I've been stuck a while, got this sort of approaching working fine on a more straight forward colour picker, but ...
4 votes
2 answers
1k views

In OpenGL, why do people worry that the accuracy of the depth buffer gets worse the farther away?

I'm really new to graphics programming, so I'm learning about depth buffers with this article. I got that the conversion from View Space to NDC is non-linear, but I think we can avoid the problem by ...
1 vote
0 answers
121 views

Is there a reason that we have to use homogeneous coordinates in rasterization?

Looking at the pipeline of games, I am confused about the necessity of homogeneous coordinates. For gameplay logic, a 4x3 matrix is enough to handle translation, rotation, and scale. I can't think of ...
1 vote
1 answer
5k views

Understanding how to use Quaternion to rotate object

I m having hard time to understand Quaternions and to use them in my engine for rotating object. I m looking for step by step explanation, actually a correction of my view of Quaternions. Here is how ...
0 votes
1 answer
82 views

Setting up perspective projection in OpenGL

I'm trying to set up perspective projection in OpenGL but it doesn't work ...
0 votes
0 answers
45 views

Spherical Billboard Effect

I try to make a spherical billboard that follow the camera's direction. But, the result that I got is model get distorted or event twisted. If I'm using only a yaw/pitch quaternion per time, it works ...
1 vote
0 answers
260 views

Screen Space Reflections: Artifacts problem

I'm trying to implement a simple (so far) screen space reflections shader. Below is my code: ...
1 vote
1 answer
485 views

OpenGL - Debug version runs faster than Release version

My Visual Studio 2019, 64-bit version of Tetris using OpenGL runs significantly faster, 3X, in Debug mode than in Release mode. The image above shows the board. Each cycle of the rendering or game ...
1 vote
1 answer
372 views

Replacement for glDrawElementsBaseVertex in OpenGL ES?

I am porting my game engine(c++) to Emscripten, which unfortunately only supports OpenGL ES 3.(Not 3.2) Therefore I don't have access to glDrawElementsBaseVertex, which is needed by my renderer(...
1 vote
1 answer
723 views

No vertex shader bound at draw?

I tried asking this on reddit but I didn't get any answers so I might as well try here So I'm making a program to generate some terrain and it's not giving me the results I expected. It's drawing ...
1 vote
1 answer
144 views

Is texture switching a good idea (OpenGL, 2D)?

Let's say I have two atlases for character animation. One atlas represent idle and walk. The other one represents striking. I usually combine atlases into one file, however I thought about using ...
1 vote
2 answers
197 views

Seam visible on sphere or torus made in Blender when using a texture atlas

I'm making a game in OpenGL with C++. I have a problem with my vertices or texture coordinates - there's a seam visible on the sphere where the texture wraps around: If I use "nearest" ...
2 votes
1 answer
49 views

I can't find what I'm doing wrong when rendering a point light that is clipped by the floor

I have a top down camera on my game, and I'm rendering a point light on my opengl fragment shader. When the point light is far away from the floor it looks like I would expect it should look, like a ...
0 votes
0 answers
76 views

GUI shader that draws different textures on corners, edges, and center?

I'm working in GLSL but feel free to write a solution using any shader language, or even pseudocode / language agnostic, I can translate it myself. I'm trying to create a shader that can draw a "...
1 vote
1 answer
2k 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
0 answers
52 views

Flipped normals and texture flickering on Motorola and Samsung Android phones

What is happening to the textures when playing on the Motorola Android phone? Deleting and creating new materials doesn't work, the problem persists even with new materials, material overlay or ...
1 vote
1 answer
2k views

Texture object and texture unit in GL

As I understand texture usage consist of two parts How to store this discrete data about texture internally. How much dimensions, channels, etc. How to fetch/sample/filter The question relative to ...
0 votes
1 answer
70 views

Normal map lighting is just slightly off

I've been trying to implement normal mapping into my custom OpenGL shader. The result I'm getting is almost there, but it looks like the Point Light is not ...
23 votes
1 answer
6k views

Optimization of rendering of cube world

I have a world made of many cubes (like in Minecraft), they have only color (not texture). I am rendering them using OpenGL 3.3 core profile (GLFW3, GLAD, GLM). I am already have done some ...
12 votes
3 answers
1k views

How to hide a post-processed mesh outline when/where the mesh is hidden

I'm working on setting up an active outline in my 3d engine, a highlight effect for selected 3d characters or scenery in the screen. After working with the stencil buffer and getting some ...
0 votes
1 answer
91 views

What is this jitter caused by moving at high speed?

I used jumping real high as an example to show the jitter. what is causing the jitter issue? I can provide code for various parts of my engine if requested.
0 votes
0 answers
44 views

Moving a texture with a vert shader

I'm working on a mod for a game and trying to add my own shader. I know practically nothing about shaders, but another similar shader exists and with their modding teams permission im using it as a ...
1 vote
1 answer
163 views

GLSL 9-Slice (or 9-Patch) working with single texture, but not with atlas texture

I've been able to implement 9Slice for textures when the texture is just itself, that means, it does not contain any subtexture except itself. This is the code I'm using: ...
0 votes
0 answers
29 views

LibGDX Table rendering order draw calls

I'm using LibGDX Table for drawing some simple structure but I am having problem with draw calls and texture binding handling. For clarification, I have a ...
1 vote
1 answer
286 views

Is OpenGL 2.0 possible in unity?

I want to develop a game in unity, just a small scale simple game without heavy computation nor complicated feature, and does not use a lot of ram either (2-3 GB). I want player with "outdated ...
0 votes
0 answers
43 views

Some faces of mesh are showing much darker than they should be

Hello, My traffic light model has some dark faces and I can't seem to understand why? I am using OpenGL. This is my fragment shader: ...
7 votes
3 answers
3k views

Terrain & Multi-Texturing

I'm using OpenGL (Version 4.4) (and C++ if that matters). I've created a terrain renderer, the terrain is stored as a 3D scalar field (isosurface/voxels). It uses a slightly modified version of ...
0 votes
2 answers
320 views

Cannot Draw a triangle without VAO on MacOS

So I was watching Cherno's Video on Vertex attributes and he was successful in drawing a triangle without a VAO, but in tutorials from learnopengl.com they specifically say they we need a VAO to draw ...
0 votes
1 answer
84 views

Skybox not texturing

I have looked for a solution for a little while now however I'm not sure if other people have encountered my same problem. I am trying to draw a skybox in a blank opengl window, I have camera controls ...
1 vote
2 answers
1k views

Switched from immediate mode to VBOs, game runs slower

I'm trying to improve the draw performance on my c++, OpenGL, SDL game. Back in school we ...
0 votes
0 answers
43 views

Manual calc of perspective projection and getting point on the screen

I'm need to draw the red rect on the first vertex of gray platform. To begin with, I draw a gray platform with a perspective projection and set it using gluPerspective: ...
1 vote
0 answers
63 views

LWJGL3. A strange graphic artifact of OpenGL 3.x

I work in java with lwjgl3. I came across a strange artifact, the source of which I have not been able to determine for a very long time. I'm drawing a large surface. When I approach this surface and ...
0 votes
0 answers
52 views

Clarification on scene graph implementation. Adding object/node to a root node or container?

I learned about scene graphs from this chapter on learnopengl and using this I'm trying to make a simple imgui window that can display the scene graph, but one thing that wasn't made clear/I'm having ...
4 votes
1 answer
601 views

Limit/Clamp camera movement using quaternions

I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
21 votes
2 answers
7k views

What is a "normal" in game development

I'm new in Game development and probably this is a silly question. I had a look online but haven't found a clear answer, I did it bit quick but enough to evaluate that this is a confusing topic ...
3 votes
1 answer
475 views

Why does scissor test happen after fragment shading?

In OpenGL why is scissor test performed after shading. Wouldn't be more efficient to do the discarding before shading? Reference pipeline overview, the scissor test is inside the Fragment Processing ...
0 votes
1 answer
447 views

How can vertex position can be converted to fragment position?

I started learning open gl and graphics programming for a while (im using open tk as im working on c#) so i finally came across lighting where you make the ambient diffusion. Im pretty sure that you ...
0 votes
1 answer
145 views

Increased CPU usage when rendering sprites

I'm creating a game in modern OpenGL, C++ but I'm having problems with optimization. Whenever I render the sprites the CPU usage starts to increase. Code: ...
0 votes
0 answers
316 views

PyOpenGL "Attempt to retrieve context when no valid context" - seems to be Linux specific?

I've been trying to learn PyOpenGL, so I'm still pretty clueless about what's going on. I've been following a video series. I couldn't get it to stop throwing "Attempt to retrieve context when no ...
0 votes
1 answer
326 views

Fade edges of 2D spline-mesh

I'm re-writing my Unity game in Raylib and are trying to recreate a path/road-shader I made with Shader Graph. The first picture is how it looks in Unity, with faded/blurred edges. The path is a 2D ...
0 votes
1 answer
2k 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 ...

1
2
3 4 5
87