The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
-1
votes
0answers
24 views

Understanding SSBO vs UBO

I'm trying to understand the difference between SSBO and UBO (Shader Storage Buffer Object and Uniform Buffer Object). From what I read, they look pretty similar. Is there one that is better than the ...
1
vote
0answers
18 views

PyOpenGL Cubemap ARB Texture not rotating with gluSphere

I've made a gluSphere render in my display and have given it a cube map texture of the Earth. The texture is visible just fine (see below), but I cannot get it to rotate along with the shape. this ...
1
vote
2answers
52 views

Should calculations be done on the CPU or GPU?

I'm currently learning OpenGL and it's become obvious that I can do most calculations on the CPU or the GPU. For example, I can do something like lightColor * objectColor on the CPU, then send it to ...
1
vote
1answer
35 views

How can I clip my sprite as it passes through a portal in a 2D scenario, using OpenGL?

This is a very simple question, but after a brief search and reading through the "similar questions" I could not yet find an answer. I'm creating a 2D game using OpenGL and came across a problem: Let'...
0
votes
1answer
20 views

Flat shaded triangles using the ModelBuilder?

I decided to give the ModelBuilder a try but I cannot get rid of the smoothing of my terrain. So what I tried: Create each triangle individually with there own ...
0
votes
1answer
23 views

Calculate normal angle in screen space

I'm working on adding billboarded sprites to a game engine, but the engine allows for walking on curved terrain, like spheres. In order to look like the player is walking on the terrain, I want to ...
1
vote
1answer
32 views

Taking cube from camera space to clip space, error in my math?

watching Ken Joy's Computer Graphics lectures on youtube. One thing I'm confused about is after he gets the cube from the camera space to clip space, from my calculations the cube doesn't look like ...
2
votes
1answer
32 views

GLSL variables as main function params vs on their own line?

I am learning OpenGL and GLSL. I was taught that the in/out variables should be formatted like this: ...
1
vote
1answer
60 views

How to stop scrolling of text in OpenGL

I want to set a time limit for scrolling text in OpenGL & GLUT. How can I stop scrolling at 250? Here is my code. I try with the if condition but it's not working. The scrolling is not stopping in ...
0
votes
0answers
19 views

Make perspective camera X positive values to the right

Is it possible to make the positive values of the PerspectiveCamera to the right? By default is to the left
0
votes
0answers
32 views

Depth Test Problems with LWJGL3 (GLFW)

I know: similar questions have been asked - but I didn't find a solution. So at first the basic problem: It seems that convex Models (currently I load them from .obj files) render fine, but concave ...
0
votes
0answers
60 views

What does the keyword “interface” mean in GLSL?

interface vs_out { vec3 get_color(); }; struct vs_out_impl : vs_out { vec3 get_color() { return vec3(1,0,0); } } Where is this behavior defined? ...
0
votes
0answers
48 views

Rendering up close, OpenGL performance issues

I have been developing a massive RTS during the past 18 months, which is comming together nicely! Now i have an issue i can't really wrap my head around. If i render 100 models from a distance ...
0
votes
0answers
25 views

OpenGL 2D Batch Rendering: Textures mixing when having multiple active textures

This is what happens when I draw switching from the black texture to the lime green one in a simple for loop Here's a simplified version of how my renderer works Init(): Create my VAO and attrib ...
1
vote
1answer
50 views

What should the Z coordinate be after transformed by the projection matrix?

I'm working on an OpenGL 1.x implementation for the Sega Dreamcast. Because the Dreamcast didn't have any hardware T&L the entire vertex transformation pipeline has to be done in software. What ...
0
votes
1answer
35 views

Opengl the light position always on the origin point therefore the diffuse and specular does not work

I am newbie of opengl, so I did the tutorial by learnopengl. I have a strange problem when I was trying to do the light effect (ambient, diffuse and specular). For the diffuse, the effect appears on ...
0
votes
0answers
35 views

Weird behaviour with glsl shaders

Dear people from the forum, I am trying to develop a game prototype which uses OpenGL and I am designing the entire graphic engine. My game requires some tricks with the shaders, and therefore I had ...
1
vote
1answer
54 views

OpenGL strange depth test behavior

I have a simple OpenGL program that renders terrain with a texture. It exhibits some strange behaviors (see video) that look similar to depth test issues. However, I have already enabled depth test. ...
1
vote
1answer
51 views

Model gets distorted when rotating the camera

I'm currently developing my own 3d graphics engine and I'm having a hard time figuring out why my 3D models gets distorted when rotating the camera around. This is my projection matrix. I'm following ...
3
votes
0answers
36 views

Strange normal mapping artifacts - OpenGL / GLSL

I have been following a few tutorials to learn some graphics programming with OpenGL, and recently implemented Normal Mapping. It works well for the most part, especially for objects with normal-...
0
votes
0answers
19 views

Understanding ticksPerSecond and duration with skeletal animations

That's my first question here so i hope to do all correctly. From various weeks i started surfing the net about Skeletal animation aiming to add a simple animation controller into my small game engine....
0
votes
1answer
42 views

How to properly scale from natural coordinates to screen coordinate system in OpenGL?

I am working on a Physics Engine, and I have been using opengl to visualize what it's doing. I think I have a scaling issue when going from natural coordinate system to the opengl screen coordinate ...
3
votes
0answers
31 views

issue with Compute Shader macbeth chart

I'm trying to generate a macbeth chart using the compute shader, but there seems to be an issue with the output image. here is the glsl code: ...
0
votes
1answer
30 views

Graphic render speed in libgdx using many sprite sheets

I am currently working on a customizable Player-character for my top down view 2D pixel game. I am using libgdx and aiming for android devices as well as desktop applications. I am wondering about an ...
0
votes
0answers
31 views

Animated texture from movie file for pre-rendered custcenes

I'm at a point with my game/engine where I need to be able to display pre-rendered movies as cutscenes onto a plane as an animated texture, say something I rendered as an animation in a raytracer that ...
0
votes
1answer
24 views

JNI Error when Wrapping Jar with JOGL using Launch4j

I have been trying to wrap my fat JAR file into an EXE using Launch4j, but I have been running into problems when I try to execute the EXE. Here is the error log I get from Launch4j: ...
0
votes
1answer
45 views

Which is a better way for moving 3d objects in OpenGL?

I'm learning OpenGL, and I'm a bit confused. I've just learned about projection and modelview matrices which can be used for moving things. This is the first way, which is convenient if I want to move ...
0
votes
2answers
98 views

How to decorate the floor with a grid?

I got this photo from mixamo.com — I want to draw grid lines similar to this on my floor. I'm sure this is easy by using textures, but I'm trying to avoid using textures as much as possible. Is there ...
0
votes
1answer
59 views

Soft Body rendering from OBJ model

As part of my master thesis I have to do an softbody simulation. I 'm using Bullet Physics engine. I'm trying to render softbody, create from Meshes, with Shaders in OpenGL but the object doesnt ...
0
votes
0answers
34 views

LWJGL 3 - problem with flickering when rendering terrain with colors

For while now I m trying to built a terrain generator for my game engine and again I'm stuck with problem. I'm trying to generate a terrain using colors, so no textures. In short my problem is ...
0
votes
1answer
26 views

Do UV coordinates need correction for moving object?

The image above is a static capture of a dynamic OpenGL project I created in which I wrapped a NASA albedo, i.e., sans clouds, image on an OpenGL generated sphere. In so doing, I also generated the ...
0
votes
2answers
84 views

How to load assets into the game engine editor fast?

I am making a game engine with C++ and OpenGL. Currently I'm stuck making the asset explorer. I would like to be able to import assets into an engine project and then when I open the project just use ...
0
votes
0answers
55 views

Assimp scale model, bones and animations

I'm trying to import animated models from Mixamo, but their unit scale is centimeter while in my application I use meter. In Assimp-4.1.0 it is possible to perform scaling when importing a model with ...
2
votes
1answer
45 views

Flat Shading does not work correctly (openGL)

So currently I'm trying to implement flat shading into my engine using glsl's flat qualifier, and I have encounterd a really weird bug. Somehow the lightning on terrain isn't spread correctly, I want ...
0
votes
0answers
95 views

OpenGL.error = 1282 How to fix it?

I'm running a python script in Nvidia xavier board using a pyqtgraph.opengl and I installed python3-pyqt5 (5.10.1 installed, and qt 5.9.5) When I run this script below ...
3
votes
1answer
223 views

GLSL shader algorithm to render a sprite map with a single draw call (on a single sprite mesh)

I'm trying to render a tile map world on a single sprite mesh (instead of one sprite per tile.) This significantly reduces the array vertex bus labor for extremely large worlds: In order to do this, ...
2
votes
1answer
125 views

How to preserve Arcball rotation in c++ OpenGL?

Firts of all want to say that I've already searched for other people's answers here as same as Google and didn't found anything about it there. Also tried some others arcball implementations but none ...
5
votes
1answer
94 views

instancing and GPU skinning

I'm trying to render a large number of identical rigged entities with independent animation. Compared to standard skeletal animation, I can't compute the pose of each entities and send it to the GPU ...
0
votes
1answer
49 views

Synchronizing with monitor refreshes without vsync

What is the preferred way of synchronizing with monitor refreshes, when vsync is not an option? We enable vsync, however, some users disable it in driver settings, and those override app preferences. ...
0
votes
0answers
34 views

glDrawArrays: Erasing the buffer between calls?

I have two VBOs, assigned to names 1 and 2. Only 2 is being drawn. However, if I comment out VBO 2, VBO 1 is drawn with no problem. Here's the relevant code. ...
0
votes
0answers
34 views

I need help debugging this Spotlight implementation

I'm hoping someone can help me debug this wacky implementation of a Spotlight done in Java LWJGL that I found online. Basically, I found the bug, but I cannot figure out how to fix it so that the math ...
0
votes
1answer
27 views

OpenGL: glTangent? [duplicate]

In the glext.h header there is the group of functions with the prefix glTangent. It has signatures similar to the ...
0
votes
0answers
30 views

Qt opengl glTexImage2D in a widget

I was doing an OpenGL display, where I render in an opengl context (GLUT). But now I would like to integrate it into a big project that does not use the Qt OpenGL API at all (QGLWidget, QOpenGLWidget,...
2
votes
3answers
70 views

Replacement for glMatrixMode() in OpenGL 4?

In OpenGL version 3.x the function glMatrixMode() specifies which matrix is the current matrix, i.e., which matrix stack is currently the target of all matrix ...
0
votes
0answers
36 views

Using a PBO glTexSubImage2D with GL_PIXEL_UNPACK_BUFFER gives GL_INVALID_OPERATION

I plan to develop a tool for realtime video manipulation using C++, QT 4.7.4 and OpenGL and i'm on visual studio 2008. I check many web site but my code doesn't work since I try with PBO. At the ...
2
votes
1answer
78 views

How to store noise in a GL texture

I find that my procedural simplex noise in my fragment shader hurts performance, so I thought I would just use a stored noise texture instead. I would like my noise values to have better than 8 bits ...
0
votes
1answer
42 views

Rendering multiple textures on same image for terrain with index buffers (LWJGL 3)

I have started with LWJGL3 and trying to built game engine. I'm stuck on generating terrains and this is my second big problem and I'm exhausted so I need some advice on how to solve my problem. What ...
2
votes
1answer
30 views

Problem with rendering multiple textures from same image (LWJGL 3)

I have started with LWJGL3 and trying to built game engine. I'm stuck on generating terrains. I have one image that contains two textures. So now for example I want to generate terrain with only ...
0
votes
1answer
52 views

JWJGL Multi-threading to separate update and render

Introduction: I am currently designing a game in Java using the LWJGL 3.0, with Gradle. I have quite an advanced knowledge on multi-threading, and I am aware how GLFW does/doesn't implement multi-...
1
vote
1answer
34 views

OpenGL: Shader using wrong layout location

It's actually taking the color vector instead of the vertex vector. I noticed because I set the colors to random(), and the triangle clusterfudge that is my cube keeps changing shape when I reload the ...