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

How should my engine Identify objects

I'm making a fairly basic openGL 3D engine, at the moment, when you load an object, you would write manager->LoadObjFile("cube.obj"); manager->AddParent("uvmap.bmp", "cube.obj", "cube", ...
4
votes
0answers
36 views

Irradiance Map ( Irradiance environment map)?

As irradiance map is generated for every possible normal for all the texels in environment map (as every texel act as a light source) so that we can look up irradiance map, based on normal of fragment ...
0
votes
1answer
32 views

OpenGL EBO vs Mesh representation

As an exercise set to myself, I wanted to make a Mesh loader using modern OpenGL. However, I have to ways of representing the notion of face of a mesh. Currently, I am using what seems the most ...
1
vote
2answers
43 views

OpenGL strange color issue

I recently made terrain generation for my game, and I created a lighting system (simply diffuse lignting), but there's a strange problem around the edges. I know, OpenGL interpolates the different ...
-1
votes
1answer
123 views

Create YUV texture for GL_TEXTURE_EXTERNAL_OES format

0 down vote favorite I need to create a yuv texture for GL_TEXTURE_EXTERNAL_OES format. source : ...
1
vote
0answers
89 views

Turning On/Off Vsync no longer working when rendering to an offscreen buffer

I have this reaallly strange issue that as soon as I render to an offscreen framebuffer I am no longer able to toggle VSync while my application is running. I am using OpenTK as the opengl wrapper, ...
1
vote
1answer
46 views

opengl storing multiple indices into indices buffer

After parsing collada files I found out that we have to load two(or more) indices each pointing to say a vertex or normal etc. like this (<p>3 0 2 0 0 0</p>) Is there a way to load (and ...
0
votes
0answers
41 views

How to properly use a 3D texture in OpenGL 4?

I working on a student project which consists to make clouds volumetric rendering and implement the feature in an existing engine based on OpenGL 4 and written in C++. To do so, I have set a compute ...
0
votes
0answers
32 views

Tilemap not rendering properly

I'm making a single-screen scrolling platformer (OpenGL/SDL) and I've made a tilemap out of a 2D array, pre-sized with variables of the LEVEL_HEIGHT and LEVEL_WIDTH. Each element in this 2D array ...
0
votes
1answer
47 views

Strange shadow behavior when light direction is parallel to a plane

i have a strange problem with shadow acne. It occurs when the light direction is parallel to a plane. Here is my code and a few images of the problem: //this calculates the shadow matrix ...
0
votes
2answers
40 views

OpenGL perspective matrix far plane

The near plane clips at exactly the value I set just fine but instead of clipping at 1000 the far plane clips at 1. Here is the code for the projection matrix: public static Matrix4f ...
0
votes
1answer
55 views

Irrlicht app: Creating STL exception leads to segfault

I'm developing application with C++ language and Irrlicht engine. When I add std::runtime_error("err") expression into my code, I got segmentation fault at address 0 (before entering to main). If ...
1
vote
1answer
51 views

Opengl occlusion culling huge performance drop

Hello I tried to implement occlusiong culling to my engine in opengl using java & lwjgl. Occlusion works but... performance drop is huge I mean from 60-70 fps to 3-6 fps. Here is my question what ...
5
votes
2answers
579 views

Why would one use a separate alpha mask for sprites?

I've seen tilesets of the game Braid, and for each tileset in the main folder there is an alpha map for it in "alpha" folder. I wonder, why just not to draw your image as it is (with transparent ...
2
votes
0answers
54 views

GLSL shader with light colors wrong on nvidia optimus

So, I built some code to draw a spinning cube with a red light on the right side, and a blue one on the left. I run it on my laptop with optimus graphics, and on my desktop with nvidia. On the laptop, ...
0
votes
2answers
86 views

How can I better structure my code to reduce coupling between input and graphics?

I've been working through a few OpenGL tutorials, and decided to give myself the exercise of trying to draw a grid, with the added requirement of being able to press the - and + keys to change the ...
0
votes
1answer
26 views

Reset Opengl multisampling

I start using multisampling by doing ContextAttribs attribs = new ContextAttribs(3, 3).withForwardCompatible(true).withProfileCore(true); Display.create(new ...
1
vote
1answer
108 views

Collisions being detected before objects are intersecting

I'm making space invaders (in OpenGL/SDL) and I'm currently having issues with getting the collisions (box collisions) between the bullets and the enemies to be properly detected. In my update() ...
-1
votes
2answers
62 views

How to lock the mouse cursor in the middle in a first person camera?

I want to get a first person camera (like Call of Duty or Minecraft etc.) but I don't know which is the best way to do it. I have some camera increase rotation methods (camera.increase ...
1
vote
1answer
88 views

How do I structure code with multiple VBOs?

As per my previous question, it seems it would be desirable to use more than a single VBO in my OpenGL program. But I've hit a wall when trying to do this. Currently my main function looks something ...
0
votes
1answer
49 views

Frustum culling only working at certain angles

So how I'm doing this is a little sketchy but I plan on changing it to either AABBs or spheres once I get it working. So the problem I'm having right now is that the frustum culling I've implemented ...
0
votes
1answer
62 views

Black Screen when using High-Performance NVIDIA Processor

I have an issue where my program renders a black screen on other computers. I narrowed it down to when a different graphics card is being used. When I run the program using Integrated Graphics ...
0
votes
2answers
86 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 ...
1
vote
4answers
265 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
60 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
20 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
33 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
50 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
80 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 ...
1
vote
0answers
62 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
77 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
35 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
50 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
34 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
38 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
34 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
139 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
151 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
75 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
votes
0answers
43 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
93 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
47 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
31 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 ...
0
votes
1answer
90 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
76 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
62 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
82 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
38 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 ...
0
votes
2answers
137 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 ...