Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
38 views

OpenGL C++ Drawing particles instanced performance

In my 2D Game Engine I'd like to reduce the amount of draw calls. I used to do a draw call for every particle, which yields worst performance. I've tried instanced rendering in OpenGL but my ...
0
votes
0answers
19 views

GLDrawableFactory.getGLDrawable removed in JOGL 2

I have recently picked up an old project (not written by me), and I was tasked with updating it from JOGL 1 to JOGL 2, so it can run on Java 8. There are a few problems with this. First of all, most ...
0
votes
0answers
27 views

OpenGL render your own world using tiles from google maps

Goal: I would like to create a UI/GUI that has a Google Earth Panel. In this Google Earth Panel I would like to zoom in a 3D world and out and label additional objects like sattellites etc. To ...
0
votes
1answer
54 views

Bullet Physics DebugDraw Unexpected Results

I'm integrating Bullet Physics into my project for collision detection and have just gotten some debug draw functionality to work. However, the results are not what I'm expecting. I have tried to draw ...
1
vote
0answers
53 views

Why projection window is between -1 and 1

Is it a convetion ? What we achieve with this ? I am reading about how the perspective and orthographic matrix is getting calculated and everyone is trying to normalize the homogenous coordinates to [...
1
vote
0answers
67 views

Why is my openGL rendering faster when I time it with GL_TIME_ELAPSED

I have some code that was rendering too slowly, as in there was a noticeable lag in when updating the screen in response to user input. I tried profiling the CPU side code, but that did not seem to be ...
1
vote
1answer
29 views

Texture with transparency not rendered correctly in LibGDX

The title might be a bit misleading but I'm having a hard time to explain the problem so I'll try with pictures: Same tree from opposite site: I'm trying to create a voxel game and at the moment I ...
0
votes
0answers
22 views

opengl shadow map peter panning effect

I am implementing the shadow map in opengl with opentk everything works fine except I have a peter panning effect that I can't solve it by changing the face culling to front then render to the depth ...
0
votes
0answers
62 views

something very strange in one of the collisions with OpenGL 3.3

As some of you know, I'm developing a game engine in C, and I came across a problem that left me kind of lost. When I was developing my collision system, I saw something very strange in one of the ...
0
votes
0answers
19 views
0
votes
0answers
30 views

The X axis becomes the Y axis after a quaternion rotation

I am making a FPS game, and I have a for loop where I place out "ground" objects. (pseudo code) ...
-1
votes
0answers
25 views

Trying to understand quaternion rotations

So I have been making a FPS game where I want a weapon to follow the camera, and the weapon should rotate in the direction the camera is looking. I have been using normal euler angles for this, but ...
1
vote
0answers
38 views

Framerate limited by lack of mouse movement?

Using Torque, it appears that the program is running at around 25fps when the mouse is still, but as long as I keep the mouse moving, the framerate can hit well over 300fps. What in the world would ...
1
vote
0answers
22 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
1answer
53 views

rotation matrix problems - opengl and own types

In an effort to learn things deeper I'm writing my own mathematics for the first time instead of using libraries. As far as I can tell my matrix multiplication is correct, and translation and scaling ...
0
votes
1answer
34 views

Apply 2D Texture on all faces of a 3D Cube

I am trying to render a 3D cube, and apply a single texture to all the faces of the cube. I feel like I am missing something critical here as it is applying to the front and back faces of the cube, ...
0
votes
0answers
36 views

C++ Mouse picking for ray to plane intersection

I'm making a C++/OpenGL application (decidedly without GLM), and I'd like to understand how to create a ray from the camera eye to the mouse pointer, as well as detect an intersection point from the ...
0
votes
1answer
49 views

How to render a trimmed sprite?

I used TexturePacker to create an atlas for me and I've read it into my game. I can use unrotated and untrimmed sprites and it works fine. Now I would like to support trimmed sprites and I'm running ...
0
votes
1answer
53 views

Multiple glControl on same winform is not working - OpenTK C#

I have to show frames from two cameras in two openGl control separately at same time. For that I have put two opengl control in my form and pass those frames to opengl accordingly. But when running ...
0
votes
1answer
33 views

Set / Get UserPointer - What Do They Do?

I see a lot of talk about glfwGetWindowUserPointer() and glfwSetWindowUserPointer() but I can't for the life of me understand what these functions actually do. From http://discourse.glfw.org/t/what-...
0
votes
0answers
41 views

Strange GLSL performance problems

I'm having weird performance problems with a GLSL shader I'm working on. This small example fragment shader: ...
0
votes
0answers
57 views

Quaternion Rotation after performing previous rotations

Have Quaternion \$ Q\$ which is rotated on the \$X\$ axis 90 degrees. \$Q\$ is now \$ (0.707106, 0.707106, 0, 0)\$. I want to rotate \$Q\$ another ...
0
votes
0answers
29 views

Draw sprite outline with sprite renderer in opengl

I'm using a scenegraph with the visitor pattern to draw sprites in my 2D GameEngine. It works great. Now I'd like to render the lines of the cube the sprite is rendered onto. ...
1
vote
1answer
85 views

OpenGL Lines between triangles?

I'm currently using marching cubes to generate a mesh, and have encountered this incredibly weird problem. Looking from below the terrain, these weird fully lit lines appear between every triangle. ...
0
votes
1answer
111 views

God rays shader - Trouble with sun position

I have found a shader that I like here: https://www.shadertoy.com/view/4dyXWy The code for the fragment shader from the link above is: ...
0
votes
1answer
39 views

what is the difference between the regular camera and the first person camera?

I'm asked to implement first person camera but all I know is the regular camera that moves when I hit specific keys and could anyone tell me the steps to implement it?
0
votes
0answers
45 views

understanding the basics of raytracing

I have got a sphere in my world space. I don't understand how can i find my sphere using my X and Y on my screen, because i don't understand what the value Z of my ray assuming the fact that we use ...
0
votes
0answers
50 views

OpenGL Context creation takes over a second

I'm rewriting an old 3D editor with the goal to make it faster and easier to use. I noticed the following method takes over one second to run. It's called in the app's initialization on the main ...
1
vote
1answer
57 views

C++ OpenGL texture warping

I'm currently doing simple 3D drawing in OpenGL but I have hit a roadblock I just can't seem to get around. The problem is happening with trying to load .obj files. I've written my own .obj reader. I ...
1
vote
0answers
46 views

Shadows are not showing up

I am fairly new to graphics programming, and I am working on a rudimentary game engine in C++. I had some old graphics code written in Java that I translated, but for some reason the shadows are not ...
0
votes
1answer
31 views

How can I avoid the precision loss when recentering objects on open terrain?

For a better context this question is related to this one: What's the largest "relative" level I can make using float? When the player is moving too far away from the center, all the ...
0
votes
0answers
21 views

How to render parts of the screen with different FOVs?

I want to render my scene twice on the framebuffer. Once with the full screen at 160 degree FOV.. Then render a smaller 45 degrees FOV view over the top of it. The tricky part is I want the ...
-1
votes
1answer
44 views

How to implement trail renderer like unity?

I wang to implement a trail renderer in my course about compute graphics using OpenGL. I google this question and search it in https://gamedev.stackexchange.com/ and find nothing except unity trail ...
0
votes
0answers
27 views

Cascaded shadow map proplems

I am implementing the cascaded shadow map technique with OpenGL and C++, I have some strange behaviors I think my issue with calculating the frustum orthographic matrices, corners and cascaded ends, I ...
0
votes
0answers
37 views

How can I get rid off the imprecision of the model matrix when I using WGS84 as the coordinate system to render the earth?

The global coordinate of WGS84 is too big, a float is not accurate enough. The only two ways I can come up with are using dmat replace for mat or transferring the modelview matrix rather than the ...
1
vote
0answers
34 views

MousePicking in LWJGL - How to do it?

I have been working on a mouse picker for a scene in 3d for a client, and been having issues implementing a proper mouse pick. His application does not use a camera, and I am trying to get the ray ...
0
votes
0answers
27 views

How to use opengl3.3 with CUDA using OpenGL Interoperability

I want to render a mesh whose vertices and surfaces are populated and constantly updated inside the GPU. For simple rendering using opengl3.3 alone, I have brought out the data from the GPU to CPU ...
0
votes
1answer
46 views

Texture Glitches When Drawn to Quad

Recently been trying to implement volumetric lighting. The alphaness texture comes out perfectly on Renderdoc, however a strange glitch occurs whenever I either try to directly render the texture ...
1
vote
0answers
49 views

OpenGL VAO buffer rebinding vs binding switching

I'm considering two different approaches to vertex buffer management in my OpenGL game engine. The first one seems to be pretty usual, but I haven't seen the second one being proposed or used anywhere....
1
vote
0answers
136 views

Modern OpenGL, 2D only, should I be using uniforms or VBOs for sprite transformation?

I'm new to OpenGL, I'm currently building a 2D game engine. Right now I'm only using one shader as I only draw textured quads (basically sprites). The thing is... I don't know if should I be using ...
0
votes
0answers
27 views

Alpha blending works when rendering to an FBO, but not when rendering to the screen buffer

My rendering pipeline goes something like this- Bind multisampled FBO Render GameObjects Render Transparent Objects Blit multisampled FBO to normal FBO perform any Post processing Render a quad ...
0
votes
1answer
47 views

OpenGL Fragment Shader simulate LCD slow response time

I have a very simple OpenGL view rendering 2 triangles with a single texture applied. The minimum setup for rendering a 2d game. What i do is redraw the texture for every frame and easily get 60fps. ...
0
votes
0answers
43 views

Particle system and 3D scene not getting rendered together

I have been following this lesson for implementing a particle system inside a 3D scene whose code is here in github. My entry point and initialization looks like : ...
1
vote
1answer
52 views

glReadPixels with GL_DEPTH_COMPONENT into PBO is slow

I need to read depth buffer back to cpu memory. It may be few frames old, so I use glReadPixels with a buffer bound to GL_PIXEL_PACK_BUFFER. I use several buffers and ping-pong them. Finally, I read ...
0
votes
0answers
32 views

How to reproduce examples from ShaderToy on my computer?

I am a beginner with computer graphics. I have some experience with drawing polygons, shaded surfaces, the use of geometry shaders, etc. I am trying to create a volumetric cloud/volume render shader ...
0
votes
0answers
27 views

how would I render particle system in a 3D scene in Opengl 3.3

I have a scene that imports .obj (Wavefront) files and I have written the shaders for rendering them in a scene with multiple light sources. Here are my Shaders: Vertex Shader: ...
0
votes
1answer
74 views

OpenGL 2D Game Render Help

I just recently started using C++ and OpenGL and I am running into an issue. I am not totally sure what I am doing so could you please tell me what I am doing wrong and what I could improve? Here is ...
1
vote
0answers
47 views

Random lines drawn on screen while all vertexes are correct

I'm writing a 2D program in which a monocycle follows a Catmull-Rom spline. My problem is when I write the circle, the drawing goes crazy. There is one line on the screenshot (which seems to be 3 when ...
0
votes
0answers
22 views

When trying to render a texture in opengl after including the stb_image.h file in the project i get a linker error

Initially i gave the path of the stb_image.h & stb_image.c file location C/C++ include directories as adding the header file directly to the project was not working.