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
26 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
25 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
30 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
25 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
16 views

Qt opengl glTexImage2D in a widget

So for now, 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, ...
1
vote
3answers
43 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
26 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
62 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
26 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
0answers
52 views

I need help with OpenGL Quads Building a 3D room

I’ve been studying OpenGL for some time now and got very good at it to a point in my studying but the next adventure I’m trying to create a 3D room with a floor, ceiling, and walls and maybe a bonus ...
2
votes
1answer
27 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
38 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
29 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 ...
1
vote
1answer
85 views

OpenGL tile map rendering with 1 quad for all tiles and 1 texture atlas

I'm using lwjgl to experiment with 2D games. I made some maps with Tiled (small 30x30 maps) and currently I draw them by loading the tileset image as one texture and extracting from it the texture ...
2
votes
1answer
49 views

How can I make an OpenGl/GLSL varying vary throughout a quad instead of a triangle in OpenGl 3.3?

I am, like many others, currently working on a block-based game in C++ and OpenGl. Recently, I added ambient occlusion support. This ambient occlusion is created by modulating the brightness of a ...
1
vote
1answer
37 views

Translate operation is rotating?

...
1
vote
1answer
43 views

Opengl Airplane Camera

I am making a game in opengl and am trying to get a camera to follow an airplane. How can I get the camera to match the roll, pitch, and yaw of the plane? I am using glm as my math library. Thanks!
0
votes
0answers
22 views

Screen to world raycast imprecision

I am trying to convert screen point (mouse position) to ray in world space. It works, but it lacks precision. Here is the code: ...
-1
votes
1answer
79 views

object changing position when scaled

These are my matrices. when i move the pivot point to one unit in x and if the scaling is set to 1 than everthing works fine. the pivot point has moved to one unit and the cube has stayed in its ...
-1
votes
1answer
20 views

Cube not square and being clipped horrendously, color doesn't apply

I'm trying to create my own object-oriented graphics library and use it to make a ping-pong game. I am following some tutorials online, and one uses old-style code with individual calls to ...
3
votes
1answer
71 views

OpenGL Fragment shader: not all fragments showing colors

I'm writing a simple 3D renderer and while the model loads fine, the colors are off. Quite a few fragments in the model show no color at all. Here is the render: The locations of the blacked out ...
1
vote
1answer
28 views

How to use Pivot Point in Transformations

How to translate object using Center point I have a rectangle which has a center point away from the position of rectangle. when i rotate rectangle it rotates around its center axis. if i multyply ...
0
votes
0answers
58 views

OpenGL concatenate vertex data into one big VBO

I successfully can render two triangles (with a texture) that looks like the side of a crate and also "walk" around it. Also, a small .obj file parser is available which gives me a float array of the ...
2
votes
1answer
59 views

OpenGL Textures: Texture contains color lines when object is further away that some distance

I tried searching on the web but couldn't find a reason for this. When I render an object close to the camera, the object and texture renders fine. But further away from a fixed distance, it starts ...
-1
votes
1answer
90 views

OpenGL performs very bad on laptop

I'm trying to write a game using C and OpenGL, I wrote some rendering code and camera, but the game is very laggy, framerate is so low (probably around 10-15fps), however, if I launch the game through ...
-1
votes
1answer
49 views

When should MRT (Multiple Render Targets) be used?

I had a question about exactly when I should use the MRT. This is not about rendering models, but about post processing. For example, I need to draw some cubic textures (something like skybox ...
0
votes
0answers
46 views

Reconstruct world position from depth

I am trying to restore the position from the depths. I separately created a position map in view space, which I use as a basis for tests. But I can not get the same result when I try to reconstruct ...
0
votes
1answer
68 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
21 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
36 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
57 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
56 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 [...
2
votes
1answer
85 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
32 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
1answer
35 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
65 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
21 views

Quaternion rotation around center, undefined behavior

Here's my code: ...
0
votes
0answers
34 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
vote
1answer
46 views

Framerate limited by lack of mouse movement? [closed]

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
24 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
55 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
39 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
1answer
51 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
52 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
82 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
43 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
60 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
35 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. ...