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
vote
1answer
30 views

How do game engines implement multiple rendering platforms?

How do game engines like UE4, Unity, Source, Cry Engine, etc add different rendering library's to their game engines? (Eg. OpenGL, DirectX, Vulkan)
0
votes
0answers
102 views

How root motion is done in Skeletal animation

I am using Assimp library to load bone & mesh data and using basic interpolation to accomplish the animation part. Right now I want to move my character position with animation i.e root motion. ...
1
vote
1answer
23 views

Problem with rendering a quad from four lines

I am having a problem with rendering a quad in opengl via 4 lines (5 vertices via GL_LINE_STRIP). The rendering is generally working fine in terms of connecting the lines into a quad. The problem is, ...
0
votes
1answer
33 views

OpenGL approach to depth-testing-like combination of a large buffer of fragments

I have a depth buffer and color buffer created by another effect. The buffer is more than double my screen size. It is not rendered from geometry, but as a whole it resembles a rendered scene with an ...
0
votes
0answers
48 views

Technique for Edge Detection Between Distinct Entities

I'm developing an application that renders large(-ish) scale graphs (i.e. nodes and edges) in 3D. We've recently been asked to add a flat shading mode, where the graph elements are displayed using a ...
1
vote
0answers
58 views

OpenGL streching up geometry

I'm developping my own game engine in C++/OpenGL 3 but I've got some troubles with my geometry. Indeed, when I render something everything is weirdly streched up : By tweaking scale values we can see ...
-1
votes
0answers
59 views

asteroids bullet hits the enemy ship

I am making an asteroids like game with 2 space ships. Well I have drawn 2 ships on the screen. Each ship can move and fire bullets at the enemy ship. I am using the sin and cos functions to make the ...
1
vote
0answers
70 views

Trying to Rotate terrain

I'm new to OpenGL and don't really know how to rotate a terrain. For my graphics class, I have a project I need to do that is making a tire using OpenGL and work that we done in class (my framework is ...
0
votes
0answers
31 views

Optimizing texture fetches with higher mip levels

Let's say I have some shader program in DirectX or OpenGL rendering a full screen quad. And in a pixel/fragment shader I sample some huge textures at random texture coordinates. That is one same ...
0
votes
0answers
44 views

Compute normal based on Voronoi pattern

I am applying a 3D Voronoi pattern on a mesh. Using those loops, I am able to compute the cell position, an id and the distance. But I would like to compute a normal based on the generated pattern. ...
0
votes
1answer
63 views

Four (4) color channel png has black “background”

I am experimenting with C++ code to load a png file, using libpng. When I get to the color data in the file, I load it into a std::vector. I have found that the ...
1
vote
1answer
45 views

Does GPU mipmapping assume the texture es gamma corrected?

I have been reading the Real Time Rendering book and stumbled upon this paragraph: For textures encoded in a nonlinear space (such as most color textures), ignoring gamma correction when ...
-2
votes
1answer
113 views

How to download and include OpenGL?

I am using Linux. What I need to know is what can replace the question marks. In the terminal sudo apt-get install ? In my C program ...
0
votes
1answer
71 views

How to load large arrays to gpu and render with OpenGL?

I am trying to make a volumetric rendering of a cloud. I have been defining the cloud density functions on the glsl shaders and performing ray-marching methods successfully. But now I would like to ...
0
votes
1answer
48 views

OpenGL object load in reverse

I am trying to load a model and it is loading it in reverse. When I am trying to rotate it 180 degrees it changes the lightning as well. I am not sure what I need to do to change the position that eh ...
0
votes
1answer
53 views

Only one triangle drawn

I am trying to render a quad with gl render mode GL_TRIANGLES with using element array buffer. Here is some code to explain process. Only the first 3 elements of indices array are drawn as expected. ...
1
vote
2answers
56 views

Parts of 3D model disappear during animation

I'm trying to properly play an animation done in Blender 2.8 inside my OpenGL application. When the animation is running, it happens that at some particular frames, some parts of the 3D model "...
2
votes
2answers
310 views

Why is enabling GL_FRAMEBUFFER_SRGB making the colours brighter?

My understanding of gamma correction is as follows: We want to do colour math in linear space so we can lerp etc. between colour values and get the results we expect. But human eyes don't have a ...
1
vote
0answers
27 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
3answers
98 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
41 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
28 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
28 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
35 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
85 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
20 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
38 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
62 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
50 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
35 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
56 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
55 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
39 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
56 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
53 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
47 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
23 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
45 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
33 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
36 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
33 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
45 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
52 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
112 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
67 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
37 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
27 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
94 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
87 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 ...