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 ...

learn more… | top users | synonyms

0
votes
2answers
93 views

How to manage VBO geometry for constantly changing data?

Before going into specifics, I'm mostly interested in making simple 2D games with some 3D elements, not fancy AAA. Based on what I've gathered, everyone seems to suggest to use OpenGL 3+ with shaders,...
1
vote
4answers
284 views

How to draw a Minecraft-like world with Open GL

I recently completed the this Open GL tutorial. The tutorial shows how to set up a window and shaders, and teaches you how to draw a single cube in the middle of the screen, which all makes sense to ...
1
vote
1answer
70 views

Libgdx, TiledMap, and tearing

My TiledMap tears when the window is specific sizes, resized, or the camera moves. The tileset is padded by 2px and have tried as high as 10px. Each tile is 70x70. Here are the pack.json ...
0
votes
0answers
26 views

In Cocos-2d-x, is there a way to get a shared OpenGL context for use with background loading

We are using parts of the Cocos-2D-X engine and we have a background loading thread which loads textures in the background. Is there a way to get a ShareGroup so we can safely bind an OpenGL context ...
0
votes
0answers
39 views

OpenGL ES 2.0 how to access LUT

I've created a look up table for my fragment shader and I'm passing it in as a uniform float array. uniform float hueLut[360]; My program works fine on most devices but I ran across one device ...
0
votes
1answer
53 views

One framebuffer for each light vs unique framebuffer per light

Currently I have two ideas how to implement my lighting system: 1) Use one framebuffer per light source no need to switch texture attachments of framebuffer may be faster bigger memory usage 2) ...
0
votes
4answers
82 views

Issue translating objects by one unit in the y direction

I'm currently making space invaders (in OpenGL/SDL) and I'm running into an issue with the movement of the aliens. I have a 2-d vector of aliens (5 rows of 11) and I'm translating each in the x ...
2
votes
2answers
183 views

What happens if I don't call glNormal for some vertices?

Let's say I have an object where some vertices will have the same normal and some won't. Are these two equivalent? Note I'm working with an old OpenGL version (2.3 I think). Option 1 glNormal3f(...
1
vote
0answers
69 views

Memory leak with glfwSetWindowTitle? [closed]

I am using GLFW for a game, and I have a function which allows me to set the window title. // PROBLEM WITH INCREASING MEMORY USAGE void WindowSystem::setTitle( const string & title ) {...
0
votes
1answer
85 views

Sprite quickly disappears after rendering

I'm currently making space invaders and I'm using the game loop pattern as described here. I have an entity class from which there is a spaceship derived class. The base entity class contains all of ...
0
votes
0answers
36 views

Unprojecting a 2D triangle

I am looking to describe triangle in world space, given that the following are known: Two of its vertices in screen space (or rays in the world) One of its vertices in world space (the right angle ...
0
votes
1answer
65 views

Sprite Sheet Texture not being rendered

I'm making space invaders (in OpenGL/SDL) and I've run into a problem when trying to draw the sprite for the spaceship from the spritesheet. In my entity class, I have a pointer for the sprite that ...
1
vote
1answer
37 views

Android Opengl: Alternate values for gl_FragColor

I'm writing an Android application that utilizes opengl to perform some changes to the camera output. I've written my code in such a way that I finally figured out what is causing the performance ...
0
votes
0answers
40 views

Multithread OpenGL to Upload Meshes

My game is rendered in dynamically generated chunks, each of which has its own mesh. Every time I generate a chunk and upload its mesh, there is a huge lag spike. Is there a good way of eliminating ...
0
votes
1answer
45 views

GlViewport-code doesn't work in one specific screen?

I am currently working on a small game using LibGDX and Java. However, I have found one oddly specific problem. I want the game to resize so that it never has to be cropped and so it never has to cut ...
0
votes
2answers
155 views

Optimising Voxel World Rendering

There are a couple of questions like this already. This one is different because it is specifically about rendering, as opposed to navigation and generation. I've implemented suggestions from here ...
0
votes
2answers
211 views

SDL or SFML: which is the best option if I only want to use OpenGL for my graphics? [closed]

I've read a lot about creating graphics with OpenGL in SDL and SFML over the past few days, and I want to know which one I should pick. As mentioned in most of the things that I've read, both allow ...
0
votes
1answer
82 views

Projection Matrix Breaks My Rectangle

This is my vertex shader, shown below. #version 330 core in vec3 a_position; in vec4 a_colour; // FOV = 70, near plane = 0.1, far plane = 1000 const mat4 u_projection = mat4( 1.428148, 0.0, 0.0,...
0
votes
0answers
56 views

SSAO attenuation problem

I followed this tutorial and I'm getting incorrect results for SSAO. My gBuffer seems valid. Here is a picture showing Ambient Occlusion, Normalized Depth, Normals in View Space and Position. ...
1
vote
1answer
108 views

Textures created with Photoshop show up with a white border

All of a sudden, I started having this problem. I've used libGDX + Photoshop before and never had this problem. One of my textures is showing up with a white border/glow around. The texture is the ...
0
votes
0answers
61 views

Merging OpenGL rendering result with other graphical elements like user interface. Concepts

For my application, there are several elements drawing: An user interface elements, and several libraries for rendering part of the content of the window. Lets imagine some kind of Google Earth where ...
0
votes
0answers
35 views

Trouble with OpenGL on OS X

I'm creating an OpenGL-based game for OS X using Xcode. Everything renders correctly when I run the game in debug mode. However, running the game in release mode shows just a blank white window. This ...
1
vote
1answer
119 views

Should I always prefer a Uniform Buffer Object to a uniform variable for per-model uniforms in OpenGL?

I was looking for a way to update uniforms for all of my scene objects efficiently and I came across the following gamedev stackexchange question, where the top answer gives a bonus tip. It states: ...
0
votes
2answers
96 views

Build a vbo once every second

I have a VBO storing some data in my game. The thing is, the data can change at a rate of about a second. The data is not fixed size, meaning that some objects will sometimes be visible, sometimes ...
3
votes
1answer
66 views

Dynamically generating triangles from points

I'm working on 2D lighting. I have a list of points that have been calculated and when I draw lines from the light origin to the point it works. The problem is connecting the points into triangles. ...
2
votes
2answers
116 views

How to display multiple textures with OpenGL without a texture atlas

I tried to dig into OpenGL a bit to use in 2D games (mainly because of shaders). There are multiple tutorials out there showcasing how to display and blend textures, and that's fine. But i haven't ...
1
vote
0answers
43 views

Drawing multiple polygons with vertex buffer object

I tried to create program in which I would draw multiplepoygons here is fragment of what I have done: GLuint VertexArrayID; exampleof drawing triangle(I have more polygons, like circle, and so on..)...
0
votes
2answers
142 views

Switched from immediate mode to VBOs, game runs slower

trying to improve draw performance on my c++, OpenGL, SDL game. Back in school we mostly learned immediate mode, so thats how my drawing was originally implemented. When I started reading up online ...
0
votes
0answers
30 views

Open gl blending problem c++

im creating project from nearly scratch in c++.. i created skybox and terrain . the result is catastrophic ! the terrain goes away and the ground also goes away,i dont know why ! i tried to disable ...
0
votes
0answers
42 views

glOrtho and VBO

I'm trying to send triangles to OpenGL using screen coordinates. Using the deprecated glBegin and glEnd I could just set up an orthographic projection and use screen-space coordinates as the triangles/...
-1
votes
1answer
124 views

C++: from LWJGL to C++ with OpenGL

I've been trying my best on porting my 3D game from Java to C++, but to no avail. I use only LWJGL with OpenGL but I cannot find any other library in C++ that supports as much as LWJGL does for Java. ...
0
votes
2answers
77 views

How do game engines manage to 'detect' the opengl supported in a computer

I am learning OpenGL 3.3 and OpenGL 2.1. I want to make a game engine with both. So far I can do advanced stuff with both of them. I noticed that graphics engines like Irrlicht support OpenGL 1.x to 4....
0
votes
1answer
73 views

Issue with detecting collisions in Pong

I've been working on making Pong in OpenGL and SDL and currently have both paddles and the game ball set up properly. I have an Object (or Entity) class which is used to instantiate each of the ...
0
votes
1answer
60 views

OpenGL dynamic font glyph cache library

I have begun work on an OpenGL application (all on my own and with little knowledge) and started with FTGL, rendering true type fonts, which, with alot of text has a great impact on frames per second. ...
4
votes
1answer
103 views

Mesh's triangles don't move properly during skeletal animation

I've been trying to implement skeletal animation in my engine using this tutorial, and I've been having problems. Using the model they provided, I get results like this: But on some other models, ...
1
vote
0answers
57 views

Front Face Culling with Shadowmapping

To avoid shadow acne I usualy use front face culling which works great. But for my current implementation the mesh is a quite complex terrain (depending on the lod level) and than the shading (dot ...
1
vote
1answer
250 views

Performance of glDrawElements vs glDrawRangeElements vs glDrawArrays

I've looked around on the web trying to find a good answer to this, but am unable to find one. Different forums mention driver bugs and the likes, but these discussions are usually almost 10 years old,...
1
vote
1answer
310 views

SDL2, OpenGL, Nvidia laptop screen tearing

EDIT 2016-03-06. Note 1: Apparently this is a known issue with Nvidia. If you've found here due to same problem, please stoke the collective "please fix it" by filing a "question" at https://nvidia....
4
votes
0answers
112 views

Windows vs OSX Performance with SDL, OpenGL [closed]

I have been writing an SDL OpenGL game in c++ for a couple of years now, writing my own engine for the most part (using Box2d for physics). I'm primarily a mac user, so I've been using xCode to write ...
1
vote
1answer
106 views

OpenGL Applications Bring computer to halt

Whenever I run any application that utilizes the OpenGL interface, my entire computer comes to a halt, but it doesn't do this when it utilizes the DirectX interface. I run both Linux (Ubuntu 15.10) ...
-1
votes
1answer
40 views

[opengl]get world position after rotate object by pivot

I need to rotate an object around a pivot,so I use this theory: Translate the object to Pivot position Rotate the object Translate back the object from Pivot position everything works fine,I can ...
0
votes
1answer
49 views

OpenGL - Quad is being separated like a two triangles after blending

I wanted to add transparency for my UI elements, so I enabled blending by adding: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); before renderer and glDisable(GL_BLEND); ...
0
votes
1answer
78 views

OpenGL texture 2d array won't render with depth > 1

Below code uploads my texture memory that's described in the passed parameters. When 'vPixelData' only holds 1 item/texture it is rendered properly, but once there's 2 or more nothing shows up. ...
0
votes
0answers
36 views

How do I implement a LWJGL orthogonal matrix?

As seen on the official LWJGL page, I tried. But failed. All the things I've found on SO and other sites didn't answer anything that had to do with this specifically. I've been on this for weeks. It's ...
0
votes
1answer
71 views

OpenGL GLSL vector of sampler2D

If im trying to create an obj. file loader in c++ and draw it with opengl i need to use multiple textures in the fragment shader.I know i can just use: `uniform sampler2D Texture1` `uniform ...
0
votes
0answers
80 views

How to copy texture of type GL_TEXTURE_EXTERNAL_OES to a texture of type GL_TEXTURE_2D

How to copy texture of type GL_TEXTURE_EXTERNAL_OES to a texture of type GL_TEXTURE_2D ? How to find the internal format of texture ?
0
votes
1answer
56 views

How do I calculate a vertex's position on the CPU?

I'm creating light processor and I need light position and vertex position after translating, rotating and scaling (to calculate distance between them to check if light is affecting my vertex somehow)....
0
votes
1answer
104 views

C++ & OpenGL - Bad orthographic projection matrix?

So I'm trying to render 2D text in my Game Engine using programmable pipeline. Normally I'm using perspective projection matrix but for UI elements I'm trying to create orthographic projection matrix ...
1
vote
1answer
28 views

Should I add error handling to SDL_GL_SetAttribute?

As the title says, I wonder if I should handle errors for : SDL_GL_SetAttribute Can it actually fail to set? And if it can, what could be a reason for it to fail?
1
vote
1answer
142 views

OpenGL Arc-Ball Camera Yaw Pitch GLM::Rotate

I'm currently working on a small Voxel-Editor Project. In the editor, I plan on using an Arc-Ball camera which rotate around the model. My camera is currently working but in an odd way. I can't seem ...