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
1answer
27 views

GLM conversion from euler angles to quaternion and back does not hold

I am trying to convert the orientation of an OpenVR controller that I have stored as a glm::vec3 of Euler angles into a ...
-1
votes
0answers
40 views

What's a good Open Source c++ 3d rpg games with opengl to learn from? [closed]

i am learning game development with c++ and OpenGL i am looking for 3d open source game for learn from it
0
votes
0answers
38 views

Incorrect UV Sphere Mesh Generation

I am following the same algorithm to generate the mesh of a UV Sphere as described in this wiki: http://wiki.unity3d.com/index.php/ProceduralPrimitives#C.23_-_Sphere My implementation is in C++. I am ...
-1
votes
1answer
40 views

Render output difference cause

There are two 3D applications compared side by side: I'm looking for difference cause. These might be the cause, but I'm not sure: Color Lighting Shading code (GLSL) ? Can anybody help me with ...
1
vote
0answers
43 views

Is Loading Assets Before Game Start Necessary? [closed]

I am creating a relatively simple game engine that uses opengl. Do I need to create a system that loads all the 3d models / textures from files before the game starts, or is loading them during ...
0
votes
0answers
44 views

Tube model imported from Blender getting stretched vertically when rendering

I'm actually working on a 3D game engine with OpenGL 4 and C++. The problem is that, I don't know why, my geometry isn't well renderered except for primitives. At the right you can see a cube, it is ...
-2
votes
1answer
93 views

How to create GUI or Menu for games?

I've advanced quite well in OpenGL and in graphics. However I lack a lot of experiences. I have had this question in my mind since the beginning of my venture, how do I create UI or Menu for my game?...
0
votes
1answer
55 views

Confused about why my projection matrix works

My projection matrix was buggy, I'm not great at mathematics, but I checked it against the the songho tutorial, and the broken one seems correct to me but switching nearplane to farplane seems to ...
0
votes
1answer
30 views

Performance of Tristrip vs Indexed Triangles in OpenGL

Let's say that I want to take advantage of GPU transform cache and use tristrips for that purpose. In the first case we have three triangles: 012, 213, 234. In the second case we used tristrip ...
11
votes
2answers
5k views

Is it a good option to simultaneously work on a game and a game engine? [closed]

I'm considering this, now I work on 3d game but I want also to make in slow tempo, iteratively a game engine is it a good choice? The game what I working on is with non custom engine (Unity, Unreal ...
1
vote
1answer
58 views

How do rendering pipelines improve the performance of updating all the vertices every frame?

Let's say I am implementing a simple game engine, particularly the rendering part. From the high-level view we have some vertices which are copied to the graphics card alongside shader information etc....
2
votes
0answers
26 views

How to draw lines round selected objects and lights?

I need two things to draw in Modern OpenGL. Please see the image: Draw lines to represent light's position and direction Draw xyz axises at the origin of a selected objects How do I draw these? ...
1
vote
0answers
36 views

How to convert screen to world coordinates while using gluLookAt / gluPerspective or similar matrix transforms?

I am just starting an adventure in looking under the hood of graphics for a game project I've been working on for a while, and I could use some guidance. I am using Python/Kivy (though that is not ...
0
votes
0answers
33 views

How to code the effect where a 3d avatar is obscured behind an opaque object

So, in any Super Mario game since the Game Cube, I think that any time an opaque object is between Mario and the camera, Mario is rendered as a silhouette? How would you render something like that. ...
0
votes
0answers
37 views

What are the options when float textures aren't precise enough?

I am currently experimenting with rendering planetary scale terrain. I am generating the terrain on the GPU with noise, and to fix the 32 bit floating point precision problems, I generate the ...
0
votes
0answers
21 views

Calculating PBR Lighting returns weird results at (0, 0, 0) or lower positions

I'm writing a Physically Based Renderer with the help of this tutorial here https://learnopengl.com/PBR/Lighting The vertex shader they use can be found here: https://learnopengl.com/code_viewer_gh....
0
votes
0answers
21 views

Handling metallic roughness maps colour channels

I'm trying to use a metalness/roughness workflow and I'm not sure how to translate the colour channels into the different metalness and roughness attributes. I'm not sure if there's a standard on how ...
1
vote
1answer
95 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
1answer
67 views

How do i writing timing function for lightning flash in C++?

I need to write a horror scene with lightning flash. Unfortunately I am new to both C++ and OpenGL and I am looking for efficient way to mimic lightning timing in C++/OpenGL? I don't need graphical ...
0
votes
0answers
20 views

Calculate normals given vertices and indices [duplicate]

Can I calculate normals given vertices and indices? Can't figure out the code. Any help appreciated. Edit: Could be it as simple as?: ...
0
votes
0answers
42 views

How to calculate normal from normal map in world space? (OpenGL)

I'm trying to do normal mapping in a deferred renderer and I'm stuck on how to implement normal maps. I have a bool that passes whether or not to use a normal mapped value and thus, whether to ...
0
votes
0answers
23 views

Wrong Bone deformations using assimp

Hi I'm trying to animate a skinned mesh in my game using assimp and OpenGL. this question is a follow up of this one : OpenGL Strange mesh when animating Assimp But I'm having diffuculty ...
0
votes
0answers
19 views

OpenGL call glDetachShader after linking program

Im currently working on my ShaderProgram class for my simple OpenGL Renderer. I am passing and attatching my Shader objects like this: ...
0
votes
1answer
74 views

OpenGL Strange mesh when animating Assimp

I'm trying to animate a skeletal mesh. The mesh loads with no problems and all is set up correctly. My problem is that when I calculate the matrix for a given keyframe the mesh go nuts. Here is na ...
0
votes
1answer
82 views

VAO not showing

My VAO is simply not showing up and i'm not sure if my matrices are wrong or if the shader is wrong… Please have a look a see what is wrong… My code is big so i'll post the essential. ...
2
votes
1answer
93 views

OpenGL Two-point perspective view

Summary: I want vertical lines to be drawn as vertical lines regardless of their position relative to the camera (distance/offset). I want the projection to be perspective so the furthest objects ...
0
votes
0answers
20 views

3D terrain editor brush using compute shader

i am working on 3D terrain editor, and i have simple brush for adding or subtracting height. Right now I am calculating new Heights on CPU dependent on brush radius. ...
1
vote
1answer
41 views

How can I implement a side scrolling seamless fog shader?

I've run into a problem trying to code a 2d game. The way I've set up the game is that you run through underground dungeons and fight enemies, for ambiance I've added a smoke/fog shader to superimpose ...
2
votes
0answers
44 views

Orthographic camera produces strange results

I've created a basic orthographic camera using the following view projection matrix: ...
1
vote
1answer
82 views

How do I render a word in the middle of the screen using FreeType and OpenGL?

I'm following this tutorial series on making a simple 2D clone of the classic Breakout game, but its author doesn't mention how to render a whole word or sentence in the middle of the screen. He ...
0
votes
1answer
38 views

Unable to create OpenGL window in SDL2

I am currently working on a C++ + SDL2 game engine and I am stuck on a problem. The problem is that whenever I pass SDL_WINDOW_OPENGL to ...
0
votes
0answers
68 views

Texture dimensions guidelines

I have 3 related questions: What are the main optimizations related to power of 2 dimensions for 1D/2D/3D textures? This question gives some answers like mipmapping, but are not well explained and ...
1
vote
0answers
54 views

How can I apply my camera to all graphics objects?

Is there a way to have the camera be applied to all objects? Can you have the camera effect objects that where made with glVertex3f(); This is the fourth time I ...
0
votes
1answer
80 views

Porting C# OpenGL rendering code to C++ DirectX

I have the following rendering method written in C# and apparently using OpenGL immediate mode, and i'm trying to port it to C++ and DirectX: ...
-2
votes
1answer
73 views

Why is my map not drawing properly?

My code compiles fine but for some reason, I get this white background in my window. what am I doing wrong? I want to draw my map (sorry, there is a lot of code). Here is my debugged window image: ...
0
votes
0answers
15 views

How to get normals in the FBX SDK?

I'm working with FBX SDK and I'm trying to get normals of my model but I have no idea of how to do it and I dind't find anything on Google. I am using C++. I hope you'll be able to help me !
1
vote
1answer
85 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
138 views

How is root motion done in Skeletal animation

I am using Assimp library to load bone and 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
2answers
52 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
40 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
62 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
59 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
vote
0answers
72 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
36 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
46 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
65 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
2answers
53 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 ...
0
votes
1answer
76 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
50 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
62 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 2 3 4 5 79