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

1
vote
1answer
54 views

How to tell OpenGL to use normals for lighting?

Let's say I have glGenBuffers(1, &vertexbuffer); glGenBuffers(1, &indexbuffer); glGenBuffers(1, &normalbuffer); glBindBuffer(GL_ARRAY_BUFFER,vertexbuffer); ...
1
vote
0answers
74 views

C++ Modern OpenGL - Calculate Vertex Normals

I'm learning modern OpenGL and i just got started so go easy on me :). Right now im trying to understand normals but im having some difficulties. On my program i have this class which i use to draw ...
0
votes
1answer
71 views

How do i make floors of varying height in OpenGL?

So I am currently working on a small Game(/engine) in OpenGL and I want to build a little world editor. Nothing too fancy: Just some functions to add objects to a scene and manipulate them (rotation, ...
4
votes
2answers
677 views

OpenGL 2.1 vs Modern OpenGL

I want to make a 3D voxel game, randomly generated planets, some with live (one minimum with life) , and they are spinning around the sun. For now I have this in OpenGL 2.1 (using fixed pipeline, ...
2
votes
0answers
46 views

How to calculate specular contribution in PBR?

I'm trying to implement PBR in our project (we started a small game engine for academic and learning purposes) and I cannot understand what is the right way to calculate specular and diffuse ...
1
vote
0answers
37 views

OpenGL texture not loading onto the model

I am still learning and I'd like to apologize if I don't explain something clear enough or anything like that. please forgive me :) So I am experimenting with 3D graphics for my university assignment....
1
vote
0answers
30 views

Inverted FXAA Shader

I'm trying to use an existing FXAA shader which works but when I try to run it the filtered image is inverted. http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-...
3
votes
1answer
99 views

How should I structure VBOs for my 2d world data?

My game is played on a fixed-size hex based arena, where each hex can be of a different type, and possibly contain some creatures/items/anything on it. When I started out, I got the advice to have a ...
3
votes
1answer
112 views

Sine-based Tiled Procedural Bump

I am trying to implement this formula to generate bump but I am facing some issue. The result doesn't look the same it's much darker. Here is my result (without same parameters) but it is much ...
1
vote
0answers
28 views

Skin Mesh Animation Shader Issue

I'm having troubles with properly animating a skin mesh from an .fbx file. I feel like the issue is in the shader, but not sure what is going on. All I know is that I am getting unexpected results ...
0
votes
0answers
58 views

vertex shader doesn't work properly

Linux, OPenGL 3.0, GLSL 130 (Intel card) I'm learning OpenGL and successfully rendered a triangle, but as soon as I create the matrix of projection I get an error. The shader compiles and works ...
1
vote
0answers
60 views

Slick2D fails to load small textures

I'm trying to load a small 32x32 png texture using Slick2D, however it doesn't seem to render correctly. What's odd is that larger textures do load correctly. The 32x32 texture I'm trying to load: ...
1
vote
1answer
90 views

GL uniform variables

I have been studying on glsl lately, starting from very simple vertex and fragment shaders creation for Blender3d, I was quickly drawn to writing the OpenGL context in C++. I find it difficult to ...
2
votes
1answer
55 views

draw two models changing the MVP matrix (android opengl)

I'm newbie with opengl2 in android, and I'm making an app in which I'm testing some things. Now I was trying to duplicate a sphere object with a texture, so I thought it was enough to change my MVP ...
4
votes
0answers
55 views

Spherical Area Lights do not match reference

So I'm adding spherical area lights to my application, and comparing my results with mitsuba, I am getting some differences (left is my approach, right is mitsuba - a pathtraced reference): What I ...
1
vote
1answer
41 views

Storing and using UV and Normal Data with OpenGL [duplicate]

I'm having trouble mapping UV coordinates to vertices in OpenGL. I'm binding my buffers and enabling all of my attrib arrays perfectly well and things are rendering - but what I'm stuck on is how to ...
0
votes
1answer
36 views

Send OpenGL video flux via UDP [closed]

It is possible to send the video flux of an OpenGL desktop app via UDP on Linux ? I looked up FBO and off-screen rendering but I still can't figure out how to extract the video flux and send it. I'm ...
1
vote
1answer
65 views

Solution for Shipping Optimized and Minified GLSL?

I've tried to find a reputable optimizing compiler for GLSL that takes source shaders, performs what optimizations it can statically assume, and outputs a minified GLSL file with optimizations, ...
0
votes
1answer
49 views

OpenGL: Generating a single square with a Quad Strip

I am currently trying to create a terrain generation system (for my 3D game) with OpenGL 2.1. The way I am doing it requires the creation of a massive 2D square that consists of multiple smaller ...
0
votes
0answers
39 views

How to spin a 2D quad in place using only matrices?

In short, I have a textured 2D quad (a sprite). I would like to rotate/spin it about the z-axis (coming out of the screen) using nothing but matrices. If I do the following to a transform with scale ...
0
votes
1answer
97 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", glm::...
4
votes
0answers
73 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
40 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
57 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
218 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 : https://github.com/crossle/MediaPlayerSurface/blob/master/src/me/crossle/demo/surfacetexture/...
1
vote
0answers
97 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
56 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 use)...
0
votes
0answers
71 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
39 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
53 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
53 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 perspective(...
0
votes
1answer
65 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
67 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
588 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
65 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
97 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
28 views

Reset Opengl multisampling

I start using multisampling by doing ContextAttribs attribs = new ContextAttribs(3, 3).withForwardCompatible(true).withProfileCore(true); Display.create(new PixelFormat().withSamples(...
1
vote
1answer
112 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
71 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 Rotation(x,y,z)...
1
vote
1answer
91 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
53 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
91 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
99 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
301 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
74 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
41 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
56 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
184 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(...